The rule that cannot read UTF-16
A credential-stealer rule finds the C build but misses the .NET build. Look at how Windows programs store strings, add the wide modifier, and rescan.
What you’re looking at
A credential-stealer rule finds the C build but misses the .NET build. Look at how Windows programs store strings, add the wide modifier, and rescan.
Your goal: Show why a rule missed the .NET build and fix it with the wide modifier.
- 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
- YARA
- a rule language for finding patterns in files
- ASCII
- the basic set of English letters, digits, and symbols as numbers
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
The intel team shared four builds of the same browser-password stealer. The rule in rules/v1.yar catches only some of them.
Many Windows programs, and .NET ones in particular, store strings as UTF-16: every character followed by a zero byte. A YARA text string is ASCII unless you add wide.
detect-lab · YARA triage
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: 261 words, about 2 min. It gives away every answer, so try the steps first.