Giter Club home page Giter Club logo

stegseek's Introduction

⚡ Stegseek

Stegseek is a lightning fast steghide cracker that can be used to extract hidden data from files. It is built as a fork of the original steghide project and, as a result, it is thousands of times faster than other crackers and can run through the entirety of rockyou.txt* in under 2 seconds.

Stegseek can also be used to extract steghide metadata without a password, which can be used to test whether a file contains steghide data.

* rockyou.txt is a well-known password list with over 14 million passwords.

Demo: random rockyou.txt password (in real time)

Skip ahead to Performance for some raw numbers.

🔧 Installation

The following instructions walk you through the installation process. Alternatively, you can run Stegseek in a Docker container. Skip ahead to Docker for instructions.

Releases

Linux

On recent Ubuntu and other Debian-based systems, you can use the provided .deb package for installation:

  1. Download the latest Stegseek release
  2. Install the .deb file using sudo apt install ./stegseek_0.6-1.deb

On other systems you will have to build Stegseek yourself. See BUILD.md for more information.

Windows

Building Stegseek as a native Windows app is sadly not supported. Instead you should run Stegseek using WSL. The Ubuntu WSL distribution is recommended for optimal compatibility.
Once you have configured WSL, Stegseek can be installed using the above Linux instructions.

By default, WSL mounts the C:\ drive at /mnt/c/, which you can use to easily access your files.

▶️ Using Stegseek

Cracking

The most important feature of stegseek is wordlist cracking:

stegseek [stegofile.jpg] [wordlist.txt]

This mode will simply try all passwords in the provided wordlist against the provided stegofile.

Detection and passwordless extraction (CVE-2021-27211)

Stegseek can also be used to detect and extract any unencrypted (meta) data from a steghide image. This exploits the fact that the random number generator used in steghide only has 2^32 possible seeds, which can be bruteforced in a matter of minutes.

stegseek --seed [stegofile.jpg]

This command will tell you:

  • Whether this file actually contains steghide content.
  • How much hidden content the file contains.
  • How the content was encrypted .

If you're (very) lucky and the file was encoded without encryption, this mode will even recover the encoded file for you!

The below demo features a challenge from X-MAS CTF 2020. A flag was hidden using a secure random password, but without encryption enabled. Within a few minutes, Stegseek is able to recover the embedded file without needing to guess the correct password.

Available arguments

Use stegseek --help to get the full list of available options:

=== StegSeek Help ===
To crack a stegofile:
stegseek [stegofile.jpg] [wordlist.txt]

Commands:
 --crack                 Crack a stego file using a wordlist. This is the default mode.
 --seed                  Crack a stego file by attempting all embedding patterns.
                         This mode can be used to detect a file encoded by steghide.
                         In case the file was encoded without encryption, this mode will
                         even recover the embedded file.
Positional arguments:
 --crack [stegofile.jpg] [wordlist.txt] [output.txt]
 --seed  [stegofile.jpg] [output.txt]

Keyword arguments:
 -sf, --stegofile        select stego file
 -wl, --wordlist         select the wordlist file
 -xf, --extractfile      select file name for extracted data
 -t, --threads           set the number of threads. Defaults to the number of cores.
 -f, --force             overwrite existing files
 -v, --verbose           display detailed information
 -q, --quiet             hide performance metrics (can improve performance)
 -s, --skipdefault       don't add guesses to the wordlist (empty password, filename, ...)
 -n, --nocolor           disable colors in output
 -c, --continue          continue cracking after a result has been found.
                         (A stego file might contain multiple embedded files)
 -a, --accessible        simplify the output to be more screen reader friendly

Use "stegseek --help -v" to include steghide's help.

Steghide

Stegseek includes nearly all of steghide's functionality, so it can also be used to embed or extract data as normal. The only catch is that commands must use the --command format.
For example, steghide embed [...] becomes stegseek --embed [...] .

Positional arguments

  • stegseek --embed <data> <coverfile> [<stegofile>]
  • stegseek --extract <stegofile> [<output>]

🐳 Docker

You can also run Stegseek as Docker container:

docker run --rm -it -v "$(pwd):/steg" rickdejager/stegseek [stegofile.jpg] [wordlist.txt]

This does require that the wordlist and stegofile are located in current working directory, as that folder is mounted to /steg inside of the container.

📈 Performance

This is where Stegseek really shines. As promised, let's start with the "rockyou.txt in just 2 seconds" claim.
All of these numbers are measured on a laptop with an Intel i7-7700HQ CPU @ 2.80GHz and 8 GB of RAM.

RockYou.txt

I picked the last password in rockyou.txt without control characters: "␣␣␣␣␣␣␣1" (7 spaces followed by '1').
This password is on line 14344383 out of 14344391

> StegSeek 0.6 - https://github.com/RickdeJager/StegSeek

[i] Found passphrase: "       1"          
[i] Original filename: "secret.txt".
[i] Extracting to "7spaces1.jpg.out".


real	0m1,211s
user	0m9,488s
sys	0m0,084s

And there it is, over 14 million passwords in less than 2 seconds 😍.

How does this compare to other tools?

To test the performance of of other tools, I created several stego files with different passwords, taken from rockyou.txt. I ran each of the tools with their default settings, except Stegbrute where I increased threading for a fair comparison.

password Line Stegseek v0.6 Stegcracker 2.0.9 Stegbrute v0.1.1 (-t 8)
"cassandra" 1 000 0.05s 3.1s 0.7s
"kupal" 10 000 0.05s 14.4s 7.1s
"sagar" 100 000 0.09s 2m23.0s 1m21.9s
"budakid1" 1 000 000 0.73s [p] 23m50.0s 13m45.7s
"␣␣␣␣␣␣␣1" 14 344 383 1.21s [p] 5h41m52.5s [p] 3h17m38.0s

[p] = projected time based on previous results.


To compare the speed of each tool, let's look at the last row of the table (otherwise Stegseek finishes before all threads have started).

At this scale Stegseek is over 12 000 times faster than Stegcracker and over 7000 times faster than Stegbrute.

📓 Changelog

v0.6

2021-04-18
improvements:

  • Fixed BMP cracking for files with a large palette.
  • Added a --continue flag to search for multiple hidden files.
  • Added an --accessible flag to make the CLI more screen reader friendly
  • Made the CLI more consistent, added colors.
  • --crack and --seed now throw proper exit codes for easier scripting.
  • Lower performance overhead for metrics.
  • fixed compiler flags for default build.

v0.5

2020-12-28
improvements:

  • Uses way less memory (memory usage is no longer tied to Wordlist length)
  • Wordlist is loaded on the fly, so we can start cracking immediately.
  • Fixed high false positive rate on --seed

v0.4

2020-12-01
improvements:

  • Added seed cracking to allow for passwordless data extraction
  • Overhauled parser to allow for positional arguments
  • cracks rockyou.txt in 2 seconds

v0.4.1

2020-12-23
Fixed a bug where stegseek would fail to find a password on rare occasions.

v0.3

2020-11-08
improvements:

  • Made threading lock-free s.t. multiple threads are used more efficiently
  • Added -xf argument to --crack, used to specify the location of the extracted file
  • Made the .deb package compatible with Debian/Kali
  • cracks rockyou.txt in 4 seconds

v0.2

2020-11-05
improvements:

  • Give up on a passphrase once a single bit of the magic fails to decode
  • Removed costly BitString / EmbData allocations
  • Improved performance of the selector
  • cracks rockyou.txt in 5 seconds.

v0.1

2020-11-04
Initial release, features:

  • Only loads the stego file once, unlike conventional crackers
  • Workpool based threading
  • Attempts to crack the first 3 bytes first, before attempting full decryption
  • Added .deb package and docker container
  • cracks rockyou.txt in 41 seconds.

stegseek's People

Contributors

fvcr avatar kenohassler avatar rickdejager avatar stefanodevuono avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

stegseek's Issues

Fatal Error: mcrypt.h - no such file or directory

(haze㉿kali)-[~/hacking/stegseek/build]
└─$ make
[ 1%] Building CXX object src/CMakeFiles/stegseek_lib.dir/Arg.cc.o
[ 2%] Building CXX object src/CMakeFiles/stegseek_lib.dir/Arguments.cc.o
In file included from /home/haze/hacking/stegseek/src/Arguments.cc:31:
/home/haze/hacking/stegseek/src/MCryptPP.h:28:10: fatal error: mcrypt.h: No such file or directory
28 | #include <mcrypt.h>
| ^~~~~~~~~~
compilation terminated.
make[2]: *** [src/CMakeFiles/stegseek_lib.dir/build.make:90: src/CMakeFiles/stegseek_lib.dir/Arguments.cc.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:118: src/CMakeFiles/stegseek_lib.dir/all] Error 2
make: *** [Makefile:146: all] Error 2

[PROPOSAL] - StegSeek in BlackArch repository

Hello @RickdeJager
StegSeek is a wonderful tool. Why don't you insert it inside BlackArch repo in order to be retrieved very quickly by pacman -Syy stegseek?

If you need support, I can create for you the PKGBUILD to be submitted on BlackArch repo.

Thanks!

If you are a mac user, you should read this.

Building from source, use mac ports to install packages, with homebrew there are some linking errors, but mac ports automatically handles it, so errors are not there with mac ports

[v] Added password guess: "flag.jpg".

изображение
hello! great tool. i have this error, i checked rockyou on sha256, its correct. why this error happening?

Or maybe it should work like that, idunno?

error: Could Not Find a Valid Seed

I'm trying to use StegSeek to crack the attached image, but it can't find a valid seed, and none of the wordlists I've used can valid passcodes.

Is it possible the image is a different type of steg
hidden
?

error: could not open file "[filename.png]"

I'm confident I'm doing something wrong here but, I'm trying to crack an image from a riddle.... I followed instructions with Powershell/Ubuntu and have the stegseek build running. when i try to crack the filename i get that error message. im new to all this and your build was my first so bare with me.

Don't stop on first result

A steghide file may be encoded multiple times with different passwords. In this case StegSeek will always exit on the first hit.

This is even more relevant for seed cracking, where you may encounter a false positive, causing the program to exit.

arm64 support

First of all awesome tool! Is arm64 support on the roadmap? It would be awesome to be able to run this on a M1 Mac.

Feature request

Requesting for a feature to crack passwords of all compatible files in a directory to avoid the use of scripts

Apple M1 CPU support

As a user, I would like to run on M1 mac without this error

docker run --rm -it -v "$(pwd):/steg" rickdejager/stegseek finalClue.png
...
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
StegSeek 0.6 - https://github.com/RickdeJager/StegSeek

Custom extractor fails on BMP (Possibly other formats as well?)

The custom extractor appears to return false negatives on (certain) BMP files. In a nutshell, this causes stegseek to dismiss valid seeds/passwords for these filetypes.

The "normal" password extractor that came with steghide's code still works, so this appears to be an issue related to my changes.

Output file location doesn't use stripdir

When cracking a file in a different directory, the output file will be written to that directory as well, rather than the current directory.

  1. place a stego file in a subdir (data/steg.jpg)
  2. call stegcracker --crack -sf data/steg.jpg -wl someWordList.txt
  3. Output is placed in data/steg.jpg.out rather than steg.jpg.out

⚡ Now that's a fast steghide cracker

Hi! Just popping by to say say I'm genuinely impressed at the speed of StegSeek as opposed to StegCracker, nice job!
As your tool puts all others to shame I'll officially be retiring StegCracker and passing on the torch to you 🔥

Happy holidays! 🎅

make issue

I wanted to install the tool on the latest Ubuntu desktop but I got these errors:

kép

Can someone help me how to solve it?

StegSeek for arm64

dpkg: error processing archive stegseek_0.6-1.deb (--install):
package architecture (amd64) does not match system (arm64)
Errors were encountered while processing:
stegseek_0.6-1.deb

custom wordlist issues

I am currently trying to crack this image, but stegseek could not find a valid seed and rockyou.txt did not have the password. I have an idea of what the password could be, but I do not know the format necessary for a custom word list.

steg1

std::bad_alloc when trying to crack file

I am on Kali, I am trying to crack a bmp image that has an embedded txt, but every time i run the command to crack I get -

terminate called after throwing an instance of 'std::bad_alloc'
what(): std::bad_alloc
zsh: abort

I have no idea what to do with this, any help?

Another feature request

Hey, so first and foremost: I absolutely love this program. The speed of it genuinely surprised me and honestly I think I'll use this for the foreseeable future.

Though one thing that gets my attention would be in regards to cracking the seed of a steg file. I'm only now starting to look at the source code so I could be wrong, but is there any way for the encrypted data to also be outputted aswell? That way, someone could use a program like hashcat to crack it (assuming they want to use brute force rather than a wordlist obviously, or maybe something entirely different for that matter.)

Again, this could very well not be possible, but it was just an idea I had considering unencrypted data was able to be successfully parsed and dumped.

Cheers! And thank you again :)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.