Skip to content
CTF

Steganography

Image, audio, and text steganography techniques for CTF

Steganography Cheat Sheet

Hidden data extraction techniques for CTF challenges.


Initial Analysis

File Type Check

BASH
file suspicious_file
xxd suspicious_file | head
hexdump -C suspicious_file | head

# Check for embedded files
binwalk suspicious_file
binwalk -e suspicious_file  # Extract
BASH
strings suspicious_file | grep -i flag
strings -n 8 suspicious_file
strings -el suspicious_file  # Unicode

Metadata

BASH
exiftool image.png
exiftool -v image.jpg
identify -verbose image.png  # ImageMagick

Image Steganography

Visual Inspection

BASH
# Open in image viewer
# Check each color channel
# Look for LSB patterns
# Compare to original if available

Steghide (JPEG/BMP)

BASH
# Extract with password
steghide extract -sf image.jpg
steghide extract -sf image.jpg -p password

# Get info
steghide info image.jpg

# Embed (for testing)
steghide embed -cf cover.jpg -ef secret.txt

zsteg (PNG/BMP)

BASH
# Quick check
zsteg image.png

# All options
zsteg -a image.png

# Specific bit plane
zsteg image.png -b 1b

Stegsolve

TEXT
1. Open image in Stegsolve
2. Use < > arrows to cycle through planes
3. Check color channels (R, G, B)
4. Try bit plane modes
5. Use "Analyse" > "Data Extract"

PNG-Specific

BASH
# Check chunks
pngcheck -v image.png

# Extract hidden data
pngcheck image.png
zlib-flate -uncompress < hidden_chunk

LSB Extraction

PYTHON
from PIL import Image

img = Image.open("image.png")
pixels = list(img.getdata())

# Extract LSB of each pixel
binary = ""
for pixel in pixels:
    for value in pixel[:3]:  # RGB
        binary += str(value & 1)

# Convert to ASCII
chars = [chr(int(binary[i:i+8], 2)) for i in range(0, len(binary), 8)]
print(''.join(chars))

Color Palette Analysis

PYTHON
# Check for hidden data in palette
from PIL import Image
img = Image.open("image.png")
print(img.getpalette())

Audio Steganography

Spectrogram Analysis

BASH
# Audacity: Analyze → Spectrogram
# Sonic Visualiser
# Look for hidden images/text in frequency

# Command line
sox audio.wav -n spectrogram

SSTV (Slow Scan TV)

BASH
# Decode SSTV signal to image
qsstv
# Or use online decoder

LSB in Audio

BASH
# Python with wave module
import wave

with wave.open('audio.wav', 'rb') as wav:
    frames = bytearray(wav.readframes(wav.getnframes()))
    
# Extract LSB from frames
binary = ''.join(str(frame & 1) for frame in frames[:8000])

Morse Code

BASH
# Listen for beeps
# Use Audacity to visualize
# Online Morse decoder

Deep Sound

BASH
# Windows tool for audio stego
# Try with password: empty, common passwords

Text Steganography

Whitespace

BASH
# Zero-width characters
# Trailing spaces
# Tab vs space patterns

# Check for hidden chars
cat -A file.txt
xxd file.txt | grep -E "09|20"

Unicode Steganography

BASH
# Zero-width joiners (U+200B, U+200C, U+200D, U+FEFF)
# Extract zero-width chars
python3 -c "print([hex(ord(c)) for c in open('file.txt').read() if ord(c) > 127])"

Snow

BASH
# Whitespace steganography tool
snow -C -p password secret.txt

First Letter/Word

TEXT
# Read first letter of each line
# Read first letter of each word
# Read nth character of each word

File Format Tricks

Concatenated Files

BASH
# Image + ZIP
binwalk image.png
unzip image.png

# Check end of file
xxd image.png | tail

Wrong Extension

BASH
file mysterious_file
# Rename with correct extension

Appended Data

BASH
# Data after image end marker
# JPEG: FF D9
# PNG: IEND chunk
# GIF: 3B

xxd image.png | tail -50

Polyglot Files

BASH
# File that is valid as multiple formats
file polyglot.pdf
# Try opening as different formats

Document Steganography

PDF

BASH
# Check embedded files
pdfinfo file.pdf
pdftotext file.pdf

# Extract objects
qpdf --show-object=N file.pdf
pdf-parser.py file.pdf

Office Documents

BASH
# DOCX/XLSX/PPTX are ZIP
unzip document.docx -d extracted/

# Check XML files for hidden data
grep -r "flag" extracted/

Network Steganography

PCAP Analysis

BASH
# Look for unusual protocols
# Check ICMP data
# DNS TXT records
# HTTP headers/cookies

tshark -r file.pcap -T fields -e data

DNS Tunneling

BASH
# Extract DNS queries
tshark -r file.pcap -Y "dns" -T fields -e dns.qry.name

Quick Checks

Ordered Workflow

TEXT
1. file - Identify type
2. strings - Quick flag search
3. exiftool - Metadata
4. binwalk - Embedded files
5. xxd/hexdump - Manual inspection
6. Tool specific to format

Common Passwords

TEXT
Try these for password-protected stego:
- (empty)
- password
- stego
- secret
- hidden
- flag
- ctf
- (challenge name)

Tools Summary

Tool Purpose Format
steghide Extract/embed JPEG, BMP
zsteg LSB analysis PNG, BMP
stegsolve Visual analysis Images
binwalk Embedded files Any
exiftool Metadata Any
foremost File carving Any
audacity Audio analysis Audio
snow Whitespace stego Text
outguess Stego tool JPEG
openstego GUI stego tool Images
On this page