CSCTF 2026 · Pwn · 540 pts
sigil.
A static, non-PIE binary with exactly one syscall gadget and no pop rdi — the read length itself becomes the register you need.
| Event | CSCTF 2026, Operation Dawn (online jeopardy) |
|---|---|
| Category | Pwn |
| Points | 540 |
| Status | Solved during the event |
| Target | Live TCP service |
TL;DR. sigil's only usable gadget is a bare syscall; ...; ret, with no way to directly control rax for the syscall number. Making a second call into listen() return exactly 15 bytes read sets rax=15 (the return value of read), which is exactly the syscall number for rt_sigreturn — turning one gadget into a full SROP primitive.
Challenge
A static, non-PIE, -nostdlib binary with no canary. listen() reads 0x400 bytes into a 0x40-byte buffer, overflowing the return address.
Solution
There is exactly one syscall gadget in the binary (0x401024: syscall; mov [rbp-8],rax; mov rax,[rbp-8]; pop rbp; ret) and no pop rdi, so the usual ret2syscall approach has no way to set the syscall number directly. The trick: overflow the return address to call listen() (0x401030) a second time, and this time make its internal read(0, buf, 0x400) return exactly 15 bytes — by sending only 15 bytes and sleeping briefly so the next read call doesn't get more data appended. read's return value ends up in rax, so rax is now 15: the syscall number for rt_sigreturn.
Frame 1 is the pending read(0, &.bss, 0x400) call with the controlled stack already in place. The gadget's tail chains into a second rt_sigreturn frame, loaded from a BSS address, which restores registers for a final execve("/bin/sh", NULL, NULL) and a shell pops. The exploit is deterministic (8/8 locally and 8/8 over a raw TCP socket).
Flag
CSCTF{d8ToM45oF1YGYfvp56CNC6Ko}What I took from it
- A side-channel register value — here, a syscall's own return value landing in rax — can substitute for a missing gadget when the binary gives you no direct way to set that register.