Skip to main content

March 10, 2026

Introduction to Steganography Tools for CTF

Steganography tools for CTF: zsteg, steghide, stegcracker, Stegsolve, Stepic, and binwalk, with installation commands and when to reach for each one.

A pegboard of six hanging instruments with one lifted off, held before a plain image plate.

Introduction

You already know the idea: a flag smuggled inside an ordinary-looking PNG, WAV, or PDF, in the one place nobody thinks to look. What stops most solvers is not the concept, it is remembering which of a dozen tools handles which file type, how to install it, and the exact incantation to pull the payload back out. This page is that bench reference.

It covers the six tools you reach for most often (zsteg, Stepic, steghide, stegcracker, Stegsolve, and binwalk): the file types each one handles, the install command, and the exact invocation, with each section linking to the picoCTF challenge where it was the key to the solve so you can see it working on a real file.

Companion guides

This page is the install and quick-reference hub. For the technique-by-technique workflow and format-specific deep dives, pair it with EXIF and metadata forensics, audio steganography, and file carving and magic bytes.

Tip: When you receive an unknown file, always start with file suspicious.png and strings suspicious.png | grep -i pico. Sometimes the flag is sitting in plaintext metadata and no specialist tool is needed. file ignores the extension entirely and matches content against libmagic signatures, so it is the check that catches a JPEG named .png. For PNG the signature is a fixed 8 bytes, 89 50 4E 47 0D 0A 1A 0A, chosen by the PNG specification to detect exactly the transfer corruptions that break binary files: the high-bit byte catches 7-bit-stripping channels and the CR/LF pair catches line-ending translation.

Skip the manual workflow: Drop the file into Stegall and it runs every technique in this guide in parallel: zsteg-style LSB and bit-plane sweeps, spectrogram analysis, polyglot carving, metadata, whitespace decode, and a multi-layer base/ROT/XOR/zlib cascade on anything it extracts. Reach for the individual tools below when you want to inspect a specific channel by hand or a challenge calls for a custom passphrase.

zsteg: PNG and BMP bit-plane scanner

zsteg is the fastest way to extract data hidden in the least-significant (or most-significant) bits of PNG and BMP pixel values. It automatically checks dozens of channel/bit-depth/endianness combinations and prints anything that looks like text, so one command often reveals the flag outright.

The reason LSB hiding is invisible is arithmetic. A 24-bit RGB pixel gives 256 levels per channel, so flipping the lowest bit changes a channel by 1/255, roughly 0.4%, which no eye resolves. The capacity is large for the same reason: at one bit per channel a 1920 by 1080 RGB image carries 777,600 bytes of payload, about 760 KB, without altering the visible picture. This only works because PNG is losslessly compressed with DEFLATE; the same trick applied to a JPEG is destroyed the moment the image is re-encoded.

Install

sudo apt install ruby ruby-dev
sudo gem install zsteg

Basic usage

zsteg image.png # scan all common channels
zsteg -a image.png # exhaustive scan (slower, catches edge cases)

The output lists each channel it checks (e.g. b1,rgba,lsb,xy) alongside anything it extracts. Scan the text column for readable strings or a Base64 blob and copy it out for further decoding.

What to look for

If you see a long Base64 string in one of the channels, pipe it straight through base64 -d. If the output looks like compressed data, try zsteg -e "b1,rgba,lsb,xy" image.png | file - to identify the format before saving it.

Stepic: Python LSB steganography

Stepic is a Python library and command-line tool that hides and extracts text using the standard LSB-of-RGBA algorithm. It is simpler than zsteg and only handles that one encoding, but if a challenge was created specifically with Stepic then it is the right tool to reach for, as zsteg may not recognise the exact byte layout.

Install

pip install stepic
# or inside a virtual environment:
python3 -m venv venv && source venv/bin/activate
pip install stepic

Usage

stepic -d -i image.png # decode: hidden data to stdout
stepic -d -i image.png -o secret.txt # decode: hidden data to a file
stepic -e -i cover.png -t secret.txt -o output.png # encode
# -i/--image-in the carrier image
# -t/--data-in the file to hide (encode only)
# -o/--out data when decoding, image when encoding

Challenges that use Stepic

steghide: JPEG and BMP passphrase extraction

steghide embeds data inside JPEG and BMP files using a passphrase-based scheme. Unlike LSB tools, steghide modifies the DCT coefficients of JPEGs rather than raw pixel bits, making the embedding statistically harder to detect. In CTF challenges the passphrase is either blank (press Enter when prompted) or hidden somewhere else in the challenge: check IRC logs, metadata, or another file.

The DCT detail is what makes it survive JPEG compression. ITU-T T.81, the JPEG standard, splits the image into 8 by 8 pixel blocks and transforms each into 64 frequency coefficients before quantisation. steghide edits those already-quantised coefficients, so the payload lives downstream of the lossy step rather than being erased by it. Per its manual, it also encrypts the embedded data (Blowfish by default) and checksums it with CRC32, which is why a wrong passphrase fails cleanly instead of yielding garbage.

Install

sudo apt install steghide

Usage

steghide extract -sf image.jpg # prompts for passphrase (try blank first)
steghide extract -sf image.jpg -p '' # blank passphrase, non-interactive
steghide extract -sf image.jpg -p 'secretpassword'
steghide info image.jpg # check if any payload is embedded

After extraction, steghide writes a file (often named in the embed step). Read it with cat or inspect it with file to determine the next step.

Note: steghide does not handle PNG. Its manual lists exactly four supported cover formats: JPEG, BMP, WAV, and AU. Running it on a PNG returns an unsupported-format error, so reach for zsteg or Stegsolve there. Conversely, if a challenge hands you a WAV and zsteg finds nothing, steghide is the tool most solvers forget to try.

stegcracker: brute-force steghide passwords

stegcracker automates passphrase brute-forcing for steghide. You hand it an image and a wordlist and it tries every password until extraction succeeds. It is the steganography equivalent of Hashcat or John the Ripper.

Set expectations before you start it. rockyou.txt, the wordlist that ships with Kali, holds over 14 million entries recovered from the 2009 RockYou breach, and stegcracker has to invoke a full steghide extraction attempt per candidate rather than hashing in bulk. Throughput is therefore measured in thousands of guesses per second, not billions, so a full rockyou pass is minutes and an eight-character random passphrase is simply out of reach. If rockyou fails, the answer is in the challenge text, not in a bigger wordlist.

Install

pip3 install stegcracker
# requires steghide to be installed as well
sudo apt install steghide

Usage

stegcracker image.jpg wordlist.txt
# Common wordlists to try:
stegcracker image.jpg /usr/share/wordlists/rockyou.txt
# Specify output file name:
stegcracker image.jpg wordlist.txt --output extracted.txt

If the wordlist doesn't work, look for clues in the challenge about how the password was constructed. In some challenges the password follows a predictable pattern (for example, concatenated words from a specific category) and you can generate a custom wordlist with a small Python script.

# Example: generate candidate passwords from a list of words
python3 -c "
words = open('words.txt').read().splitlines()
for a in words:
for b in words:
print('prefix' + a + b)
" > custom_wordlist.txt
stegcracker image.bmp custom_wordlist.txt

Challenges that use stegcracker

Stegsolve: bit-plane visualiser

Stegsolve is a Java GUI tool that lets you visually inspect every bit plane of an image. While zsteg extracts text data automatically, Stegsolve shines when the hidden content is encoded in the most-significant bits (MSB) rather than the LSB, or when you need to visualise what the different planes look like to understand the encoding scheme.

Its Analyse > Data Extract panel is the main workhorse: you select which colour channels and which bit positions to include, choose row or column order, and Stegsolve assembles the bits into a byte stream you can save to a file or search with strings.

Install

wget http://www.caesum.com/handbook/Stegsolve.jar -O stegsolve.jar
chmod +x stegsolve.jar
java -jar stegsolve.jar

Extracting MSB data

  1. Open the image via File > Open.
  2. Go to Analyse > Data Extract.
  3. In the bit selection grid, tick Red 7, Green 7, Blue 7 (bit 7 = MSB).
  4. Set Bit Order to MSB First.
  5. Click Preview and look for readable text at the top.
  6. Use Save Text then grep pico to isolate the flag.
Tip: Use the arrow keys in the main view to cycle through all 32 bit planes, which is exactly 4 channels (R, G, B, A) times 8 bits of depth per channel in a 32-bit RGBA image. Some challenges hide an image-within-an-image in a single plane, visible the moment you switch to the right channel. A plane that looks like structured noise while its neighbours look like smooth gradients is the tell.

Challenges that use Stegsolve

binwalk: embedded file carving

binwalk is not a steganography tool in the traditional sense. It does not look at pixel bit planes. Instead, it scans any file for known file-format magic bytes (ZIP signatures, PNG headers, ELF headers, etc.) and reports every embedded file it finds, along with its byte offset. When a PNG has a ZIP archive stitched on after the image data ends, binwalk will catch it instantly.

That PNG-plus-ZIP polyglot works because the two formats read from opposite ends. The PNG specification makes the IEND chunk terminal, so a decoder stops there and ignores every trailing byte, while PKWARE's APPNOTE.TXT has ZIP readers locate the End of Central Directory record by scanning backwards from the end of the file. Both parsers are satisfied by the same bytes. This is also why cat image.png archive.zip > out.png produces a file that opens as an image and unzips as an archive, and why the fastest first check on any image is comparing the file size against where IEND sits.

Install

sudo apt install binwalk

Usage

binwalk image.png # list embedded files and their offsets
binwalk -e image.png # automatically extract everything found
binwalk -Me image.png # recursive extraction (extract from extracted files too)

After running binwalk -e image.png, check the created _image.png.extracted/ directory for the carved-out files. If the extracted archive is password-protected, look elsewhere in the challenge for the key.

You can also extract manually if automatic extraction fails. Use dd with the byte offset from binwalk's output:

# Example: extract ZIP starting at offset 39804
dd if=image.png bs=1 skip=39804 of=embedded.zip
unzip embedded.zip

Challenges that use binwalk

Quick reference

Not sure which tool to start with? Use this table as a decision guide based on the file type you receive.

zstegEasy

Files: PNG, BMP

Technique: LSB / MSB pixel bits

StepicEasy

Files: PNG

Technique: LSB-of-RGBA (Python)

steghideEasy

Files: JPEG, BMP

Technique: DCT coefficient embedding

stegcrackerMedium

Files: JPEG, BMP

Technique: Brute-force steghide passphrase

StegsolveMedium

Files: PNG, BMP, JPEG

Technique: Visual bit-plane inspection

binwalkEasy

Files: Any binary file

Technique: Embedded file carving

Recommended first-pass workflow

  1. file image.png to confirm the format is what the extension says.
  2. strings image.png | grep -i pico to grab any plaintext flag hiding in metadata.
  3. binwalk image.png to check for embedded archives or other files.
  4. PNG? Run zsteg image.png. If nothing, try zsteg -a.
  5. JPEG/BMP? Run steghide extract -sf image.jpg -p '' first (blank passphrase).
  6. Still nothing? Open in Stegsolve and cycle through planes manually.
  7. Password-protected steghide? Try stegcracker with rockyou.txt, or build a custom wordlist from challenge clues.

Sources and further reading

Steganography tooling is a thin layer over three file-format specs. Once you can read those, you can predict what each tool will and will not find.

  • The PNG specification for the 8-byte signature, chunk structure, and the terminal IEND chunk that makes trailing-data polyglots possible.
  • ITU-T T.81 (JPEG) for the 8x8 block DCT and the 64 coefficients steghide hides inside.
  • PKWARE APPNOTE.TXT for the End of Central Directory record and why ZIP parsers read backwards.
  • Tool documentation: steghide manual (supported formats, encryption, checksum), zsteg, and binwalk.

Run it in the browser

Tools on this site that do the work described above. No install, nothing uploaded: they run entirely in your browser.

Try it on these picoCTF challenges

Walkthroughs that put this technique to work, grouped by event.

Keep reading

Guides that build on the same ideas, plus the roadmap this topic sits under.