$ cat writeup.md…
$ cat writeup.md…
sunshinectf2026
Task: x86-64 IVR/phone-tree pwn with no output primitive except one integer echo; flag is scattered into fixed stack slots by place_flag() and raw_parse_int leaves its output stale on empty input. Solution: control stack-frame depth via non-destructive menu detours so the echoed variable aliases each flag chunk, leaking 13 dwords.
$ cat /etc/rate-limit
Rate limit reached (20 reads/hour per IP). Showing preview only — full content returns at the next hour roll-over.
Welcome to robocall! Let's see how nimbly you navigate this stack.
A phone-tree / IVR menu simulation ("Premium Cable Inc"). The stated goal is
to cancel your subscription. Given an x86-64 ELF robocall and a remote
service nc sunshinectf.games 26199. Flag format sun{...}.
Protections: PIE, NX, no stack canary, IBT/SHSTK. Not stripped. The only
libc imports are read, write, open, close, nanosleep, setvbuf,
_exit. Critically there is no printf and no flag-printing gadget — the
program never has a direct "cat the flag" path.
Three facts combine into the vulnerability:
The flag is scattered onto fixed stack slots. main() calls
place_flag() first. It opens flag.txt, reads up to 52 bytes into a temp
buffer, then writes the flag into thirteen 4-byte chunks at fixed stack
addresses. Chunk i is written to dest = frame_base + (0x19dc - CHUNK_DEPTH[i]),
which reduces to an absolute address var0 - CHUNK_DEPTH[i], where:
CHUNK_DEPTH = {0x400, 0x480, 0x520, 0x570, 0x5a0, 0x640, 0x690, 0x6c0, 0x760, 0x7b0, 0x7e0, 0x800, 0x880}var0 = the address of cancel_plan()'s local [rbp-0x204] (the parsed
menu integer) when cancel_plan is reached at minimal depth
(var0 = place_flag_rbp - 0x644). All chunks sit below var0.These chunk bytes persist on the stack after place_flag() returns.
raw_parse_int(buf, &out) does not write out on empty / non-numeric
input — it returns 0 and leaves out unchanged (stale). This is the
trigger for stale-value reuse.
cancel_plan() echoes its menu variable back to the user: it prints
You've entered "<X>" via raw_print_int([rbp-0x204]). This is the only
primitive in the whole program that emits attacker-influenced memory as
observable output.
...
$ grep --similar