$ cat writeup.md…
$ cat writeup.md…
Hack.lu2026
Task: statically linked no-PIE pwn where redact() replaces each regex match "flux" (4 bytes) with "[REDACTED]" (10 bytes) in place without bounds checks, growing the buffer and overflowing main's stack frame. Solution: craft input so the +6 bytes/match expansion lands a syscall ROP chain exactly on main's saved return address, using the printf echo as a placement oracle, then open/read/write /flag.
$ cat /etc/rate-limit
Rate limit reached (20 reads/hour per IP). Showing preview only — full content returns at the next hour roll-over.
Agile declassification tooling - don't tell anyone about our top secret project :]
English summary: A one-shot "declassifier" service reads up to 512 bytes of
input, redacts every occurrence of the word flux by replacing it with
[REDACTED], and prints the result. The redaction grows the string in place
without any bounds checking, corrupting the stack. The goal is to read /flag
on the remote host. The service is exposed over TLS on port 443 (one connection
= one shot).
0x400000), NX
enabled, not stripped, with debug info.-no-pie -fno-pie -fno-stack-protector -static -g.pwntools/checksec may report "canary found" —
this is a false positive caused by a static libc symbol. The vulnerable
function redact() ends with a plain leave ; ret with no canary check,
which confirms the mitigation is absent.declass.c) and the vulnerabilitystatic const char *const re = "flux"; static const char *const replace = "[REDACTED]"; static void redact(char buf[], size_t size) { // regex-based scan for "flux" // for each match at offset `off`, len = 4: memcpy(&buf[off + strlen(replace)], &buf[off + len], remaining); // shift tail right by +6 memcpy(&buf[off], replace, strlen(replace)); // write "[REDACTED]" } int main(void) { char buf[512] = { 0 }; size_t n = read(STDIN_FILENO, buf, sizeof(buf)); // up to 512 bytes redact(buf, n); printf("%s", buf); }
...