Skip to content
Threat Feed
high advisory

Detection of Obfuscated PowerShell Parameter Variations

Adversaries utilize PowerShell parameter substring truncation to evade command-line monitoring by leveraging the built-in ability of PowerShell to parse shortened, non-standard parameter names.

PowerShell allows users to shorten command parameters as long as the provided substring is long enough to be uniquely identified by the PowerShell engine. Attackers exploit this behavior to evade detection tools that rely on strict string matching for common security-related parameters, such as '-EncodedCommand', '-ExecutionPolicy', '-WindowStyle', or '-NoProfile'. By using truncated versions like '-enc', '-ep bypass', or '-win h', attackers can achieve the same execution results while bypassing signature-based alerts. This technique is a standard component of obfuscated script delivery used by various threat actors to maintain stealth during the initial execution and persistence stages of a compromise.

Impact

Successful exploitation of this technique allows attackers to execute malicious scripts, bypass local execution policy restrictions, and hide the visual footprint of terminal windows on victim endpoints. This significantly increases the likelihood of unauthorized code execution going undetected by traditional logging solutions that are not configured to account for parameter variations.

Recommendation

Deploy detection logic that accounts for the wide range of valid parameter substrings. Given the potential for false positives from legitimate system administration scripts using shortened syntax, teams should perform an initial baseline of their environment to identify common administrative toolsets before enabling these detections in blocking mode.


Immediate actions

Deploy the provided Sigma rule for suspicious PowerShell parameter variations

Detection Engineering 48h

Threat Hunt

Search for instances of PowerShell execution using truncated parameters

T1059.001 high high confidence convert to detection

Data: Process creation events

Mitigations

Enable Script Block Logging (Event ID 4104) for deeper visibility

medium_term IT Operations

T1059.001

Detection coverage 1

Detect Suspicious PowerShell Parameter Substring

high

Detects potentially malicious PowerShell invocation using truncated or obfuscated command line parameters.

sigma tactics: execution techniques: T1059.001 sources: process_creation, windows

Detection queries are available on the platform. Get full rules →