CSCTF 2026 · Reverse engineering · 126 pts
The Lock Box.
The obvious password check decodes to a taunt, not the flag — the real verifier runs before main even starts.
| Event | CSCTF 2026, Operation Dawn (online jeopardy) |
|---|---|
| Category | Reverse engineering |
| Points | 126 |
| Status | Solved during the event |
| Target | binary, offline (static ELF) |
TL;DR. A stripped PIE binary's obvious `strcmp` path — an XOR-decoded string that looks exactly like a password check — is a decoy that only prints a taunt. The real validation runs in an `.init_array` constructor that executes before `main`, checking a 44-character argument through a per-byte keystream chain that's mechanically invertible.
Challenge
Recover the real 44-character unlock code for a binary whose obvious password check is a trap.
Solution
The binary has an immediately visible path: an argument compared via strcmp after XOR-decoding with 0x5b, which decodes to the phrase "open sesame and mind the tripwire" — a plausible-looking password, but following that path only ever prints "last week's code", confirming it's a deliberate decoy meant to burn time.
The real validation happens earlier and separately: a constructor registered in .init_array (at offset 0x10e0) runs automatically before main, reads argc/argv directly, and validates a 44-character argv[2] through a keystream chain — each byte XORed against a running accumulator, rotated, added to a fixed table value indexed by position mod 8, and compared against a second fixed table.
Every step of that chain (XOR, rotate, add-table) is individually invertible given the two tables are both visible as static data in the binary; inverting the whole chain statically, byte by byte, recovers the real 44-character code with no need to run the binary at all.
Flag
CSCTF{06_ash_hawk_road_at_garrisoned_38318f}What I took from it
- A password check sitting in `main` and reachable by the most obvious path through a binary is exactly where a reverse-engineering challenge is most likely to plant a decoy — real validation logic hiding in a pre-main constructor is a well-known technique for exactly this reason.