Steganography
Steganography hides information inside another medium (image, audio, text, network) so that its very existence goes unnoticed —unlike encryption, which hides the content but not the fact that a message exists. It’s a CTF classic (forensics/stego category) and shows up in exfiltration and covert C2.
What it is
Section titled “What it is”While cryptography makes the message unreadable (you can see something is encrypted), steganography makes it invisible (it looks like a normal photo or audio). Combining them —encrypt, then hide— gives confidentiality and, on top of that, raises no suspicion: it’s the robust option.
| Cryptography | Steganography | |
|---|---|---|
| Hides | The content | The message’s existence |
| Can you tell something’s there? | Yes | No |
| Goal | Confidentiality | Concealment |
Threat model
Section titled “Threat model”In offense and in CTFs the challenge is to detect and extract: given a seemingly innocent file, determine whether it hides data and recover it. In defense, the inverse goal: detect covert channels and sanitize input before it’s used for exfiltration or C2. See Malware C2.
Common techniques
Section titled “Common techniques”- LSB (Least Significant Bit): alter the least significant bit of each pixel or sample; imperceptible changes that encode data.
- Metadata/EXIF: text hidden in image fields (comments, GPS).
- Append / data after EOF: attach a ZIP or file after the end of the JPEG/PNG (polyglot).
- Audio spectrogram: draw text or an image visible when viewing the WAV spectrum.
- Text stego: spaces, zero-width characters, capitalization, whitespace.
- Network: data in headers or in packet timing (covert channel).
Analysis flow (CTF / forensics)
Section titled “Analysis flow (CTF / forensics)”flowchart TD
A[Suspicious file] --> B[file + exiftool + strings]
B --> C{Anything embedded?}
C -->|binwalk detects| D[binwalk -e / foremost to extract]
C -->|no| E{Is it an image?}
E -->|PNG/BMP| F[zsteg + stegsolve: LSB and planes]
E -->|JPEG/WAV| G[steghide / stegseek with a wordlist]
E -->|audio| H[Spectrogram: Audacity / sonic-visualiser]
D --> I[Decode in CyberChef]
F --> I
G --> I
H --> I
# 1. Basic inspectionfile suspicious.pngexiftool suspicious.pngstrings -n 8 suspicious.pngbinwalk suspicious.png # embedded files? -> binwalk -e to extract# 2. Images: bit planes and LSBzsteg suspicious.png # PNG/BMP: detects LSB and common payloadssteghide extract -sf image.jpg # JPEG/WAV with a passphraseRed Team: breaking stego with a passphrase
Section titled “Red Team: breaking stego with a passphrase”# stegseek: very fast brute force of steghide with a wordliststegseek image.jpg rockyou.txt# also try passphrases from the challenge context or the authorized engagementBlue Team: detection and defense
Section titled “Blue Team: detection and defense”- Statistical steganalysis: detect anomalies in the LSBs (chi-square, tools like StegExpose).
- Sanitization: recompress or normalize images and strip metadata on input (DLP controls).
- Network: inspect covert channels (anomalous sizes or timing). See Malware C2.
Real-world cases
Section titled “Real-world cases”- Multiple malware campaigns hide payloads or C2 configuration in images (PNG/JPEG) to evade detection.
- APTs use steganography for exfiltration and to hide configurations in images posted on legitimate sites (MITRE ATT&CK technique T1027.003, Steganography).
- Recurring use in forensic CTFs as the first filter over the evidence.
Checklist
Section titled “Checklist”-
file+exiftool+stringsas a first pass -
binwalk/foremost: embedded files or data after EOF? - Images:
zsteg/stegsolvefor LSB and bit planes -
steghide/stegseekwith a wordlist for JPEG/WAV - Audio: check the spectrogram (sonic-visualiser/Audacity)
- Text: zero-width / whitespace stego
- Decode what you find in CyberChef (it may be encrypted)