ReversingHidden Investigations CTF 2026
Obfuscated Flow
challenge is a stripped x86-64 ELF that reads a 47-char passkey of the form hiCTF{<40 chars>}. The 40 inner chars are treated as ten little-endian dwords d0..d9.
What this one teaches
- Control-flow flattening reduces to independent equations per state — identify the equation type for each dword pair and solve them individually.
- Mixing discrete log (Pohlig-Hellman), elliptic curve point arithmetic, and modular linear systems in one binary means each pair needs a different solver.
- A final mixing stage (SipRound-like permutation + XOR decrypt) acts as an integrity check — wrong dword order or values produce garbage, confirming the solution uniquely.
Task description
We recovered a secure gateway validator used to authenticate operators on an isolated node. Can you cut through and recover the flag?
Deobfuscation / solving
Each state is an independent equation, so the flattened flow reduces to solving them:
| Dwords | Check | Solution |
|---|---|---|
| d0,d1 | x0x1 = 0x37c0f52c, x0^2 - 31337x1^2 = 0x1e054920 (mod 2^31-1) | quartic via modular sqrt -> m4th, _c0n |
| d2,d3 | point (d2,d3) + 1337*B = Q on curve y^2=x^3+133742x+0x30730db7 mod 1e9+7, B=(123456789,0xe42882f), Q=(0x2d0c1bbd,0x205c7191) | X = Q - 1337B; d2 = x + p = tr0l, d3 = _fl0 |
| d4,d5 | 7^d4 = 0x7bb949ec, 11^d5 = 0xb3bbfc8 (mod 2^31-1) | Pohlig-Hellman dlog -> w_3l, l1pt |
| d6,d7 | 2x2 linear system mod 0xfffffffb | 1c_d, log_ |
| d8,d9 | sum = 0x4770c967, product = 0x2e97d196 mod 2^31-1; d8^9 and d9^0x11 must be prime | roots 4f7b,2c9e; the primality condition fixes the order |
Concatenated: m4th_c0ntr0l_fl0w_3ll1pt1c_dlog_4f7b2c9e. The final stage mixes the input into a
SipRound-like permutation state, derives a keystream, and XOR-decrypts a 98-byte blob (checked with
a 31-multiplier hash), so a wrong input cannot yield the flag.
Verification
Running the binary in Docker with the candidate prints [+] ACCESS GRANTED! and the flag;
swapping d8/d9 gives Access Denied. API submission returned goodFlag.
The flagReveal
hiCTF{m4th_c0ntr0l_fl0w_3ll1pt1c_dlog_4f7b2c9e}This CTF was possibly solved, and the writeup most likely written by an LLM. Apologies for inconsistencies.