stegtools

steganography images · audio LSB · metadata
Checkliststeghidezsteg stegsolveexiftool AudioManual LSB
01First Steps Checklist
Steg triage workflow
StepCommandFinds
1. Identifyfile image.jpgReal format (may differ from extension)
2. Metadataexiftool image.jpgComments, GPS, author, embedded thumb
3. Stringsstrings image.jpg | grep -i flagPlaintext data appended to file
4. Binwalkbinwalk -e image.jpgEmbedded files (zip, png inside jpg...)
5. Steghidesteghide extract -sf image.jpg -p ""Data embedded with steghide (JPEG/BMP)
6. zstegzsteg -a image.pngLSB steg in PNG/BMP
7. stegoveritasstegoveritas image.pngRuns many tools at once
8. Hex dumpxxd image.jpg | tail -20Data appended after EOF marker (FFD9)
9. Diffcompare original.png suspect.png diff.pngVisual pixel differences
02steghide
Extract & embed
# Supported: JPEG, BMP, WAV, AU

# Check if data is embedded
steghide info image.jpg
steghide info image.jpg -p ""     # empty password

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

# Extract to specific file
steghide extract -sf image.jpg -of output.txt

# Embed data
steghide embed -cf image.jpg -ef secret.txt
steghide embed -cf image.jpg -ef secret.txt -p "pass"
stegseek — crack password
# stegseek: fast steghide cracker
# Install: https://github.com/RickdeJager/stegseek

# Crack with rockyou
stegseek image.jpg /usr/share/wordlists/rockyou.txt

# Crack with custom wordlist
stegseek image.jpg mywordlist.txt

# Just check if any steghide data (no password)
stegseek --seed image.jpg

# steghide brute via bash (slow fallback)
while IFS= read -r pass; do
  steghide extract -sf image.jpg -p "$pass" -f 2>/dev/null \
    && echo "PASSWORD: $pass" && break
done < rockyou.txt
03zsteg
Usage
# Supports PNG, BMP only
# Install: gem install zsteg

# Try all channels
zsteg image.png
zsteg -a image.png          # exhaustive (all methods)

# Specific channel
zsteg -e b1,r,lsb,xy image.png  # red channel, bit1, LSB, L-R T-B
zsteg -e b1,rgb,lsb,xy image.png
zsteg -e b1,bgr,lsb,xy image.png
zsteg -e b2,rgb,lsb,xy image.png   # bit 2
zsteg -e b1,rgba,lsb,xy image.png  # with alpha

# Save extracted data to file
zsteg -e b1,rgb,lsb,xy image.png > extracted.bin
file extracted.bin   # check what it is

# Verbose output
zsteg -v image.png
LSB manual (Python)
python3 -c "
from PIL import Image

img = Image.open('image.png').convert('RGB')
pixels = list(img.getdata())

# Extract LSB of red channel, left-to-right top-to-bottom
bits = [px[0] & 1 for px in pixels]

# Group into bytes
chars = []
for i in range(0, len(bits)-8, 8):
    byte = int(''.join(map(str, bits[i:i+8])), 2)
    chars.append(chr(byte))
    if byte == 0: break

result = ''.join(filter(lambda c: 32<=ord(c)<127, chars))
print(result[:200])
"

# Try all channel combinations
python3 -c "
from PIL import Image
img = Image.open('image.png').convert('RGBA')
pixels = list(img.getdata())
for ch in range(4):       # R G B A
    bits = [px[ch] & 1 for px in pixels]
    data = bytes(int(''.join(map(str,bits[i:i+8])),2)
                 for i in range(0,len(bits)-8,8))
    if b'picoCTF' in data or b'flag' in data.lower():
        print(f'Channel {ch}:', data[:100])
"
04stegsolve (GUI)
Usage
# Download: https://github.com/eugenekolo/sec-tools/tree/master/stego/stegsolve
java -jar stegsolve.jar

# Load image → use arrow buttons to cycle views:
# Red plane 0  (LSB of red)
# Red plane 1
# ...through all bit planes of R,G,B,A
# Grey bits, Random colour, Colour inversion

# Analyse menu:
# Data Extract → manually set: bit, channel, order
# → save extracted bytes

# File Format → check file header / trailer anomalies

# Combine (XOR/AND/OR two images)
# Analyse → Image Combiner
# Useful for: two images XOR = hidden message

# Stereo (magic eye / depth illusion)
# Check if two similar images differ in specific rows
stegoveritas (automate everything)
# Runs many steg tools automatically
# pip install stegoveritas
# stegoveritas_install_deps (first time)

stegoveritas image.png
stegoveritas image.jpg
# Output in ./results/ directory
# Check each file in results/

# stegoveritas checks:
# - all bit planes
# - color channel histograms
# - EXIF data
# - appended data after EOF
# - LSB extraction attempts
# - string extraction

ls ./results/
strings ./results/* | grep -i "flag\|picoCTF"
05Audio Steganography
Spectrogram (most common CTF trick)
# Open in Audacity → View → Spectrogram
# OR change track to spectrogram view:
# Click track name → Spectrogram
# Zoom in vertically to see hidden text/image

# Sonic Visualiser (better for CTF)
sonic-visualiser audio.wav
# Add Layer → Colour Spectrogram
# Adjust frequency range + colour map

# Generate spectrogram image (CLI)
sox audio.wav -n spectrogram -o spec.png
convert spec.png -resize 200% spec_big.png   # zoom in

# Python spectrogram
python3 -c "
import matplotlib.pyplot as plt
import scipy.io.wavfile as wav
import numpy as np
rate, data = wav.read('audio.wav')
if data.ndim > 1: data = data[:,0]
plt.specgram(data, Fs=rate, cmap='hot')
plt.savefig('spec.png', dpi=200)
"
Audio LSB & other
# WAV LSB extraction
python3 -c "
import wave, struct
w = wave.open('audio.wav', 'rb')
n = w.getnframes()
frames = w.readframes(n)
# 16-bit samples: unpack as shorts
samples = struct.unpack(f'<{n}h', frames[:n*2])
bits = [s & 1 for s in samples]
chars = [chr(int(''.join(map(str,bits[i:i+8])),2))
         for i in range(0,len(bits)-8,8)]
result = ''.join(filter(lambda c:32<=ord(c)<127, chars))
print(result[:200])
"

# DTMF tones (phone key presses)
multimon-ng -t wav -a DTMF audio.wav

# Morse code in audio
morse2ascii audio.wav   # if installed
# Or: listen manually / Audacity visual inspection

# steghide with WAV
steghide extract -sf audio.wav -p ""
06exiftool & metadata
exiftool — full metadata
# Show all metadata
exiftool image.jpg

# Key fields to check in CTF:
exiftool -Comment           image.jpg   # comment field
exiftool -Artist -Author -Copyright image.jpg
exiftool -Description      image.jpg
exiftool -UserComment      image.jpg
exiftool -XMPToolkit       image.jpg   # XMP data (often abused)
exiftool -GPSLatitude -GPSLongitude image.jpg  # coordinates

# All fields batch across directory
exiftool -r ./images/ | grep -i "flag\|comment\|note"

# Check thumbnail (embedded JPEG in JPEG)
exiftool -b -ThumbnailImage image.jpg > thumb.jpg
file thumb.jpg && steghide info thumb.jpg
STEG CHECKLIST →  ① exiftool → Comment/Artist/GPS  ② strings | grep -i flag  ③ binwalk -e → embedded files  ④ steghide extract -sf img -p "" + stegseek for crack  ⑤ zsteg -a image.png for PNG LSB  ⑥ stegsolve bit planes + Data Extract  ⑦ xxd img | tail → data after EOF marker (FFD9 for JPEG)  ⑧ Audio: spectrogram in Audacity / sonic-visualiser