Detection rules › Sigma

Suspicious Csi.exe Usage

Status
test
Severity
medium
Log source
product windows, category process_creation
Author
Konstantin Grishchenko, oscd.community
Source
github.com/SigmaHQ/sigma

Csi.exe is a signed binary from Microsoft that comes with Visual Studio and provides C# interactive capabilities. It can be used to run C# code from a file passed as a parameter in command line. Early version of this utility provided with Microsoft “Roslyn” Community Technology Preview was named 'rcsi.exe'

MITRE ATT&CK coverage

Event coverage

ProviderEventTitle
SysmonEvent ID 1Process creation

Rule body yaml

title: Suspicious Csi.exe Usage
id: 40b95d31-1afc-469e-8d34-9a3a667d058e
status: test
description: Csi.exe is a signed binary from Microsoft that comes with Visual Studio and provides C# interactive capabilities. It can be used to run C# code from a file passed as a parameter in command line. Early version of this utility provided with Microsoft “Roslyn” Community Technology Preview was named 'rcsi.exe'
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
author: Konstantin Grishchenko, oscd.community
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

Stages and Predicates

Stage 0: condition

all of selection*

Stage 1: selection_img

selection_img:
    - Image|endswith:
          - '\csi.exe'
          - '\rcsi.exe'
    - OriginalFileName:
          - 'csi.exe'
          - 'rcsi.exe'

Stage 2: selection_cli

selection_cli:
    Company: 'Microsoft Corporation'

Indicators

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
Companyeq
  • Microsoft Corporation corpus 2 (sigma 1, splunk 1)
Imageends_with
  • \csi.exe corpus 2 (sigma 2)
  • \rcsi.exe
OriginalFileNameeq
  • csi.exe corpus 2 (sigma 2)
  • rcsi.exe