$ cat writeup.md…
$ cat writeup.md…
sunshinectf2026
Task: no-PIE stripped x86-64 binary with a hand-rolled printf exposing custom %N$s read and %N$w write-what-where specifiers. Solution: leak GOT[read] to resolve libc, overwrite GOT[strcspn] with system via the write primitive, so the next input line runs as system(buf) for RCE.
$ cat /etc/rate-limit
Rate limit reached (20 reads/hour per IP). Showing preview only — full content returns at the next hour roll-over.
The arcade's score printer has been spitting out strange tickets all week. Step up to the renderer and see what it's really printing.
Files: binary
revolution+nc chal.sunshinectf.games 26002
English summary: A stripped x86-64 binary reads a "score card template" line in a loop and renders it through a custom renderer. The goal is to abuse the renderer to gain code execution on the remote host and read the flag (sun{...}).
0x400000), Partial RELRO (GOT writable), no stack canary, NX enabled.write, read, strlen, strcspn, setvbuf. Crucially there is no printf/puts/system imported — the program ships its own printf. This is the theme's giveaway (a "renderer/printer" that is not the standard library one).Enter your score card template:.score> ,read(0, buf, 0x1ff) into a 0x200 stack buffer,buf[strcspn(buf, "\n")] = 0,custom_printf(buf),\n.The function emulates the System V AMD64 va_list: gp_offset starts at 8 (skips rdi=fmt, begins at rsi), reg_save_area holds rsi,rdx,rcx,r8,r9, and overflow_arg_area points at the caller stack. A helper (fcn.004012c0) fetches an argument by positional index. Reversing the dispatch reveals these specifiers:
%% → literal %%N$s → arbitrary read: fetch arg N as a pointer, strlen()+write() it (leak memory as a C-string).%N$w → arbitrary write (write-what-where): fetch arg N as address, arg N+1 as value, then *(uint64_t*)addr = value (the tell in disassembly is mov qword [r8], rax), prints ok.%N$p / %N$x → hex leak of arg N....
$ grep --similar