A config block found by its byte pattern
A Linux botnet stores its configuration after a fixed four-byte marker and a two-byte length. Use a hex rule with wildcards to find which binaries carry it and at which offset.
What you’re looking at
A Linux botnet stores its configuration after a fixed four-byte marker and a two-byte length. Use a hex rule with wildcards to find which binaries carry it and at which offset.
Your goal: Use a YARA byte pattern to find which binaries carry a hidden config block, and where.
- 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
- YARA
- a rule language for finding patterns in files
- C2
- command and control, the server that sends malware its orders
- ELF
- Executable and Linkable Format, the Linux program file format
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
Reverse engineers found that this botnet’s binaries keep their config after the bytes C0 F1 6E 00, followed by a two-byte length that changes per build, then 01 00.
Hex strings in YARA match raw bytes, and ?? matches any single byte. yara -s prints each hit with its offset, which tells a reverse engineer where to start.
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: 287 words, about 2 min. It gives away every answer, so try the steps first.