Start a fresh conversation. Replace the highlighted placeholders.
Use hunting-for-anomalous-powershell-execution to analyze [PowerShell Operational EVTX exports] for anomalous PowerShell execution and return a severity-prioritized JSON summary of suspicious events, AMSI-bypass attempts, encoded commands, download cradles, and credential-access indicators.
Required inputs
[PowerShell Operational EVTX exports]
User-approved starter prompt based on a pinned source version; check current skill requirements before running. Task evidence ↗
SKILL.md
name: hunting-for-anomalous-powershell-executiondescription: 'Hunt for malicious PowerShell activity by analyzing Script Block Logging (Event 4104), Module Logging (Event 4103), and process creation events. The analyst parses Windows Event Log EVTX files to detect obfuscated commands, AMSI bypass attempts, encoded payloads, credential dumping keywords, and suspicious download cradles. Activates for requests involving PowerShell threat hunting, script block analysis, encoded command detection, or AMSI bypass identification. 'domain: cybersecuritysubdomain: threat-huntingtags: - powershell- script-block-logging- event-4104- amsi- threat-hunting- evtx- obfuscationversion: '1.0'author: mahipallicense: Apache-2.0nist_csf: - DE.CM-01- DE.AE-02- DE.AE-07- ID.RA-05mitre_attack: - T1046- T1057- T1082- T1083- T1003
Hunting for Anomalous PowerShell Execution
Overview
PowerShell Script Block Logging (Event ID 4104) records the full deobfuscated script text
executed on a Windows endpoint, making it the primary data source for hunting malicious
PowerShell. Combined with Module Logging (4103) and process creation events, analysts can
detect encoded commands, AMSI bypass patterns, download cradles, credential theft tools,
and fileless attack techniques even when the attacker uses obfuscation layers.
When to Use
When investigating security incidents that require hunting for anomalous powershell execution
When building detection rules or threat hunting queries for this domain
When SOC analysts need structured procedures for this analysis type
When validating security monitoring coverage for related attack techniques
Prerequisites
Windows Event Log exports (.evtx) from Microsoft-Windows-PowerShell/Operational
Python 3.8+ with python-evtx and lxml libraries
Script Block Logging enabled via Group Policy
Understanding of common PowerShell attack techniques
Steps
Parse EVTX files extracting Event 4104 script block text and metadata
Reassemble multi-part script blocks using ScriptBlock ID correlation
Scan script text for AMSI bypass indicators and obfuscation patterns
Detect encoded command execution and base64 payloads
Identify download cradles, credential dumping, and lateral movement commands