Suspicious Microsoft Csi.exe or Rcsi.exe Execution on Windows

Alerts on Windows executions of Microsoft’s csi.exe/rcsi.exe that can be used to run C# code from command-line.

FreeUnreviewedSigmamediumv1
title: Suspicious Microsoft Csi.exe or Rcsi.exe Execution on Windows
id: 035d224c-aa8a-4e94-9979-05bc111b60f7
status: test
description: This rule flags process creations where the executable path ends with csi.exe or rcsi.exe and the binary’s original filename matches those names, with the company identified as Microsoft Corporation. Attackers can abuse these signed C# interactive utilities to execute code supplied via command-line arguments, which may help them blend in with legitimate developer tooling. Telemetry relies on Windows process creation events that include the executable name/path, original file name, and signer/company attribution.
references:
  - https://lolbas-project.github.io/lolbas/OtherMSBinaries/Csi/
  - https://lolbas-project.github.io/lolbas/OtherMSBinaries/Rcsi/
  - https://enigma0x3.net/2016/11/21/bypassing-application-whitelisting-by-using-rcsi-exe/
  - https://twitter.com/Z3Jpa29z/status/1317545798981324801
  - https://github.com/SigmaHQ/sigma/blob/master/rules/windows/process_creation/proc_creation_win_csi_execution.yml
author: Konstantin Grishchenko, oscd.community, Huntrule Team
date: 2020-10-17
modified: 2022-07-11
tags:
  - attack.lateral-movement
  - attack.execution
  - attack.stealth
  - attack.t1072
  - attack.t1218
logsource:
  category: process_creation
  product: windows
detection:
  selection_img:
    - Image|endswith:
        - \csi.exe
        - \rcsi.exe
    - OriginalFileName:
        - csi.exe
        - rcsi.exe
  selection_cli:
    Company: Microsoft Corporation
  condition: all of selection*
falsepositives:
  - Legitimate usage by software developers
level: medium
license: DRL-1.1
related:
  - id: 40b95d31-1afc-469e-8d34-9a3a667d058e
    type: derived

What it detects

This rule flags process creations where the executable path ends with csi.exe or rcsi.exe and the binary’s original filename matches those names, with the company identified as Microsoft Corporation. Attackers can abuse these signed C# interactive utilities to execute code supplied via command-line arguments, which may help them blend in with legitimate developer tooling. Telemetry relies on Windows process creation events that include the executable name/path, original file name, and signer/company attribution.

Known false positives

  • Legitimate usage by software developers

Detection content is published as a reviewed draft. Tune thresholds and exclusions against your own telemetry before enabling this rule for alerting.