$ cat writeup.md…
$ cat writeup.md…
sunshinectf2026
Task: Flask weather console with a hidden feed-override form giving SSRF; internal service renders PDFs with wkhtmltopdf 0.12.5. Solution: use gopher SSRF to POST /report, then abuse wkhtmltopdf following an HTTP 302 open-redirect to file:///flag.txt to bypass local-file blocking and read the flag from the rendered PDF.
$ 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 Punxsutawney Orbital Weather Authority has been broadcasting the same forecast since 1993. Every reading is fresh. Every date is February 2. The Bureau insists this is fine, and the groundhog has declined to comment. Their public console is up. Have a look at where it gets its numbers.
English summary: A public Flask weather console (behind nginx) fetches a station feed URL. A hidden manual-override form lets you control that URL, giving SSRF. The gopher:// scheme is allowed, so the SSRF can be turned into an arbitrary internal POST request. An internal loopback service renders PDFs with an old wkhtmltopdf build; abusing wkhtmltopdf's redirect-following to reach file:// yields local file read and the flag.
http://127.0.0.1:8000/feed.POST / with body feed=<url> points the console at a spare station feed URL. This is the SSRF entry point.POST / with feed=<url> makes the server fetch <url> and reflect the body inside <pre class="tape">...</pre>, plus a feed-debug: source=... bytes=... comment.The outer fetcher is implemented with pycurl. Restrictions (later confirmed via LFI on /app/app.py):
http:// and gopher:// schemes allowed (ALLOWED_SCHEMES); libcurl PROTOCOLS pinned to PROTO_HTTP | PROTO_GOPHER.FOLLOWLOCATION = False — the outer fetcher does not follow redirects.file:// via the outer fetcher returns 0 bytes (blocked).Because gopher:// is allowed, you can send arbitrary raw bytes (including a full HTTP request with custom headers) to any internal host:port. Gopher URL form: gopher://HOST:PORT/_<percent-encoded-raw-bytes> (first char after / is the gopher type selector _, the rest is the raw payload).
...