Windows PowerShell Process Creation with Unusually Long Command Lines (1000+ chars)
Flags PowerShell executions on Windows when the CommandLine is 1000+ characters long.
FreeReviewedSigma · Low · v5
- Product
- windows
- Category
- process_creation
- Author
- oscd.community, Natalia Shornikova (SigmaHQ), DRL 1.1
- Published
- 2020-10-06
- Updated
- 2026-07-31
ATT&CK techniques
ExecutionRecon
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 processes running PowerShell executables when the CommandLine length is 1000 characters or more. Attackers often pack payloads, scripts, or encoded content into a single command line to evade simpler detections. The detection relies on process creation telemetry, matching PowerShell/pwsh process paths and the measured CommandLine length.
Reporting behind it
Changelog
v5- v5Candidate ingested via manual entry.2026-07-31
- v4Candidate ingested via manual entry.2026-07-31
- v3Candidate ingested via manual entry.2026-07-31
- 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.
windows-powershell-alert-on-unusually-long-commandline-length-1000-characters-d0d28567
title: Windows PowerShell Process Creation with Unusually Long Command Lines (1000+ chars)
id: 02f0ca9c-37fb-4b5e-8cce-1f77b972a3c6
status: test
description: This rule flags Windows processes running PowerShell executables when the CommandLine length is 1000 characters or more. Attackers often pack payloads, scripts, or encoded content into a single command line to evade simpler detections. The detection relies on process creation telemetry, matching PowerShell/pwsh process paths and the measured CommandLine length.
references:
- https://speakerdeck.com/heirhabarov/hunting-for-powershell-abuse
- https://github.com/SigmaHQ/sigma/blob/master/rules-threat-hunting/windows/process_creation/proc_creation_win_powershell_abnormal_commandline_size.yml
author: oscd.community, Natalia Shornikova, Huntrule Team
date: 2020-10-06
modified: 2023-04-14
tags:
- attack.execution
- attack.t1059.001
- detection.threat-hunting
logsource:
category: process_creation
product: windows
detection:
selection_powershell:
- Image|endswith:
- \powershell.exe
- \pwsh.exe
- OriginalFileName:
- PowerShell.EXE
- pwsh.dll
- Description: Windows Powershell
- Product: PowerShell Core 6
selection_length:
CommandLine|re: .{1000,}
condition: all of selection_*
falsepositives:
- Unknown
level: low
license: DRL-1.1
related:
- id: d0d28567-4b9a-45e2-8bbc-fb1b66a1f7f6
type: derived