Detection rules › Sigma

PowerShell as a Service in Registry

Status
test
Severity
high
Log source
category registry_set, product windows
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

Telemetry coverage

Rule body

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

These rows show field, operator, and value matches.

FieldKindValuesSearch
Detailsmatch
  • powershell corpus 11 (sigma 9, elastic 1, chronicle 1)
  • pwsh corpus 5 (sigma 5)
field:"Details" kind:match
TargetObjectends_with
  • \ImagePath corpus 3 (sigma 3)
field:"TargetObject" kind:ends_with value:"\ImagePath"
TargetObjectmatch
  • \Services\ corpus 4 (sigma 4)
field:"TargetObject" kind:match value:"\Services\"