Detection rules › Sigma

PowerShell as a Service in Registry

Status
test
Severity
high
Log source
product windows, category registry_set
Author
oscd.community, Natalia Shornikova
Source
github.com/SigmaHQ/sigma

Detects that a powershell code is written to the registry as a service.

MITRE ATT&CK coverage

Event coverage

ProviderEventTitle
SysmonEvent ID 13RegistryEvent (Value Set)

Rule body yaml

title: PowerShell as a Service in Registry
id: 4a5f5a5e-ac01-474b-9b4e-d61298c9df1d
status: test
description: Detects that a powershell code is written to the registry as a service.
references:
    - https://speakerdeck.com/heirhabarov/hunting-for-powershell-abuse
author: oscd.community, Natalia Shornikova
date: 2020-10-06
modified: 2023-08-17
tags:
    - attack.execution
    - attack.t1569.002
logsource:
    category: registry_set
    product: windows
detection:
    selection:
        TargetObject|contains: '\Services\'
        TargetObject|endswith: '\ImagePath'
        Details|contains:
            - 'powershell'
            - 'pwsh'
    condition: selection
falsepositives:
    - Unknown
level: high

Stages and Predicates

Stage 0: condition

selection

Stage 1: selection

selection:
    TargetObject|contains: '\Services\'
    TargetObject|endswith: '\ImagePath'
    Details|contains:
        - 'powershell'
        - 'pwsh'

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
Detailsmatch
  • powershell corpus 10 (sigma 9, chronicle 1)
  • pwsh corpus 5 (sigma 5)
TargetObjectends_with
  • \ImagePath corpus 3 (sigma 3)
TargetObjectmatch
  • \Services\ corpus 4 (sigma 4)