What -EncodedCommand was hiding
A process-creation event shows PowerShell started with -enc and a long base64 string. Decode it, deal with the UTF-16 bytes, and find the URL it downloads.
What you’re looking at
A process-creation event shows PowerShell started with -enc and a long base64 string. Decode it, deal with the UTF-16 bytes, and find the URL it downloads.
Your goal: Decode a hidden PowerShell command and find what it downloads, runs, and deletes.
- Briefing
- the story: what happened and what evidence you were handed.
- Terminal
- the dark box. It is a pretend Linux shell that runs in your browser. Type a command and press Enter. Nothing you type touches a real system.
- Walkthrough
- the numbered path. Each step says what to type and what you should see. Hints open one at a time.
- Answer boxes
- under each question step. Type what you found and press Check.
Words you will meet
- UTF
- Unicode Transformation Format, how text is stored as bytes
- URL
- web address
Start with step 1 in the walkthrough. Every step says what to do and what you should see. The whole thing takes about 2 min to talk through.
Briefing
Sysmon on a finance laptop logged a PowerShell process started by a shortcut file that arrived by email. The command line carries -EncodedCommand.
PowerShell’s -EncodedCommand is base64 of UTF-16LE text, so every other byte after decoding is a zero. The export of the event is in ~/case/event-4688.txt and the encoded string alone is in ~/case/encoded.txt.
ir-workstation · Decoding artifacts
Type help for the command list and objectives for your tasks. Everything runs in this browser.
Up and down arrows walk your history. Ctrl+L clears the screen. Try help, ls, and objectives.
The whole walkthrough
Every step in order, written to be read aloud: 258 words, about 2 min. It gives away every answer, so try the steps first.