Detection rules › Sigma

PowerShell Scripts Installed as Services

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

Detects powershell script installed as a Service

MITRE ATT&CK coverage

Event coverage

Rule body yaml

title: PowerShell Scripts Installed as Services
id: a2e5019d-a658-4c6a-92bf-7197b54e2cae
status: test
description: Detects powershell script installed as a Service
references:
    - https://speakerdeck.com/heirhabarov/hunting-for-powershell-abuse
author: oscd.community, Natalia Shornikova
date: 2020-10-06
modified: 2022-12-25
tags:
    - attack.execution
    - attack.t1569.002
logsource:
    product: windows
    service: system
detection:
    selection:
        Provider_Name: 'Service Control Manager'
        EventID: 7045
        ImagePath|contains:
            - 'powershell'
            - 'pwsh'
    condition: selection
falsepositives:
    - Unknown
level: high

Stages and Predicates

Stage 0: condition

selection

Stage 1: selection

selection:
    Provider_Name: 'Service Control Manager'
    EventID: 7045
    ImagePath|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
ImagePathmatch
  • powershell corpus 5 (sigma 5)
  • pwsh corpus 2 (sigma 2)
Provider_Nameeq
  • Service Control Manager corpus 50 (sigma 50)