Description
Find the hidden flag. The flag is deeply nested inside the provided file - multiple layers of hidden content.
Setup
Download the challenge file.
Install the steg toolkit.
wget https://mercury.picoctf.net/static/.../challengesudo apt install steghide binwalksudo gem install zstegSolution
Walk me through it- Step 1Map the layer sequenceThe challenge nests several carriers. Outer file -> binwalk extract -> inner image -> zsteg LSB -> text-encoded layer -> final flag. Walk it one stage at a time and identify every file before reaching for a tool.bash
file challengebashbinwalk challengebashbinwalk -e challengebashls -la _challenge.extracted/Learn more
Why the order matters. Each layer uses a different stego technique, so each requires the right tool. Identify the file type with
filefirst, pick the matching tool, and only move to the next layer when the current one yields a new artifact.- Layer 1: an outer container (PNG/ZIP/etc.) with an appended archive that
binwalkcan carve. - Layer 2: an inner image whose LSB plane carries data that
zstegdumps. - Layer 3: the LSB output is itself encoded text that decodes to the flag.
- Layer 1: an outer container (PNG/ZIP/etc.) with an appended archive that
- Step 2Apply format-specific steg tools at each layerPNG/BMP -> zsteg. JPEG -> steghide. ZIP -> unzip. Inspect each extracted file with
filebefore choosing a tool. Iterate until a layer yields plain text containing the flag.bash# PNG (covers most picoCTF carriers):bashzsteg extracted_file.pngbashbash# JPEG:bashsteghide info extracted_file.jpgbashsteghide extract -sf extracted_file.jpg -p ''bashbash# Unknown binary:bashfile extracted_filebashstrings extracted_file | grep picoCTFLearn more
Tools by carrier:
- PNG:
zsteg(LSB across planes),pngcheck(chunk validation),stegsolve(visual bit planes). - JPEG:
steghide(passphrase-protected),jsteg,outguess. - WAV/MP3: spectrogram first, then
mp3stegoordeepsound. - PDF:
pdftotext, inspect object streams withqpdf --qdf --object-streams=disable. - Archives: try empty password,
password,ctf,picoCTFfor ZIPs.
About
--run-as-root. Newer binwalk refuses to extract while running as root unless you pass--run-as-root. That's only relevant when the extraction directory is owned by root (e.g., extracting inside/root/); from a normal user shell it's unnecessary. - PNG:
Flag
picoCTF{...}
Deeply nested steganography requires walking each layer in order: binwalk extract -> identify file type -> apply the right tool (zsteg for PNG LSB, steghide for JPEG) -> decode the resulting text.