Parse Windows PowerShell Script Block Logs (Event ID 4104) from EVTX files to detect obfuscated commands, encoded payloads, and living-off-the-land techniques. Uses python-evtx to extract and reconstruct multi-block scripts, applies entropy analysis and pattern matching for Base64-encoded commands, Invoke-Expression abuse, download cradles, and AMSI bypass attempts.
Start a fresh conversation. Replace the highlighted placeholders.
Use analyzing-powershell-script-block-logging to analyze [authorized PowerShell Operational EVTX file] for reconstructed Event ID 4104 scripts, obfuscation, encoded payloads, download cradles, and AMSI-bypass indicators; deliver a risk-scored report with MITRE ATT&CK mappings.
Required inputs
[authorized PowerShell Operational EVTX file]
User-approved starter prompt based on a pinned source version; check current skill requirements before running. Task evidence ↗
SKILL.md
name: analyzing-powershell-script-block-loggingdescription: Parse Windows PowerShell Script Block Logs (Event ID 4104) from EVTX files to detect obfuscated commands, encoded payloads, and living-off-the-land techniques. Uses python-evtx to extract and reconstruct multi-block scripts, applies entropy analysis and pattern matching for Base64-encoded commands, Invoke-Expression abuse, download cradles, and AMSI bypass attempts.domain: cybersecuritysubdomain: security-operationstags: - powershell- script-block-logging- event-id-4104- obfuscation-detection- windows-forensics- endpoint-securityversion: '1.0'author: mahipallicense: Apache-2.0nist_csf: - DE.CM-01- RS.MA-01- GV.OV-01- DE.AE-02mitre_attack: - T1059.001- T1027.010- T1140- T1105
Analyzing PowerShell Script Block Logging
When to Use
When investigating security incidents that require analyzing powershell script block logging
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
Familiarity with security operations concepts and tools
Access to a test or lab environment for safe execution
Python 3.8+ with required dependencies installed
Appropriate authorization for any testing activities
Parse Event ID 4104 entries using python-evtx to extract ScriptBlockText, ScriptBlockId, and MessageNumber/MessageTotal for multi-part script reconstruction.