ForensicsHidden Investigations CTF 2026
Broken Signals
A corrupted file whose first four bytes were zeroed out. Recognising the remaining PNG structure and restoring the magic header reveals an image containing the flag.
What this one teaches
- Identifying file formats from internal structure (chunk names, CRC-32s) when the magic bytes are missing.
- PNG files have an 8-byte signature; the second half (0d 0a 1a 0a) is distinctive enough to confirm the format even when the first half is zeroed.
Task description
Our signals intelligence team intercepted a file during a routine sweep, but it appears corrupted. The file cannot be opened by any standard application. Something is wrong with the file itself — can you repair it and recover the hidden message?
Analysis
Inspecting the first and last bytes of the provided broken_signal.dat (15,916 bytes):
Head: 00000000 0d0a1a0a 0000000d 49484452 00000190 0000012c 10060000 00bd2739 81...
Tail: ...00000000 49454e44 ae426082
We immediately recognize the structure of a PNG image:
- Bytes
0x04..0x07are0d 0a 1a 0a, which is the second half of the 8-byte PNG file signature (89 50 4e 47 0d 0a 1a 0a). - Immediately following is the
IHDRchunk (0000000d 49484452) specifying a400x30016-bit RGBA image, with a valid CRC-32 (0xbd273981). - All subsequent chunks (
cHRM,bKGD,tIME,tEXt,IDAT, andIEND) are intact and pass CRC-32 verification. - Only the first 4 bytes of the PNG magic header were zeroed out (
00 00 00 00instead of89 50 4e 47/\x89PNG).
Solution
We restore the first 4 bytes of broken_signal.dat to \x89PNG (89 50 4e 47):
with open("broken_signal.dat", "rb") as f:
data = bytearray(f.read())
data[:4] = b"\x89PNG"
with open("repaired.png", "wb") as f:
f.write(data)
Opening the repaired repaired.png image reveals the text:
SIGNAL INTERCEPTED
hiCTF{h34d3r_r3p41r_m4st3r}
The flagReveal
hiCTF{h34d3r_r3p41r_m4st3r}This CTF was possibly solved, and the writeup most likely written by an LLM. Apologies for inconsistencies.