{"id":"8d85cf08-bf97-4260-ba49-986a2a65129c","title":"Suspicious PowerShell In Registry Run Keys","description":"Detects potential PowerShell commands or code within registry run keys","author":"frack113, Florian Roth (Nextron Systems)","status":"test","level":"medium","date":"2022-03-17","modified":"2025-07-18","tags":["attack.privilege-escalation","attack.persistence","attack.t1547.001"],"technique_ids":["T1547.001"],"logsource":{"category":"registry_set","product":"windows"},"falsepositives":["Legitimate admin or third party scripts. Baseline according to your environment"],"references":["https://github.com/frack113/atomic-red-team/blob/a9051c38de8a5320b31c7039efcbd3b56cf2d65a/atomics/T1547.001/T1547.001.md#atomic-test-9---systembc-malware-as-a-service-registry","https://www.trendmicro.com/en_us/research/22/j/lv-ransomware-exploits-proxyshell-in-attack.html","https://github.com/HackTricks-wiki/hacktricks/blob/e4c7b21b8f36c97c35b7c622732b38a189ce18f7/src/windows-hardening/windows-local-privilege-escalation/privilege-escalation-with-autorun-binaries.md"],"source_path":"rules/windows/registry/registry_set/registry_set_powershell_in_run_keys.yml","source_sha256":"9f29e0402317857f75798afa28f725c2d7211243c2eb71115bd8461d70947c3e","source_url":"https://github.com/anpa1200/sigma/blob/b249e9683190cffdcaf188ccbfb90bf4759844e1/rules/windows/registry/registry_set/registry_set_powershell_in_run_keys.yml","license":"Detection Rule License 1.1","license_url":"https://github.com/SigmaHQ/Detection-Rule-License/blob/main/LICENSE.Detection.Rules.md","yaml":"title: Suspicious PowerShell In Registry Run Keys\nid: 8d85cf08-bf97-4260-ba49-986a2a65129c\nstatus: test\ndescription: Detects potential PowerShell commands or code within registry run keys\nreferences:\n    - https://github.com/frack113/atomic-red-team/blob/a9051c38de8a5320b31c7039efcbd3b56cf2d65a/atomics/T1547.001/T1547.001.md#atomic-test-9---systembc-malware-as-a-service-registry\n    - https://www.trendmicro.com/en_us/research/22/j/lv-ransomware-exploits-proxyshell-in-attack.html\n    - https://github.com/HackTricks-wiki/hacktricks/blob/e4c7b21b8f36c97c35b7c622732b38a189ce18f7/src/windows-hardening/windows-local-privilege-escalation/privilege-escalation-with-autorun-binaries.md\nauthor: frack113, Florian Roth (Nextron Systems)\ndate: 2022-03-17\nmodified: 2025-07-18\ntags:\n    - attack.privilege-escalation\n    - attack.persistence\n    - attack.t1547.001\nlogsource:\n    category: registry_set\n    product: windows\ndetection:\n    selection:\n        TargetObject|contains:\n            - '\\Software\\Microsoft\\Windows\\CurrentVersion\\Run' # Also covers \"RunOnce\" and \"RunOnceEx\"\n            - '\\Software\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Run'\n            - '\\Software\\Microsoft\\Windows\\CurrentVersion\\Policies\\Explorer\\Run'\n        Details|contains:\n            - 'powershell'\n            - 'pwsh '\n            - 'FromBase64String'\n            - '.DownloadFile('\n            - '.DownloadString('\n            - ' -w hidden '\n            - ' -w 1 '\n            - '-windowstyle hidden'\n            - '-window hidden'\n            - ' -nop '\n            - ' -encodedcommand '\n            - '-ExecutionPolicy Bypass'\n            - 'Invoke-Expression'\n            - 'IEX ('\n            - 'Invoke-Command'\n            - 'ICM -'\n            - 'Invoke-WebRequest'\n            - 'IWR '\n            - 'Invoke-RestMethod'\n            - 'IRM '\n            - ' -noni '\n            - ' -noninteractive '\n    condition: selection\nfalsepositives:\n    - Legitimate admin or third party scripts. Baseline according to your environment\nlevel: medium\n","validation":"yaml_parsed_not_backend_compiled_or_live_validated","techniques":[{"key":"enterprise/T1547.001","id":"T1547.001","name":"Registry Run Keys / Startup Folder","page":"techniques/enterprise/T1547.001/"}],"data_path":"data/detection-rules/8d85cf08-bf97-4260-ba49-986a2a65129c.json","kind":"sigma"}
