Steganography Analysis
Concept
Steganography hides data inside the pixel/bit structure of an otherwise-normal-looking file (commonly images), rather than appending it. It requires format-specific tools (steghide, zsteg) since the hidden data isn't a separate recognizable file signature.
When to Use
- Metadata and binwalk are clean, but the challenge strongly implies 'hidden data'.
- Image looks visually odd (color banding, unusual file size for its dimensions).
Workflow
- 1Rule out metadata/appended-file hiding first
exiftool/binwalk.
- 2Check for a steghide-embedded payload
Try without a passphrase, then common/derived passphrases.
- 3Check LSB/bit-plane data for PNG/BMP
zsteg or manual bit-plane extraction.
- 4Try common CTF stego passphrases from challenge context
Often tied to challenge name/theme.
Commands
steghide extract -sf FILE_PATHsteghide extract -sf evidence.jpg
Attempts to extract a steghide-embedded payload, prompting for a passphrase (blank is tried by pressing enter).
-sf— Stego file to extract from.
When to use: On JPEG/BMP/WAV/AU files when steganography is suspected.
Expected output:
wrote extracted data to "flag.txt".
Look for: Successful extraction with no/blank passphrase, or confirm steghide even recognizes the file as containing embedded data.
Next step: Read the extracted file; if passphrase-protected, try challenge-specific guesses or crack with stegseek.
stegseek FILE_PATH FILE_PATHstegseek evidence.jpg /usr/share/wordlists/rockyou.txt
Brute-forces the steghide passphrase using a wordlist (much faster than steghide's own brute-force).
When to use: When steghide confirms data is present but the passphrase is unknown.
Expected output:
[i] Found passphrase: "letmein" [i] Original filename: "flag.txt".
Look for: A successful passphrase match and the extracted filename.
Next step: Read the extracted file.
zsteg FILE_PATHzsteg evidence.png
Detects common LSB-steganography patterns in PNG/BMP files across multiple bit planes/channels.
When to use: On PNG/BMP files (steghide doesn't support PNG) when LSB hiding is suspected.
Expected output:
b1,r,lsb,xy .. text: "flag{...}"Look for: Any line showing readable text or a recognizable file signature in a bit-plane.
Next step: Extract using the specific channel/plane zsteg identified.
Tools
Steghide
Embeds/extracts hidden data in JPEG, BMP, WAV, AU files using a passphrase.
When to use: JPEG/BMP/WAV/AU files suspected of stego content.
sudo apt install steghidesteghide extract -sf FILE_PATHExample workflow: Try blank passphrase -> stegseek with rockyou -> try challenge-themed guesses manually.
Zsteg
LSB/bit-plane steganography detector, specifically strong on PNG/BMP.
When to use: PNG files (steghide doesn't handle PNG).
sudo gem install zstegzsteg FILE_PATH-a— Run all detection checks (slower, more thorough).
Example workflow: zsteg -a on a suspicious PNG, scan for readable text/signatures across channels.
Findings & Interpretation
Interesting
- Readable flag text inside an LSB plane
- A full embedded archive/file inside steghide's payload
False Positives
- zsteg often reports noise as 'possible text' on normal, non-stego images — treat low-confidence matches skeptically
How to Validate
- Confirm extracted content is coherent text/a valid file, not random noise matching a loose pattern
Next Step
- Treat any extracted file as new evidence and restart the file-forensics workflow on it.
Troubleshooting
steghide extract fails with 'could not extract any data'.
Likely cause: The file doesn't actually contain steghide-embedded data, or wrong passphrase.
Verify: Confirm the file format is one steghide supports (JPEG/BMP/WAV/AU — not PNG).
Fix: For PNG, switch to zsteg instead; for JPEG/BMP, try stegseek against a wordlist before concluding there's nothing.
Recovery: Reconsider whether the hiding method is something else entirely (appended file via binwalk, metadata).
Avoid repeating: Match the tool to the file format — steghide and zsteg cover different formats, don't use one where the other applies.