Detection rules › Sigma

Windows AMSI Related Registry Tampering Via CommandLine

Severity
high
Author
Swachchhanda Shrawan Poudel (Nextron Systems)
Source
upstream

Detects tampering of AMSI (Anti-Malware Scan Interface) related registry values via command line tools such as reg.exe or PowerShell. AMSI provides a generic interface for applications and services to integrate with antimalware products. Adversaries may disable AMSI to evade detection of malicious scripts and code execution.

MITRE ATT&CK coverage

TacticTechniques
Defense EvasionT1562.001 Impair Defenses: Disable or Modify Tools, T1562.006 Impair Defenses: Indicator Blocking

Event coverage

ProviderEvent IDTitle
Sysmon1Process creation

Stages and Predicates

Stage 1: selection_key

CommandLine|contains: AmsiEnable
CommandLine|contains: '\Software\Microsoft\Windows Script\Settings'

Stage 2: all of selection_powershell_img

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

Stage 3: all of selection_powershell_cmd

or:
CommandLine|contains: New-ItemProperty
CommandLine|contains: Set-ItemProperty
CommandLine|contains: 'sp '

Stage 4: all of selection_reg_img

or:
Image|endswith: '\reg.exe'
OriginalFileName: reg.exe

Stage 5: all of selection_reg_cmd

CommandLine|contains: add

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
  • AmsiEnable
  • New-ItemProperty corpus 4 (sigma 4)
  • Set-ItemProperty corpus 4 (sigma 4)
  • \Software\Microsoft\Windows Script\Settings
  • add corpus 16 (sigma 16)
  • sp corpus 2 (sigma 2)
Imageends_with
  • \powershell.exe corpus 143 (sigma 143)
  • \pwsh.exe corpus 140 (sigma 140)
  • \reg.exe corpus 46 (sigma 46)
OriginalFileNameeq
  • PowerShell.EXE corpus 64 (sigma 60, splunk 4)
  • pwsh.dll corpus 72 (sigma 68, splunk 4)
  • reg.exe corpus 29 (sigma 29)