Suspicious PowerShell Command Line Invocation Patterns
Detection logic identifying common obfuscated and malicious PowerShell command line patterns frequently used for staging, persistence, and C2 activity.
This detection brief highlights specific PowerShell command line patterns frequently used by attackers to execute malicious code, download payloads, or maintain persistence on Windows systems. The patterns focus on suspicious flag combinations such as hidden windows, bypass policies, and base64-encoded strings, alongside common techniques like using System.Net.WebClient for remote script execution.
Defenders should note that while these patterns are highly indicative of malicious activity, they are intentionally broad to cover multiple stages of an attack lifecycle. Detecting these specific invocation patterns provides a robust mechanism to identify early-stage command-and-control communication, lateral movement attempts, and payload delivery before more severe impacts occur.
Impact
Successful exploitation of these PowerShell invocation methods allows attackers to gain unauthorized command execution, bypass local security policy restrictions, and facilitate the download of second-stage malware such as backdoors or infostealers. Failure to detect these initial invocations may lead to full system compromise, data exfiltration, or the deployment of ransomware within the environment.
Recommendation
Deploy the provided Sigma rules to your SIEM to monitor for suspicious process execution patterns. Integrate process creation logging (Sysmon Event ID 1) across all Windows endpoints. Perform regular tuning to filter out legitimate administrative tools or software deployment scripts (e.g., Chocolatey) that may trigger these patterns.
Immediate actions
Deploy the provided Sigma rule to the SIEM.
Threat Hunt
Search for instances of PowerShell with -nop, -w hidden, and iex in command line logs.
Data: Process creation events with CommandLine field.
Detection coverage 1
Detect Suspicious PowerShell Invocation Patterns
mediumDetects suspicious PowerShell command line invocation patterns including obfuscated arguments, base64 decoding, and network downloads.
Detection queries are available on the platform. Get full rules →