stego-toolkit

repository·master·Indexed 25 days ago

https://github.com/dominicbreuker/stego-toolkit

A Docker-based toolkit for solving steganography challenges in CTF environments. It provides a pre-configured environment featuring CLI tools (such as binwalk, stegoveritas.py, and zsteg), screening scripts for JPG and PNG files, and GUI support via X11 forwarding or VNC. The toolkit includes utilities for hiding and recovering data in audio and image files, as well as wordlist generation tools like John the Ripper, Crunch, and CeWL.

Tokens
2.8K
Snippets
7
Records
14
Agent score
33%

What's inside stego-toolkit

  1. Use general screening tools to analyze files

    master

    Before deep analysis, use these command-line tools to get a broad overview of a file's type, metadata, or embedded content:

    • file: Check file type.
    • exiftool: Check media metadata.
    • binwalk: Check for embedded or appended files.
    • strings: Look for readable characters.
    • foremost: Carve out embedded/appended files.
    • pngcheck: Get PNG details or verify integrity.
    • identify: Check image type and corruption (requires GraphicMagick).
    • ffmpeg: Check audio integrity and report errors.
    file stego.jpg
    exiftool stego.jpg
    binwalk stego.jpg
    strings stego.jpg
    foremost stego.jpg
    pngcheck stego.png
    identify -verbose stego.jpg
    ffmpeg -v info -i stego.mp3 -f null -
  2. Generate wordlists for brute forcing

    master

    When brute forcing steganography, use targeted wordlists rather than massive standard ones. Use these tools to generate them:

    • John the Ripper: Expand existing wordlists using rules.
      • Extensive rules (~x1000): john -wordlist:/path/to/your/wordlist -rules:Single -stdout > /path/to/expanded/wordlist
      • Reduced rules (~x50): john -wordlist:/path/to/your/wordlist -rules:Wordlist -stdout > /path/to/expanded/wordlist
    • Crunch: Generate wordlists based on patterns.
      • Example (6-char password ending in 1984): crunch 6 6 abcdefghijklmnopqrstuvwxyz -t @@1984
    • CeWL: Scrape websites for relevant words.
      • Example: cewl -d 0 -m 8 https://en.wikipedia.org/wiki/Donald_Trump (extracts strings $\ge$ 8 characters).
    john -wordlist:/path/to/your/wordlist -rules:Single -stdout > /path/to/expanded/wordlist
    crunch 6 6 abcdefghijklmnopqrstuvwxyz -t @@1984
    cewl -d 0 -m 8 https://en.wikipedia.org/wiki/Donald_Trump
  3. Run GUI tools in Docker using SSH and X11 forwarding

    master

    Since Docker containers do not have an X11 server by default, you can run GUI tools by using SSH X11 forwarding.

    Requirements:

    • Linux: Likely already has X11.
    • macOS: Requires Xquartz (brew install Xquartz).
    • Windows: Not natively supported via this method.

    Steps:

    1. Start the container and expose port 22: docker run -it --rm -p 127.0.0.1:22:22 dominicbreuker/stego-toolkit /bin/bash.
    2. Inside the container, run start_ssh.sh (the script will print a password).
    3. From your host machine, connect using SSH with the -X flag to enable X11 forwarding.
    # in 1st host shell
    docker run -it --rm -p 127.0.0.1:22:22 dominicbreuker/stego-toolkit /bin/bash
    
    # inside container shell
    start_ssh.sh
    
    # in 2nd host shell (use it to launch GUI apps afterwards)
    ssh -X -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no root@localhost
  4. Automate screening with screening scripts

    master

    You can automate workflows using pre-built scripts for specific file types. There are two types of scripts:

    • XXX_check.sh <stego-file>: Runs basic screening tools and generates a report.
    • XXX_brute.sh <stego-file> <wordlist>: Attempts to extract messages using a wordlist and various tools.

    Supported File Types:

    • JPG:
      • check_jpg.sh (Note: source says .h, likely .sh)
      • brute_jpg.sh (Runs steghide, outguess, outguess-0.13, stegbreak, and stegoveritas.py -bruteLSB)
    • PNG:
      • check_png.sh
      • brute_png.sh (Runs openstego and stegoveritas.py -bruteLSB)
  5. Hide and recover data using steganography tools

    master

    A selection of tools for embedding and extracting messages. Note that some require passwords.

    Audio

    • AudioStego (MP3/WAV):
      • Hide: hideme cover.mp3 secret.txt && mv ./output.mp3 stego.mp3
      • Recover: hideme stego.mp3 -f && cat output.txt
    • mp3stego (MP3): Requires WAV input. Use absolute paths.
      • Hide: mp3stego-encode -E secret.txt -P password /path/to/cover.wav /path/to/stego.mp3
      • Recover: mp3stego-decode -X -P password /path/to/stego.mp3 /path/to/out.pcm /path/to/out.txt

    Images

    • jphide/jpseek (JPG):
      • Hide: jphide cover.jpg stego.jpg secret.txt
      • Recover: jpseek stego.jpg output.txt
    • jsteg (JPG): LSB stego (no encryption).
      • Hide: jsteg hide cover.jpg secret.txt stego.jpg
      • Recover: jsteg reveal cover.jpg output.txt
    • openstego (PNG):
      • Hide: openstego embed -mf secret.txt -cf cover.png -p password -sf stego.png
      • Recover: openstego extract -sf openstego.png -p abcd -xf output.txt
    • outguess (JPG):
      • Hide: outguess -k password -d secret.txt cover.jpg stego.jpg
      • Recover: outguess -r -k password stego.jpg output.txt
    • stegano (PNG):
      • Hide (LSB): stegano-lsb hide --input cover.jpg -f secret.txt -e UTF-8 --output stego.png
      • Recover (LSB): stegano-lsb reveal -i stego.png -e UTF-8 -o output.txt
    • Steghide (JPG, BMP, WAV, AU):
      • Hide: steghide embed -f -ef secret.txt -cf cover.jpg -p password -sf stego.jpg
      • Recover: steghide extract -sf stego.jpg -p password -xf output.txt
    • cloackedpixel (PNG):
      • Hide: cloackedpixel hide cover.jpg secret.txt password
      • Recover: cloackedpixel extract cover.jpg-stego.png output.txt password
    • LSBSteg (PNG, BMP):
      • Hide: LSBSteg encode -i cover.png -o stego.png -f secret.txt
      • Recover: LSBSteg decode -i stego.png -o output.txt
    • f5 (JPG):
      • Hide: f5 -t e -i cover.jpg -o stego.jpg -d 'secret message'
      • Recover: f5 -t x -i stego.jpg 1> output.txt
    • stegpy (PNG, GIF, BMP, WebP, WAV):
      • Hide: stegpy secret.jpg cover.png
      • Recover: stegpy _cover.png
  6. Detect steganography using statistical tools

    master

    Use these tools to perform statistical tests to find irregularities that suggest hidden messages:

    • stegoveritas.py: Performs a wide variety of checks on JPG, PNG, GIF, TIFF, and BMP. Runs LSB brute force and creates transformed images.
    • zsteg: Detects LSB steganography in PNG and BMP files.
    • stegdetect: Performs statistical tests on JPG files to identify specific tools (jsteg, outguess, jphide, etc.).
    • stegbreak: Brute force cracker for JPG images (supports outguess, jphide, and jsteg).
    stegoveritas.py stego.jpg
    zsteg -a stego.jpg
    stegdetect stego.jpg
    stegbreak -t o -f wordlist.txt stego.jpg
  7. Access GUI tools in the container

    master

    To use graphical user interface (GUI) tools within the container, you can use one of the following two methods:

    1. X11 Forwarding: Run start_ssh.sh and connect to your container using X11 forwarding.
    2. VNC/Browser: Run start_vnc.sh and connect to the container's desktop environment directly through your web browser.
  8. Access Steganography GUI tools via VNC or SSH

    master

    GUI tools cannot be used directly via the command line. To use them inside the container, you must provide an X11 interface:

    1. VNC (Recommended): Run start_vnc.sh. Connect via your browser to port 6901 to access an Xfce desktop. This has no host dependencies.
    2. SSH: Run start_ssh.sh. Connect using X11 forwarding. This requires an X11 server installed on your host machine.

    Supported GUI tools include steg, steganabara, stegsolve, sonic-visualiser, stegosuite, openpuff, deepsound, and cloackedpixel-analyse.

  9. Run the Steganography Toolkit via Docker

    master

    The toolkit is provided as a Docker image pre-installed with steganography tools and screening scripts. You can run it using the provided helper scripts or standard Docker commands.

    Using helper scripts

    If you have cloned the repository, use the provided shell scripts to build and run the container:

    1. Build the image: bin/build.sh
    2. Run the container: bin/run.sh

    This will drop you into a bash shell inside the container with a data folder mounted. Place the files you want to analyze into this data folder on your host machine.

    Using standard Docker commands

    If you do not want to use the helper scripts, follow these steps:

    1. Build the image: docker build -t <image_name> . or pull it from Docker Hub: docker pull dominicbreuker/stego-toolkit
    2. Start a container and mount your local files to the /data directory: docker run -it <image_name> -v /local/folder/with/data:/data /bin/bash
    3. Use the CLI tools and screening scripts on your files inside the container.
    docker run -it --rm -v $(pwd)/data:/data dominicbreuker/stego-toolkit /bin/bash
  10. Run GUI tools in Docker using Browser and VNC (noX11)

    master

    To avoid X11 dependencies, you can use the built-in TigerVNC server and noVNC client to access the container's Xfce desktop via an HTML5 VNC session in your web browser.

    Steps:

    1. Start the container and expose port 6901: docker run -it --rm -p 127.0.0.1:6901:6901 dominicbreuker/stego-toolkit /bin/bash.
    2. Inside the container, run start_vnc.sh (the script will print a password).
    3. Open your browser and navigate to http://localhost:6901/?password=<password_from_start_vnc>.
    # in 1st host shell
    docker run -it --rm -p 127.0.0.1:6901:6901 dominicbreuker/stego-toolkit /bin/bash
    
    # inside container shell
    start_vnc.sh
    
    # in browser, connect with: http://localhost:6901/?password=<password_from_start_vnc>