HackBlue

Labs / Windows event logs

Script block logging catches a split string

An attacker split strings to hide from simple keyword alerts. PowerShell event 4104 still recorded the code. Reassemble the URL and name the AMSI bypass it used.

  • Terminal mission
  • Advanced
  • 4 objectives
  • 0 of 4 solved

What you’re looking at

An attacker split strings to hide from simple keyword alerts. PowerShell event 4104 still recorded the code. Reassemble the URL and name the AMSI bypass it used.

Your goal: Reassemble a split-up script from PowerShell logging and name how it turned off scanning.

Briefing
the story: what happened and what evidence you were handed.
Terminal
the dark box. It is a pretend PowerShell window 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

URL
web address
AMSI
the Antimalware Scan Interface in Windows

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

An analyst on WS-22 reported PowerShell windows flashing at 9:21 AM. Script block logging is on, so event 4104 in Microsoft-Windows-PowerShell/Operational holds the code that ran.

Obfuscation like 'ht'+'tp://' defeats a search for http://, but the logged script text is still there to read. Warning level on a 4104 means PowerShell itself thought the block looked suspicious.

PowerShell · WS-22

WS-22 · Windows event logs

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: 287 words, about 2 min. It gives away every answer, so try the steps first.