steganography-techniques

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

SKILL: Steganography Techniques — Expert Analysis Playbook

技能:隐写术技术——专家分析手册

AI LOAD INSTRUCTION: Expert steganography detection and extraction techniques. Covers image steganography (LSB, PNG chunk hiding, JPEG DCT, EXIF metadata, dimension tricks, palette manipulation), audio steganography (spectrogram, LSB, DTMF, morse), file steganography (polyglots, binwalk, NTFS ADS, steghide), and text steganography (whitespace, zero-width Unicode, homoglyphs). Base models miss the systematic file-type-based analysis approach and tool-specific extraction workflows.
AI 加载说明:专业隐写术检测与提取技术,涵盖图像隐写(LSB、PNG 块隐藏、JPEG DCT、EXIF 元数据、尺寸诡计、调色板操作)、音频隐写(频谱图、LSB、DTMF、摩尔斯电码)、文件隐写(多格式复合文件、binwalk、NTFS ADS、steghide)和文本隐写(空白符、零宽 Unicode、同形异义字)。基础模型缺乏基于文件类型的系统化分析方法和特定工具的提取工作流。

0. RELATED ROUTING

0. 相关路由

Before going deep, consider loading:
  • traffic-analysis-pcap for extracting files from network captures before stego analysis
  • memory-forensics-volatility for extracting files from memory dumps
  • classical-cipher-analysis if extracted hidden data is further encrypted/encoded
深入分析前,可考虑加载以下内容:
  • traffic-analysis-pcap 用于在隐写分析前从网络抓包中提取文件
  • memory-forensics-volatility 用于从内存转储中提取文件
  • classical-cipher-analysis 适用于提取的隐藏数据被进一步加密/编码的场景

Tool Reference

工具参考

Also load STEGO_TOOLS_GUIDE.md when you need:
  • Tool installation instructions and dependencies
  • Detailed command reference for each stego tool
  • Workflow patterns for specific file types

如需以下内容,还可加载 STEGO_TOOLS_GUIDE.md
  • 工具安装说明与依赖项
  • 各隐写工具的详细命令参考
  • 特定文件类型的工作流模式

1. IMAGE STEGANOGRAPHY

1. 图像隐写

LSB (Least Significant Bit)

LSB(最低有效位)

LSB embeds data in the least significant bits of pixel color channels.
bash
undefined
LSB 会将数据嵌入到像素颜色通道的最低有效位中。
bash
undefined

zsteg — LSB analysis for PNG/BMP

zsteg — 针对 PNG/BMP 的 LSB 分析工具

zsteg image.png # auto-detect all LSB patterns zsteg image.png -a # try all known methods zsteg image.png -b 1 # extract bit plane 1 zsteg image.png -E "b1,rgb,lsb,xy" # specific extraction pattern
zsteg image.png # 自动检测所有 LSB 模式 zsteg image.png -a # 尝试所有已知方法 zsteg image.png -b 1 # 提取第1位平面 zsteg image.png -E "b1,rgb,lsb,xy" # 指定提取模式

StegSolve (Java GUI)

StegSolve (Java GUI)

java -jar StegSolve.jar
java -jar StegSolve.jar

Navigate color planes: Red 0, Green 0, Blue 0 → look for hidden image/text

导航到颜色平面:红色0、绿色0、蓝色0 → 查找隐藏的图像/文本

Data Extractor: specify bit planes + byte order

数据提取器:指定位平面 + 字节序

stegoveritas — comprehensive automated analysis

stegoveritas — 全面的自动化分析工具

stegoveritas image.png
stegoveritas image.png

Runs: exiftool, binwalk, zsteg, foremost, color plane extraction

自动运行:exiftool、binwalk、zsteg、foremost、颜色平面提取

undefined
undefined

PNG Specific

PNG 专属隐写

bash
undefined
bash
undefined

pngcheck — validate structure, find hidden chunks

pngcheck — 验证结构,查找隐藏块

pngcheck -v image.png
pngcheck -v image.png

Hidden chunks: tEXt, zTXt (compressed text), iTXt (international text)

隐藏块:tEXt、zTXt(压缩文本)、iTXt(国际化文本)

Custom/private chunks may contain hidden data

自定义/私有块可能包含隐藏数据

CRC vs dimensions trick

CRC 与尺寸诡计

If CRC doesn't match declared dimensions → image was cropped

如果 CRC 与声明的尺寸不匹配 → 图像被裁剪过

Fix: brute-force correct width/height → reveals hidden rows/columns

修复方法:暴力破解正确的宽高 → 显示隐藏的行/列

python3 -c " import struct, zlib with open('image.png','rb') as f: data = f.read()
python3 -c " import struct, zlib with open('image.png','rb') as f: data = f.read()

Check IHDR CRC at offset 29

检查偏移量29处的 IHDR CRC

ihdr = data[12:29] for h in range(1,2000): for w in range(1,2000): new_ihdr = struct.pack('>II',w,h) + ihdr[8:] if zlib.crc32(b'IHDR'+new_ihdr) & 0xffffffff == struct.unpack('>I',data[29:33])[0]: print(f'Width: {w}, Height: {h}') "
ihdr = data[12:29] for h in range(1,2000): for w in range(1,2000): new_ihdr = struct.pack('>II',w,h) + ihdr[8:] if zlib.crc32(b'IHDR'+new_ihdr) & 0xffffffff == struct.unpack('>I',data[29:33])[0]: print(f'Width: {w}, Height: {h}') "

APNG (animated PNG) — hidden frames

APNG(动图PNG)—— 隐藏帧

Use apngdis to extract all frames: apngdis image.png

使用 apngdis 提取所有帧:apngdis image.png

undefined
undefined

JPEG Specific

JPEG 专属隐写

bash
undefined
bash
undefined

steghide — embed/extract from JPEG (DCT coefficient modification)

steghide — 向 JPEG 嵌入/提取数据(修改 DCT 系数)

steghide extract -sf image.jpg # extract (no passphrase) steghide extract -sf image.jpg -p PASSWORD # extract with passphrase steghide info image.jpg # check if data is embedded
steghide extract -sf image.jpg # 无密码提取 steghide extract -sf image.jpg -p PASSWORD # 带密码提取 steghide info image.jpg # 检查是否嵌入了数据

stegcracker — brute force steghide passphrase

stegcracker — 暴力破解 steghide 密码

stegcracker image.jpg wordlist.txt
stegcracker image.jpg wordlist.txt

jsteg — JPEG LSB steganography

jsteg — JPEG LSB 隐写工具

jsteg reveal image.jpg output.txt
jsteg reveal image.jpg output.txt

JPEG structure analysis

JPEG 结构分析

exiftool -v3 image.jpg # verbose metadata + structure jpegdump image.jpg # raw JPEG marker analysis
undefined
exiftool -v3 image.jpg # 详细元数据 + 结构 jpegdump image.jpg # 原始 JPEG 标记分析
undefined

EXIF Metadata

EXIF 元数据

bash
undefined
bash
undefined

exiftool — comprehensive metadata extraction

exiftool — 全面的元数据提取工具

exiftool image.jpg exiftool -b -ThumbnailImage image.jpg > thumb.jpg # extract thumbnail exiftool -all= image.jpg # strip all metadata
exiftool image.jpg exiftool -b -ThumbnailImage image.jpg > thumb.jpg # 提取缩略图 exiftool -all= image.jpg # 清除所有元数据

Hidden data in EXIF fields (comment, artist, copyright, etc.)

EXIF 字段中的隐藏数据(评论、作者、版权等)

exiftool -Comment image.jpg exiftool -UserComment image.jpg strings image.jpg | grep -i "flag|key|secret"
undefined
exiftool -Comment image.jpg exiftool -UserComment image.jpg strings image.jpg | grep -i "flag|key|secret"
undefined

Palette-Based (GIF)

基于调色板的隐写(GIF)

bash
undefined
bash
undefined

GIF color table manipulation — data in color palette order

GIF 颜色表操作 — 数据存储在调色板顺序中

gifsicle -I image.gif # info gifsicle --color-info image.gif # palette details
gifsicle -I image.gif # 查看信息 gifsicle --color-info image.gif # 查看调色板详情

Check for animation frames: convert -coalesce image.gif frame_%d.png

检查动画帧:convert -coalesce image.gif frame_%d.png


---

---

2. AUDIO STEGANOGRAPHY

2. 音频隐写

Spectrogram Analysis

频谱图分析

bash
undefined
bash
undefined

Sonic Visualiser — best for spectrogram viewing

Sonic Visualiser — 最佳频谱图查看工具

Layer → Add Spectrogram → look for visual patterns (text/images)

图层 → 添加频谱图 → 查找视觉模式(文本/图像)

Audacity

Audacity

Analyze → Plot Spectrum

分析 → 绘制频谱

Select audio → change view to Spectrogram

选中音频 → 切换视图为频谱图

sox for command-line spectrogram generation

sox 命令行生成频谱图

sox audio.wav -n spectrogram -o spectro.png
undefined
sox audio.wav -n spectrogram -o spectro.png
undefined

Audio LSB

音频 LSB

bash
undefined
bash
undefined

DeepSound — hide/extract files in audio (Windows)

DeepSound — 在音频中隐藏/提取文件(Windows)

GUI tool: open audio file → extract hidden files

GUI 工具:打开音频文件 → 提取隐藏文件

WavSteg — LSB in WAV files

WavSteg — WAV 文件 LSB 隐写工具

python3 WavSteg.py -r -i audio.wav -o output.txt -n 1 # extract 1 LSB python3 WavSteg.py -r -i audio.wav -o output.txt -n 2 # extract 2 LSBs
undefined
python3 WavSteg.py -r -i audio.wav -o output.txt -n 1 # 提取1位 LSB python3 WavSteg.py -r -i audio.wav -o output.txt -n 2 # 提取2位 LSB
undefined

DTMF / Morse Code

DTMF / 摩尔斯电码

bash
undefined
bash
undefined

DTMF decoder (phone tones)

DTMF 解码器(电话按键音)

multimon-ng -t wav -a DTMF audio.wav
multimon-ng -t wav -a DTMF audio.wav

Morse code

摩尔斯电码

Audacity → visual inspection of on/off pattern

Audacity → 目视检查通断模式

Online decoder or manual: .- = A, -... = B, etc.

在线解码器或手动解码:.- = A, -... = B 等

SSTV (Slow-Scan Television) — image in audio

SSTV(慢扫描电视)—— 音频中的图像

qsstv # GUI decoder
qsstv # GUI 解码器

Or: RX-SSTV (Windows)

或:RX-SSTV(Windows)

undefined
undefined

WAV Header Manipulation

WAV 头部操作

bash
undefined
bash
undefined

Check for data appended after WAV audio data

检查 WAV 音频数据后是否附加了数据

WAV data chunk size vs actual file size

WAV 数据块大小 vs 实际文件大小

python3 -c " import wave w = wave.open('audio.wav','rb') print(f'Frames: {w.getnframes()}, Channels: {w.getnchannels()}, Width: {w.getsampwidth()}') expected = w.getnframes() * w.getnchannels() * w.getsampwidth() + 44 # 44 = WAV header import os actual = os.path.getsize('audio.wav') if actual > expected: print(f'Extra data: {actual - expected} bytes appended') "

---
python3 -c " import wave w = wave.open('audio.wav','rb') print(f'Frames: {w.getnframes()}, Channels: {w.getnchannels()}, Width: {w.getsampwidth()}') expected = w.getnframes() * w.getnchannels() * w.getsampwidth() + 44 # 44 = WAV 头部大小 import os actual = os.path.getsize('audio.wav') if actual > expected: print(f'Extra data: {actual - expected} bytes appended') "

---

3. FILE STEGANOGRAPHY

3. 文件隐写

Polyglot Files

多格式复合文件

A single file that is valid in two or more formats simultaneously.
bash
undefined
单个文件可同时在两种或多种格式下均有效。
bash
undefined

Detection: check file with multiple tools

检测:用多种工具检查文件

file suspicious_file xxd suspicious_file | head # check magic bytes binwalk suspicious_file # find embedded files
file suspicious_file xxd suspicious_file | head # 检查魔数 binwalk suspicious_file # 查找嵌入的文件

Common polyglots: PDF+ZIP, JPEG+ZIP, JPEG+RAR, PNG+ZIP

常见复合文件:PDF+ZIP、JPEG+ZIP、JPEG+RAR、PNG+ZIP

Try unzip on image files:

尝试对图像文件执行解压:

unzip image.jpg -d extracted/ 7z x image.jpg -oextracted/
undefined
unzip image.jpg -d extracted/ 7z x image.jpg -oextracted/
undefined

Appended / Embedded Data

附加/嵌入数据

bash
undefined
bash
undefined

binwalk — scan for embedded files and data

binwalk — 扫描嵌入的文件和数据

binwalk image.png # scan binwalk -e image.png # extract embedded files binwalk --dd='.*' image.png # extract everything
binwalk image.png # 扫描 binwalk -e image.png # 提取嵌入的文件 binwalk --dd='.*' image.png # 提取所有内容

foremost — file carving

foremost — 文件雕刻工具

foremost -i suspicious_file -o output_dir/
foremost -i suspicious_file -o output_dir/

dd — manual extraction

dd — 手动提取

If binwalk shows embedded ZIP at offset 0x1234:

如果 binwalk 显示偏移量 0x1234 处有嵌入的 ZIP 文件:

dd if=suspicious_file bs=1 skip=$((0x1234)) of=extracted.zip
undefined
dd if=suspicious_file bs=1 skip=$((0x1234)) of=extracted.zip
undefined

NTFS Alternate Data Streams (ADS)

NTFS 备用数据流(ADS)

cmd
:: List ADS (Windows)
dir /r file.txt
Get-Item file.txt -Stream *

:: Read hidden stream
more < file.txt:hidden_stream
Get-Content file.txt -Stream hidden_stream

:: Create ADS (for testing)
echo "hidden data" > file.txt:secret
cmd
:: 列出 ADS(Windows)
dir /r file.txt
Get-Item file.txt -Stream *

:: 读取隐藏流
more < file.txt:hidden_stream
Get-Content file.txt -Stream hidden_stream

:: 创建 ADS(用于测试)
echo "hidden data" > file.txt:secret

Steghide Brute Force

Steghide 暴力破解

bash
undefined
bash
undefined

stegcracker — wordlist attack on steghide passphrase

stegcracker — 对 steghide 密码执行字典攻击

stegcracker image.jpg /usr/share/wordlists/rockyou.txt
stegcracker image.jpg /usr/share/wordlists/rockyou.txt

stegseek — faster alternative

stegseek — 速度更快的替代工具

stegseek image.jpg /usr/share/wordlists/rockyou.txt
stegseek image.jpg /usr/share/wordlists/rockyou.txt

stegseek is ~10000x faster than stegcracker

stegseek 速度比 stegcracker 快约10000倍


---

---

4. TEXT STEGANOGRAPHY

4. 文本隐写

Whitespace Encoding

空白符编码

bash
undefined
bash
undefined

Tabs and spaces encode binary (tab=1, space=0 or vice versa)

制表符和空格编码二进制(制表符=1,空格=0,反之亦然)

stegsnow — whitespace steganography

stegsnow — 空白符隐写工具

stegsnow -C message.txt # extract hidden message stegsnow -C -p PASSWORD message.txt # extract with password
stegsnow -C message.txt # 提取隐藏消息 stegsnow -C -p PASSWORD message.txt # 带密码提取

Manual detection:

手动检测:

cat -A file.txt | head # show tabs (^I) and line endings ($) xxd file.txt | grep "09 20|20 09" # look for tab/space patterns
undefined
cat -A file.txt | head # 显示制表符(^I)和行尾符($) xxd file.txt | grep "09 20|20 09" # 查找制表符/空格模式
undefined

Zero-Width Characters

零宽字符

bash
undefined
bash
undefined

Unicode invisible characters used for encoding:

用于编码的 Unicode 不可见字符:

U+200B (Zero-Width Space), U+200C (ZWNJ), U+200D (ZWJ), U+FEFF (BOM)

U+200B(零宽空格)、U+200C(零宽非连接符)、U+200D(零宽连接符)、U+FEFF(字节顺序标记)

Detection:

检测:

python3 -c " text = open('message.txt','r').read() hidden = [c for c in text if ord(c) in [0x200b, 0x200c, 0x200d, 0xfeff]] print(f'Found {len(hidden)} zero-width characters') binary = ''.join('0' if ord(c)==0x200b else '1' for c in hidden)
python3 -c " text = open('message.txt','r').read() hidden = [c for c in text if ord(c) in [0x200b, 0x200c, 0x200d, 0xfeff]] print(f'Found {len(hidden)} zero-width characters') binary = ''.join('0' if ord(c)==0x200b else '1' for c in hidden)

Convert binary to ASCII

将二进制转换为 ASCII

"
"

Online tools: holloway.nz/steg, Unicode Steganography decoders

在线工具:holloway.nz/steg、Unicode 隐写解码器

undefined
undefined

Homoglyph Substitution

同形异义字替换

bash
undefined
bash
undefined

Visually identical characters from different Unicode blocks

来自不同 Unicode 块的视觉上完全相同的字符

e.g., Latin 'a' (U+0061) vs Cyrillic 'а' (U+0430)

例如:拉丁字母 'a'(U+0061) vs 西里尔字母 'а'(U+0430)

Detection:

检测:

python3 -c " text = open('message.txt','r').read() for i, c in enumerate(text): if ord(c) > 127: print(f'Position {i}: char={c} ord={ord(c)} name={import("unicodedata").name(c,"?")}') "

---
python3 -c " text = open('message.txt','r').read() for i, c in enumerate(text): if ord(c) > 127: print(f'Position {i}: char={c} ord={ord(c)} name={import("unicodedata").name(c,"?")}') "

---

5. DECISION TREE

5. 决策树

Suspect hidden data — what file type?
├── Image (PNG/BMP)?
│   ├── Check metadata: exiftool (§1 EXIF)
│   ├── Check structure: pngcheck, binwalk (§1 PNG)
│   ├── LSB analysis: zsteg, StegSolve (§1 LSB)
│   ├── Check dimensions vs CRC: height/width brute force (§1 PNG)
│   ├── Check for appended data: binwalk -e (§3)
│   └── Try as polyglot: unzip/7z (§3)
├── Image (JPEG)?
│   ├── Check metadata: exiftool (§1 EXIF)
│   ├── Try steghide: steghide extract (§1 JPEG)
│   │   └── Password protected? → stegseek brute force (§3)
│   ├── Try jsteg: jsteg reveal (§1 JPEG)
│   ├── Check for appended data: binwalk -e (§3)
│   └── Check thumbnail: exiftool -b -ThumbnailImage (§1 EXIF)
├── Image (GIF)?
│   ├── Check frames: extract all animation frames (§1 Palette)
│   ├── Check palette: gifsicle --color-info (§1 Palette)
│   └── Check for appended data: binwalk -e (§3)
├── Audio (WAV/MP3/FLAC)?
│   ├── Spectrogram: Sonic Visualiser / Audacity (§2)
│   ├── LSB: WavSteg (§2)
│   ├── DTMF tones: multimon-ng (§2)
│   ├── Morse code: manual or decoder (§2)
│   ├── SSTV: qsstv (§2)
│   └── Check file size vs expected: header analysis (§2)
├── Text file?
│   ├── Check whitespace: cat -A, stegsnow (§4)
│   ├── Check zero-width chars: Unicode analysis (§4)
│   ├── Check homoglyphs: non-ASCII detection (§4)
│   └── Check encoding: multiple base decodings
├── Any file type?
│   ├── strings: strings -n 8 file | grep -i "flag\|key\|pass"
│   ├── binwalk: binwalk -e file (embedded files) (§3)
│   ├── file: file suspicious_file (true type)
│   ├── xxd: check magic bytes, compare headers
│   └── NTFS? → check ADS: dir /r (§3)
└── Password/passphrase needed?
    ├── steghide → stegseek / stegcracker (§3)
    ├── Check challenge description for hints
    └── Try common passwords: password, file name, challenge name
怀疑存在隐藏数据 — 目标文件类型是什么?
├── 图像(PNG/BMP)?
│   ├── 检查元数据:exiftool(§1 EXIF)
│   ├── 检查结构:pngcheck、binwalk(§1 PNG)
│   ├── LSB 分析:zsteg、StegSolve(§1 LSB)
│   ├── 检查尺寸与 CRC 匹配度:暴力破解宽高(§1 PNG)
│   ├── 检查附加数据:binwalk -e(§3)
│   └── 尝试作为复合文件处理:unzip/7z(§3)
├── 图像(JPEG)?
│   ├── 检查元数据:exiftool(§1 EXIF)
│   ├── 尝试 steghide:steghide extract(§1 JPEG)
│   │   └── 有密码保护? → stegseek 暴力破解(§3)
│   ├── 尝试 jsteg:jsteg reveal(§1 JPEG)
│   ├── 检查附加数据:binwalk -e(§3)
│   └── 检查缩略图:exiftool -b -ThumbnailImage(§1 EXIF)
├── 图像(GIF)?
│   ├── 检查帧:提取所有动画帧(§1 调色板)
│   ├── 检查调色板:gifsicle --color-info(§1 调色板)
│   └── 检查附加数据:binwalk -e(§3)
├── 音频(WAV/MP3/FLAC)?
│   ├── 频谱图分析:Sonic Visualiser / Audacity(§2)
│   ├── LSB 分析:WavSteg(§2)
│   ├── DTMF 音:multimon-ng(§2)
│   ├── 摩尔斯电码:手动或解码器(§2)
│   ├── SSTV:qsstv(§2)
│   └── 检查文件大小与预期值差:头部分析(§2)
├── 文本文件?
│   ├── 检查空白符:cat -A、stegsnow(§4)
│   ├── 检查零宽字符:Unicode 分析(§4)
│   ├── 检查同形异义字:非 ASCII 字符检测(§4)
│   └── 检查编码:多进制解码
├── 任意文件类型?
│   ├── strings 扫描:strings -n 8 file | grep -i "flag\|key\|pass"
│   ├── binwalk 扫描:binwalk -e file(提取嵌入文件)(§3)
│   ├── file 检测:file suspicious_file(真实格式)
│   ├── xxd 分析:检查魔数、对比头部
│   └── NTFS 环境? → 检查 ADS:dir /r(§3)
└── 需要密码/口令?
    ├── steghide 加密 → stegseek / stegcracker(§3)
    ├── 查看挑战描述获取提示
    └── 尝试常用密码:password、文件名、挑战名称