CSCTF 2026 · Pwn · 871 pts
stepper.
You can't type `syscall` or `int` directly — so you build the bytes for `syscall` out of arithmetic the filter doesn't recognize, and jump to your own handiwork.
| Event | CSCTF 2026, Operation Dawn (online jeopardy) |
|---|---|
| Category | Pwn |
| Points | 871 |
| Status | Solved during the event |
| Target | Live TCP service |
TL;DR. stepper lets you submit up to 12 tiny (≤6 byte) code steps into a shared RWX page, banning the literal bytes for `syscall` and `int`. Across 11 steps, register-only arithmetic reconstructs the forbidden `syscall` opcode byte-by-byte directly inside the executable page, writes an `execve("/bin/sh")` argument block onto the stack, and jumps to the self-assembled instruction.
Challenge
Get a shell on a service that executes up to 12 tiny attacker-submitted code snippets in sequence, with the literal bytes for `syscall` and `int` banned from every input.
Solution
Each step's bytes land at a fixed offset in a shared RWX page, padded with NOPs, and a fixed trampoline always returns execution to the guest after each step — registers persist across steps, but each step's input slot is reset. The input filter rejects 0x0f 0x05 (the syscall opcode) and 0xcd (int), so no step can contain a real syscall instruction directly.
The approach: build the forbidden 0f 05 bytes out of ordinary register arithmetic that the filter has no reason to flag, write them into the RWX page yourself, and jump to that location. Across 11 six-byte-or-smaller steps: compute a stable pointer into the code page (call $+5; pop rbp), construct the byte 0x0f in al and 0x05 in bl through ordinary XOR/mov/add/dec operations (never typing either value directly as an immediate that would spell out the banned bytes), write both bytes into the page at a fixed offset, build the string "/bin/sh\0" directly on the stack across two more steps, point rdi at it with rsi/rdx zeroed, set al = 0x3b (execve's syscall number, again built without ever embedding the 0f 05 pattern), and finally jump to the two bytes you planted — which executes as a real syscall instruction, now that the CPU reads it directly out of memory rather than ever seeing it arrive as filtered input.
That final syscall is execve("/bin/sh", NULL, NULL), and a shell pops. None of the 11 steps contains either banned byte sequence in their own input bytes — only the assembled result, sitting in memory, does.
Flag
CSCTF{857SOEbz59FboWLw77NySLrB}What I took from it
- Banning specific opcode bytes from attacker input doesn't stop the attacker from building those exact bytes at runtime out of arithmetic the filter never sees as dangerous — a filter on input content can't protect a page the input is also allowed to execute from.