Windows System: Service Control Manager runs command with obfuscated PowerShell keywords via set and stdin
Alerts on service creation where ImagePath includes obfuscation-like command chaining with environment/invoke/input strings.
- Product
- windows
- Service
- system
- Author
- Nikita Nazarov, oscd.community (SigmaHQ), DRL 1.1
- Published
- 2020-10-12
- Updated
- 2026-07-31
ATT&CK techniques
Execution → Defense EvasionRecon
Resource Dev
Initial Access
Execution
Persistence
Priv Esc
Defense Evasion
Cred Access
Discovery
Lateral Movement
Collection
C2
Exfiltration
Impact
What it detects
This rule flags Windows Service Control Manager (Event ID 7045) instances where the configured ImagePath contains command chaining with multiple 'set' statements and includes keywords such as 'environment', 'invoke', and 'input', consistent with obfuscated PowerShell-style execution patterns delivered through stdin-like inputs. Attackers may use this technique to obscure script intent and reduce detection by embedding operations in environment/variable setup and chained command segments. The detection relies on System service creation telemetry, specifically the ImagePath field from Event ID 7045.
Reporting behind it
Changelog
v2- v2Candidate ingested via manual entry.2026-07-31
- v1No changelog recorded for this version.2026-07-30
Detection content is published as a reviewed draft. Tune thresholds and exclusions against your own telemetry before enabling this rule for alerting.
title: "Windows System: Service Control Manager runs command with obfuscated PowerShell keywords via set and stdin"
id: 835e04a3-3c28-48a5-8835-d540fe2f7927
status: test
description: This rule flags Windows Service Control Manager (Event ID 7045) instances where the configured ImagePath contains command chaining with multiple 'set' statements and includes keywords such as 'environment', 'invoke', and 'input', consistent with obfuscated PowerShell-style execution patterns delivered through stdin-like inputs. Attackers may use this technique to obscure script intent and reduce detection by embedding operations in environment/variable setup and chained command segments. The detection relies on System service creation telemetry, specifically the ImagePath field from Event ID 7045.
references:
- https://github.com/SigmaHQ/sigma/issues/1009
- https://github.com/SigmaHQ/sigma/blob/master/rules/windows/builtin/system/service_control_manager/win_system_invoke_obfuscation_via_stdin_services.yml
author: Nikita Nazarov, oscd.community, Huntrule Team
date: 2020-10-12
modified: 2022-11-29
tags:
- attack.stealth
- attack.t1027
- attack.execution
- attack.t1059.001
logsource:
product: windows
service: system
detection:
selection:
Provider_Name: Service Control Manager
EventID: 7045
ImagePath|contains|all:
- set
- "&&"
ImagePath|contains:
- environment
- invoke
- input
condition: selection
falsepositives:
- Unknown
level: high
license: DRL-1.1
related:
- id: 487c7524-f892-4054-b263-8a0ace63fc25
type: derived