Windows PowerShell Suspicious Encoded Command-Line Execution
Alerts on PowerShell launched with encoded-command switches and embedded encoded content patterns in the command line.
- Product
- windows
- Category
- process_creation
- Author
- Florian Roth (Nextron Systems), Markus Neis, Jonhnathan Ribeiro, Daniil Yugoslavskiy, Anton Kutepov, oscd.community (SigmaHQ), DRL 1.1
- Published
- 2018-09-03
- Updated
- 2026-07-30
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 PowerShell process creations where the command line indicates encoded execution (e.g., use of the -e/-enc switch) combined with common encoded-content patterns. Attackers often use encoded PowerShell to conceal the true script payload from casual inspection and some detections. Telemetry required is process creation data for Image/PWSh binaries and the full CommandLine text, enabling matching of both encoded switches and characteristic encoded substrings.
Reporting behind it
Detection content is published as a reviewed draft. Tune thresholds and exclusions against your own telemetry before enabling this rule for alerting.
title: Windows PowerShell Suspicious Encoded Command-Line Execution
id: 80c770a2-b7c9-4c69-bc4f-d115e2d85c22
status: test
description: This rule flags Windows PowerShell process creations where the command line indicates encoded execution (e.g., use of the -e/-enc switch) combined with common encoded-content patterns. Attackers often use encoded PowerShell to conceal the true script payload from casual inspection and some detections. Telemetry required is process creation data for Image/PWSh binaries and the full CommandLine text, enabling matching of both encoded switches and characteristic encoded substrings.
references:
- https://app.any.run/tasks/6217d77d-3189-4db2-a957-8ab239f3e01e
- https://github.com/SigmaHQ/sigma/blob/master/rules/windows/process_creation/proc_creation_win_powershell_base64_encoded_cmd.yml
author: Florian Roth (Nextron Systems), Markus Neis, Jonhnathan Ribeiro, Daniil Yugoslavskiy, Anton Kutepov, oscd.community, Huntrule Team
date: 2018-09-03
modified: 2023-04-06
tags:
- attack.execution
- attack.t1059.001
logsource:
category: process_creation
product: windows
detection:
selection_img:
- Image|endswith:
- \powershell.exe
- \pwsh.exe
- OriginalFileName:
- PowerShell.EXE
- pwsh.dll
selection_cli_enc:
CommandLine|contains: " -e"
selection_cli_content:
CommandLine|contains:
- " JAB"
- " SUVYI"
- " SQBFAFgA"
- " aQBlAHgA"
- " aWV4I"
- " IAA"
- " IAB"
- " UwB"
- " cwB"
selection_standalone:
CommandLine|contains:
- ".exe -ENCOD "
- " BA^J e-"
filter_optional_remote_signed:
CommandLine|contains: " -ExecutionPolicy remotesigned "
condition: selection_img and (all of selection_cli_* or selection_standalone) and not 1 of filter_optional_*
level: high
license: DRL-1.1
related:
- id: ca2092a1-c273-4878-9b4b-0d60115bf5ea
type: derived