Skip to content
Threat Feed
high advisory

Suspicious PowerShell Command Pattern Detection

This brief documents patterns of PowerShell invocation commonly associated with malicious activities such as payload downloading, fileless execution, and persistence establishment.

This brief outlines specific PowerShell invocation command patterns identified via PowerShell Module logging (Event ID 4103). These patterns are frequently observed in post-exploitation scenarios, including the use of encoded commands, network-based file downloads via WebClient, and the manipulation of Windows Registry Run keys for persistence. These techniques allow attackers to execute arbitrary code directly in memory or establish stealthy persistence mechanisms that survive system reboots. Defenders should monitor for combinations of flags that reduce logging visibility or bypass execution policies, such as the simultaneous use of '-nop' (NoProfile), '-w hidden' (WindowStyle Hidden), and network-related objects.

Impact

Successful exploitation of these patterns enables unauthorized code execution, credential harvesting, lateral movement, and long-term persistence within a target environment. By bypassing default execution policies, adversaries can execute sophisticated multi-stage malware, infostealers, or ransomware components without relying on traditional dropped binaries.

Recommendation

  • Deploy the provided Sigma rule to your SIEM to monitor PowerShell Module logging (Event ID 4103).
  • Prioritize alerts containing combinations of 'System.Net.WebClient' and 'Download' as these indicate potential stages for remote malware retrieval.
  • Tune the detection logic by filtering for legitimate administrative or software deployment scripts, such as those used by Chocolatey.
  • Enable Script Block Logging (Event ID 4104) in conjunction with Module Logging to capture the full de-obfuscated script content if the command line is obfuscated.

Immediate actions

Deploy the provided Sigma rule to the SIEM

Detection Engineering 48h

Threat Hunt

Search for high-frequency hidden PowerShell executions

T1059.001 high medium confidence hunt now

Data: Event ID 4103 / 4104

Detection coverage 1

Detect Suspicious PowerShell Invocation Patterns

high

Detects multiple patterns of suspicious PowerShell invocation, including base64 encoded command execution, registry persistence modification, and remote payload downloading.

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

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