$ cat writeup.md…
$ cat writeup.md…
sunshinectf2026
Task: networked x86-64 PIE binary (Full RELRO, canary, NX, CET markers) with a custom punch-card framing protocol; an off-by-one WRITE overwrites the bank length field with the frame checksum byte. Solution: grow the length to enable a stack info-leak (canary + PIE base) and a stack overflow, then ret2plt system() with a command string placed in the binary's .bss request buffer — no libc needed.
$ cat /etc/rate-limit
Rate limit reached (20 reads/hour per IP). Showing preview only — full content returns at the next hour roll-over.
Homemaker — nc sunshinectf.games 26008
A networked ELF64 x86-64 service implementing a "punch-card" framing protocol. Mitigations: PIE, Full RELRO, stack canary, NX, and CET markers (SHSTK/IBT) present in the binary. libc is GNU libc 2.35 (Ubuntu 22.04), but no libc is required for the final solve. Goal: read the flag file from the remote working directory (sun{...} format).
Every request/response is wrapped in a frame:
1b 5b <len:BE16> <payload[len]> <cksum> 1b 5c
ESC '[' (1b 5b), suffix ESC '\' (1b 5c).len is big-endian u16, must be non-zero and len + 7 <= 0x800.cksum is a single byte placed after the payload (a common early mistake is to put it before the payload). It is a CRC-8, poly 0x2f, init 0, MSB-first, no reflection:def cksum8(data): h = 0 for b in data: h ^= b for _ in range(8): h = ((h*2) ^ 0x2f) & 0xff if (h & 0x80) else (h*2) & 0xff return h & 0xff
Server replies use the mirror frame 1b 5b <framelen=datalen+1:BE16> <status> <data...> <cksum> 1b 5c.
The dispatcher rejects any opcode other than 1 until unlocked.
1 = unlock: payload = 0x01 + BE32(key), key = 0x1337c35f. On success sets bank.len = 0x100 (256) and count = 1.2 = WRITE into a fixed 256-byte stack "bank" buffer.3 = READ/DUMP: sends back bank.len bytes of the bank buffer.5 = system("/bin/echo -n ''") with a fixed rodata string (proves system works in the environment).The WRITE handler computes n = payload_len - 1, checks n <= bank.len, then copies with an inclusive loop:
...
$ grep --similar