Windows Process Execution Using Obfuscated CMD to Pipe STDIN into PowerShell

Detects obfuscated cmd executions that launch PowerShell and reference $input/noexit patterns for STDIN-based execution.

FreeReviewedSigma · High · v2
Product
windows
Category
process_creation
Author
Jonathan Cheong, oscd.community (SigmaHQ), DRL 1.1
Published
2020-10-15
Updated
2026-07-31
title: Windows Process Execution Using Obfuscated CMD to Pipe STDIN into PowerShell
id: 871e3c2a-5f09-4dc9-b68c-f5a30de9bb26
status: test
description: This rule identifies Windows process executions where an obfuscated cmd command invokes PowerShell while referencing an input stream such as ${input} or -NoExit, consistent with stdin-based launcher behavior. Attackers can use this pattern to hide execution details and dynamically feed commands to PowerShell to reduce detection visibility. The detection relies on process creation telemetry, specifically the CommandLine field matching an obfuscation-tolerant pattern for cmd and PowerShell interaction with input.
references:
  - https://github.com/SigmaHQ/sigma/issues/1009
  - https://github.com/SigmaHQ/sigma/blob/master/rules/windows/process_creation/proc_creation_win_hktl_invoke_obfuscation_stdin.yml
author: Jonathan Cheong, oscd.community, Huntrule Team
date: 2020-10-15
modified: 2024-04-15
tags:
  - attack.stealth
  - attack.t1027
  - attack.execution
  - attack.t1059.001
logsource:
  category: process_creation
  product: windows
detection:
  selection:
    CommandLine|re: cmd.{0,5}(?:/c|/r).+powershell.+(?:\$\{?input\}?|noexit).+\"
  condition: selection
falsepositives:
  - Unknown
level: high
license: DRL-1.1
related:
  - id: 6c96fc76-0eb1-11eb-adc1-0242ac120002
    type: derived