Detection rules › Sigma

Suspicious Service DACL Modification Via Set-Service Cmdlet

Severity
high
Author
Nasreddine Bencherchali (Nextron Systems)
Source
upstream

Detects suspicious DACL modifications via the "Set-Service" cmdlet using the "SecurityDescriptorSddl" flag (Only available with PowerShell 7) that can be used to hide services or make them unstopable

MITRE ATT&CK coverage

TacticTechniques
PersistenceT1543.003 Create or Modify System Process: Windows Service
Privilege EscalationT1543.003 Create or Modify System Process: Windows Service

Event coverage

ProviderEvent IDTitle
Sysmon1Process creation

Stages and Predicates

Stage 1: all of selection_img

or:
Image|endswith: '\pwsh.exe'
OriginalFileName: pwsh.dll

Stage 2: all of selection_sddl_flag

or:
CommandLine|contains: '-SecurityDescriptorSddl '
CommandLine|contains: '-sd '

Stage 3: all of selection_set_service

or:
CommandLine|contains: ';;;BA'
CommandLine|contains: ';;;IU'
CommandLine|contains: ';;;SU'
CommandLine|contains: ';;;SY'
CommandLine|contains: ';;;WD'
CommandLine|contains: 'D;;'
CommandLine|contains: 'Set-Service '

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
CommandLinematch
  • -SecurityDescriptorSddl corpus 2 (sigma 2)
  • -sd corpus 2 (sigma 2)
  • ;;;BA
  • ;;;IU
  • ;;;SU
  • ;;;SY
  • ;;;WD
  • D;;
  • Set-Service corpus 2 (sigma 2)
Imageends_with
  • \pwsh.exe corpus 140 (sigma 140)
OriginalFileNameeq
  • pwsh.dll corpus 72 (sigma 68, splunk 4)