Suspicious Powershell In Registry Run Keys

Detects potential PowerShell commands or code within registry run keys

Sigma rule (View on GitHub)

 1title: Suspicious Powershell In Registry Run Keys
 2id: 8d85cf08-bf97-4260-ba49-986a2a65129c
 3status: test
 4description: Detects potential PowerShell commands or code within registry run keys
 5references:
 6    - https://github.com/frack113/atomic-red-team/blob/a9051c38de8a5320b31c7039efcbd3b56cf2d65a/atomics/T1547.001/T1547.001.md#atomic-test-9---systembc-malware-as-a-service-registry
 7    - https://www.trendmicro.com/en_us/research/22/j/lv-ransomware-exploits-proxyshell-in-attack.html
 8    - https://github.com/HackTricks-wiki/hacktricks/blob/e4c7b21b8f36c97c35b7c622732b38a189ce18f7/src/windows-hardening/windows-local-privilege-escalation/privilege-escalation-with-autorun-binaries.md
 9author: frack113, Florian Roth (Nextron Systems)
10date: 2022-03-17
11modified: 2025-02-17
12tags:
13    - attack.persistence
14    - attack.t1547.001
15logsource:
16    category: registry_set
17    product: windows
18detection:
19    selection:
20        TargetObject|contains:
21            - '\Software\Microsoft\Windows\CurrentVersion\Run' # Also covers "RunOnce" and "RunOnceEx"
22            - '\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Run'
23            - '\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\Run'
24        Details|contains:
25            - 'powershell'
26            - 'pwsh '
27            - 'FromBase64String'
28            - '.DownloadFile('
29            - '.DownloadString('
30            - ' -w hidden '
31            - ' -w 1 '
32            - '-windowstyle hidden'
33            - '-window hidden'
34            - ' -nop '
35            - ' -encodedcommand '
36            - '-ExecutionPolicy Bypass'
37            - 'Invoke-Expression'
38            - 'IEX ('
39            - 'Invoke-Command'
40            - 'ICM -'
41            - 'Invoke-WebRequest'
42            - 'IWR '
43            - ' -noni '
44            - ' -noninteractive '
45    condition: selection
46falsepositives:
47    - Legitimate admin or third party scripts. Baseline according to your environment
48level: medium

References

Related rules

to-top