Windows System Service Control Manager spawning cmd with PowerShell and stdin input obfuscation

Flags SCM-created services whose ImagePath runs cmd to invoke PowerShell using stdin/input and -NoExit patterns.

FreeReviewedSigma · High · v2
Product
windows
Service
system
Author
Jonathan Cheong, oscd.community (SigmaHQ), DRL 1.1
Published
2020-10-15
Updated
2026-07-31
title: Windows System Service Control Manager spawning cmd with PowerShell and stdin input obfuscation
id: 97495202-e8a5-4412-9295-f781af9ac1dd
status: test
description: This rule identifies Windows services (via the Service Control Manager, event 7045) that start cmd.exe with PowerShell and indicators of obfuscated stdin-based execution. Attackers often use stdin to conceal the actual PowerShell payload and reduce command-line visibility, while still achieving execution. It relies on System log telemetry capturing the service creation event and the service ImagePath containing cmd, PowerShell, and matching substrings such as /c or /r, input, and noexit.
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_stdin_services.yml
author: Jonathan Cheong, oscd.community, Huntrule Team
date: 2020-10-15
modified: 2022-11-29
tags:
  - attack.stealth
  - attack.t1027
  - attack.execution
  - attack.t1059.001
logsource:
  product: windows
  service: system
detection:
  selection_main:
    Provider_Name: Service Control Manager
    EventID: 7045
    ImagePath|contains|all:
      - cmd
      - powershell
    ImagePath|contains:
      - /c
      - /r
  selection_other:
    - ImagePath|contains: noexit
    - ImagePath|contains|all:
        - input
        - $
  condition: all of selection_*
falsepositives:
  - Unknown
level: high
license: DRL-1.1
related:
  - id: 72862bf2-0eb1-11eb-adc1-0242ac120002
    type: derived