DL·SYS
Contact ↗

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.

Decoy pathKeystream inversion
EventCSCTF 2026, Operation Dawn (online jeopardy)
CategoryReverse engineering
Points126
StatusSolved during the event
Targetbinary, 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

FlagCSCTF{06_ash_hawk_road_at_garrisoned_38318f}

What I took from it