Extracting PowerShell Scriptblock data Easily via block-parser

BlueteamOps
1 min readAug 19, 2020

--

Microsoft-Windows-PowerShell%4Operational.evtx can be used to uncover malicious script usage during DFIR investigations. The Scriptblock text located within EID 4104 (Execute a Remote Command) often has code that may aid you to piece together threat actions. The full Scriptblock for malicious payloads are often distributed over multiple events. I have come across incidents where the malicious payload was reconstructed using Scriptblock data. However, this becomes very cumbersome to do using Event Viewer.

An example 4104 Event

A better way to approach this is to use Matthew Dunwoody’s block parser https://github.com/matthewdunwoody/block-parser

block-parser was written for Python2.

Example usage:

python2 block-parser.py -a -f output PSTests.evtx

This will dump all Scriptblocks it can find from the EVTX file to a file named output.

--

--

BlueteamOps
BlueteamOps

Written by BlueteamOps

Janantha Marasinghe’s Research If you like my work you can support me at buymeacoffee.com/jananthadmm

No responses yet