DL·SYS
Contact ↗

CSCTF 2026 · Forensics · 150 pts

Flotsam.

A PNG's own compressed pixel stream is scattered across non-contiguous 512-byte sectors, deliberately mixed with an unrelated decoy file's data.

PNG carvingzlib stream reassembly
EventCSCTF 2026, Operation Dawn (online jeopardy)
CategoryForensics
Points150
StatusSolved during the event
Targetraw sector dump, offline

TL;DR. A PNG's header and IEND marker are present, but in the wrong relative order on disk, meaning its compressed IDAT data is fragmented across several non-contiguous 512-byte sectors interleaved with an unrelated decoy file. Reassembling the fragments in the right order (verified by matching both the declared IDAT length and its on-disk CRC) and decompressing produces the complete original image.

Challenge

Recover a flag printed on an image whose own compressed data is fragmented across non-contiguous disk sectors.

Solution

Scanning the raw dump finds a PNG header at offset 26624 and its IEND marker at offset 24215 — before the header, in file position terms, which immediately signals that the image's IDAT (compressed pixel) data isn't stored contiguously between them. The intervening space holds an unrelated NMEA log and a decoy JPEG at offset 11264, both deliberately mixed in to confuse a naive carving attempt.

Identifying the real IDAT fragments by their position and reassembling them in the correct order — fragA(26665..34816) + R1(1536..10752) + R2(17920..21504) + R3(22528..24207) — gives a combined length that matches the PNG's own declared IDAT length exactly (22630 bytes), and decompressing that reassembled zlib stream produces exactly the expected 1,186,120 bytes for a 760×520 RGB image. As a final confirmation, the reassembled IDAT's CRC-32 matches the value stored on disk.

Rebuilding and rendering the full PNG from the reassembled data shows the flag printed directly on the image as the "RECOVERY KEY".

Flag

FlagCSCTF{flotsam_0e91019a8e70267f550895930247d088}

What I took from it