Detection rules › Sigma

Invoke-Obfuscation STDIN+ Launcher - Security

Status
test
Severity
high
Log source
product windows, service security
Author
Jonathan Cheong, oscd.community
Source
github.com/SigmaHQ/sigma

Detects Obfuscated use of stdin to execute PowerShell

MITRE ATT&CK coverage

Event coverage

Rule body yaml

title: Invoke-Obfuscation STDIN+ Launcher - Security
id: 0c718a5e-4284-4fb9-b4d9-b9a50b3a1974
related:
    - id: 72862bf2-0eb1-11eb-adc1-0242ac120002
      type: derived
status: test
description: Detects Obfuscated use of stdin to execute PowerShell
references:
    - https://github.com/SigmaHQ/sigma/issues/1009  # (Task 25)
author: Jonathan Cheong, oscd.community
date: 2020-10-15
modified: 2022-11-29
tags:
    - attack.stealth
    - attack.t1027
    - attack.execution
    - attack.t1059.001
logsource:
    product: windows
    service: security
    definition: The 'System Security Extension' audit subcategory need to be enabled to log the EID 4697
detection:
    selection:
        EventID: 4697
        ServiceFileName|contains|all:
            - 'cmd'
            - 'powershell'
    selection2:
        ServiceFileName|contains:
            - '${input}'
            - 'noexit'
    selection3:
        ServiceFileName|contains:
            - ' /c '
            - ' /r '
    condition: all of selection*
falsepositives:
    - Unknown
level: high

Stages and Predicates

Stage 0: condition

all of selection*

Stage 1: selection

selection:
    EventID: 4697
    ServiceFileName|contains|all:
        - 'cmd'
        - 'powershell'

Stage 2: selection2

selection2:
    ServiceFileName|contains:
        - '${input}'
        - 'noexit'

Stage 3: selection3

selection3:
    ServiceFileName|contains:
        - ' /c '
        - ' /r '

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
ServiceFileNamematch
  • /c
  • /r
  • ${input}
  • cmd corpus 5 (sigma 5)
  • noexit
  • powershell corpus 4 (sigma 4)