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.
60
70%
Does it follow best practices?
Run evals on this skill
Adds up to 20 points to the overall score
View guide
High
Do not use without reviewing
Fix and improve this skill with Tessl
tessl review fix ./skills/analyzing-powershell-script-block-logging/SKILL.mdpip install python-evtx lxmlMicrosoft-Windows-PowerShell%4Operational.evtx-EncodedCommand, FromBase64String)DownloadString, DownloadFile, Invoke-WebRequest, Net.WebClient)AmsiUtils, amsiInitFailed)python scripts/agent.py --evtx-file /path/to/PowerShell-Operational.evtx --output ps_analysis.jsonimport base64
if "-encodedcommand" in script_text.lower():
encoded = script_text.split()[-1]
decoded = base64.b64decode(encoded).decode("utf-16-le")Scripts split across multiple 4104 events share a ScriptBlockId. Concatenate blocks ordered by MessageNumber to recover the full script.
9429fe9
If you maintain this skill, you can claim it as your own. Once claimed, you can manage eval scenarios, bundle related skills, attach documentation or rules, and ensure cross-agent compatibility.