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-07-18
12tags:
13 - attack.privilege-escalation
14 - attack.persistence
15 - attack.t1547.001
16logsource:
17 category: registry_set
18 product: windows
19detection:
20 selection:
21 TargetObject|contains:
22 - '\Software\Microsoft\Windows\CurrentVersion\Run' # Also covers "RunOnce" and "RunOnceEx"
23 - '\Software\WOW6432Node\Microsoft\Windows\CurrentVersion\Run'
24 - '\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\Run'
25 Details|contains:
26 - 'powershell'
27 - 'pwsh '
28 - 'FromBase64String'
29 - '.DownloadFile('
30 - '.DownloadString('
31 - ' -w hidden '
32 - ' -w 1 '
33 - '-windowstyle hidden'
34 - '-window hidden'
35 - ' -nop '
36 - ' -encodedcommand '
37 - '-ExecutionPolicy Bypass'
38 - 'Invoke-Expression'
39 - 'IEX ('
40 - 'Invoke-Command'
41 - 'ICM -'
42 - 'Invoke-WebRequest'
43 - 'IWR '
44 - 'Invoke-RestMethod'
45 - 'IRM '
46 - ' -noni '
47 - ' -noninteractive '
48 condition: selection
49falsepositives:
50 - Legitimate admin or third party scripts. Baseline according to your environment
51level: medium
References
Related rules
- Classes Autorun Keys Modification
- Common Autorun Keys Modification
- CurrentControlSet Autorun Keys Modification
- CurrentVersion Autorun Keys Modification
- CurrentVersion NT Autorun Keys Modification