CSCTF 2026 · Reverse engineering · 571 pts
Ghost Bank.
A flat AArch64 firmware bench with a custom MMIO crypto mixer — decrypted with the firmware's own ChaCha20 implementation, borrowed right back at it.
| Event | CSCTF 2026, Operation Dawn (online jeopardy) |
|---|---|
| Category | Reverse engineering |
| Points | 571 |
| Status | Solved during the event |
| Target | Live TCP bench (GDB RSP) |
TL;DR. The firmware polls a tiny set of memory-mapped registers for a challenge/response handshake gated by a custom 64-bit mixer function. Reversing the mixer and driving the same memory map over raw GDB remote-serial unlocks two pages: a 32-byte ChaCha20 key and a short sealed ciphertext — decrypted with the firmware's own cipher, since nothing forbids using its algorithm against it.
Challenge
A "field forge" TCP bench runs flat AArch64 firmware at 0x400000 with an MMIO-mapped crypto mixer. The goal is to recover the sealed tasking.
Reversing
Main polls CONTROL (0x40000000) for value 0x41, reads CHALLENGE_LO/HI (0x40000020/24), writes PAGE=7 (0x40000008), computes a 64-bit response via the mixer function at 0x400120, writes it to KEY_LOW/HIGH (0x40000028), sets CONTROL=0x93, waits for STATUS==3 (0x40000030), then sets CONTROL=0x9c. I validated the mixer's exact bit operations against the provided capture.ndjson: f(0x0123456789abcdef) = 0x03c6fcd1d1b25e0c matched on the first try.
Solution
The live bench only exposes memory addresses 0x40000000..0x400000ff over its RSP (GDB remote serial protocol) connection. Driving that handshake by hand over raw RSP — read challenge, run my reimplemented mixer locally, write the response, flip the control bits — authenticates the connection.
With the bench unlocked, writing PAGE=7 exposes a fixed 32-byte key (a ChaCha20 key), and writing PAGE=3 (twice) exposes the sealed ciphertext. Decrypting that ciphertext with the firmware's own ChaCha20 routine (nonce "SEAL-V01" + counter 1) produces the plaintext TASKING record, whose AUTHKEY field is the flag.
Flag
CSCTF{53P3Se0WBf6YSjQzGxJhSOGq}What I took from it
- When a firmware's own crypto is reversible from its binary, there's no need to break it — just borrow its exact algorithm and keys and run them yourself against the data it protects.