← All hands-on practice
SOC · 10 min
Peel the payload: decode an obfuscated command
An alert shows PowerShell started with a long encoded command. Attackers wrap commands in layers so nothing readable shows up. Peel each layer with the right operation until you can see what it does.
Start it: free, in your browser, no account
What you will do
- Decode the -EncodedCommand.
- Peel the next layer.
- Find the address it downloads from.
- Decide what to block and what to detect.
Exam objectives it practises
- CompTIA Security+ 2.4 Indicators of malicious activity
- CompTIA Security+ 4.9 Data sources for investigations
- CompTIA PenTest+ 4.10 Scripting to automate attacks
Simplified: one sample with four layers, and operations named as in CyberChef (From Base64, then decoding text as UTF-16LE or UTF-8). Real samples add compression, XOR, split strings and odd capitals. PowerShell script block logging (event ID 4104) records each layer as it runs, which often does this peeling for you. Never run a sample to see what it does: decode it as text, as here. The address is a documentation range.