Corrupted Vision
Category: Forensics
Points: 100
Flag: KICTF{y0u_f1nd_th3_c0rrupt3d_0n3}
Challenge Overview
We were given a PNG file that did not open properly.
Step 1 – Inspect File Header
Using xxd, we found the PNG header was corrupted: 89 58 4E 47 instead of 89 50 4E 47.
The byte 50 (P) was replaced with 58 (X).
Step 2 – Fix PNG Header
We fixed the corrupted bytes using dd.
Step 3 – Extract and Reconstruct
We extracted the IDAT data, decompressed it, and reconstructed the image from raw pixel data.
import zlib
from PIL import Image