Coder Social home page Coder Social logo

hashpals / search-that-hash Goto Github PK

View Code? Open in Web Editor NEW
1.2K 21.0 91.0 3.59 MB

🔎Searches Hash APIs to crack your hash quickly🔎 If hash is not found, automatically pipes into HashCat⚡

License: GNU General Public License v3.0

Python 100.00%
hash hashcat john cracks hacking hacking-tool infosec tool cybersecurity

search-that-hash's Introduction

➡️ Discord ⬅️

Discord

The Fastest Hash Cracking System
pip3 install search-that-hash && sth

🤔 Overview

Tired of going to every website to crack your hash? Search-That-Hash automates this process in less than 2 seconds. Search-That-Hash searches the most popular hash cracking sites and automatically inputs your hash(s) for cracking

🔍 Features

  • ⌨️ Auto-Type Identification - No need to know the hash type, Search-That-Hash uses Name-That-Hash to get accurate results on the type of the hash.
  • 📵 Offline Mode - Not connected to the internet? No worries, Search-That-Hash will automatically run Hashcat for you.
  • 💨 Fast - We're all busy people and that's why we've dedicated time to make Search-That-Hash as fast as possible.
  • 🦾 JSON API - As well as JSON output for CLI we also offer an API.
  • ♿ Accessible - We are 100% Accessible.
  • 🎫 Extensible - Adding sites to Search-That-Hash is as easy as printing "hello world" !
  • 🌈 Beautiful - The colours were hand-selected to be as gnarly and accessible as possible .
  • ☮️ Ethical - We search hashes ethically and legally.

📴 Offline Mode

Couldn't find it in any API? 😢 STH automatically pipes your input into Hashcat 🥳

Make sure to specify a wordlist if you want STH to use HashCat with -w /path/to/wordlist. If you are on Windows you must specify the path to your HashCat binary and folder in config.json 🙂

🔨 Installation

Install Search-That-Hash as fast as you can read this README. No, seriously -- it's that easy 😎

pip3 install search-that-hash

or:

pip install search-that-hash

then:

sth

To run.

Note: We can't guarantee all of the APIs provide perfect privacy due to being closed source. If you need to crack sensitive, personal information please use the offline mode or Hashcat directly.

👪 Project Family

Like Search-That-Hash? We have 2 other projects you'll love!

Project Family
Name-That-Hash Ciphey

Instantly identify what type of hash it is. With support for over 300 hashes, descriptions and popularity ratings! Automatically decrypt ciphers, decode encodings, crack hashes, and more. Not sure what the text is? Use this!

🎥 Demos

Greppable mode

✨ Google Colab

We now have support for running STH on google colab for faster hashcat cracking, no need to worry about running hashcat on your machine anymore! Many thanks to Drago for making this :-)

https://github.com/vaishnavpardhi/colabsth/

📖 Documentation

Want to know how everything works?

Or maybe want to use the API!

Thats why we have documentation!

📚 Documentation 🐦 My Twitter (@ me for questions) 🎳 Discord
Wiki JaySec Discord

✍️ Contributing

We would love any contributions to search-that-hash, thats why we've made it as simple and as easy as we can to contribute! Simply follow the docs on "Contributing" 😇

❤️ Final thanks

Thank you so much to Bee who pretty much mentored me the whole way through this process and never failed to provide help and great resources for me to learn, carry on the great work! :)

Thank you also to Fawaz for the amazing website! 🚧

......And to Jabba & Skeletal for helping out with some of the code 💻

Thank you to the TryHackMe community, they taught me so much in infosec and its a pleasure being part of it!

Lastly, this project was inspired by Hashbuster so thank you for the work!

search-that-hash's People

Contributors

amadejpapez avatar bee-san avatar branchvincent avatar dependabot-preview[bot] avatar dependabot[bot] avatar imgbot[bot] avatar imgbotapp avatar jabbasec avatar jayssnippets avatar jayy001 avatar skeletaldemise 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  avatar  avatar  avatar  avatar  avatar

search-that-hash's Issues

Unverified hahses

The APi can return something unverified, such as this:

image

NTH should ask the user "This is unverified (we can't prove that the hash == this plaintext). We can continue searching if you want? Y/N".

Detect if the user has been temporarily banned from a third-party website/API and display it

Some of the third-party website/APIs will temporarily ban your IP from inputting too many hashes in a day. STH should display this when it finds an error from a third-party website/API related to this.

An example is https://www.cmd5.org/, when it temporarily bans you it will output Please log in ! whenever you try to search any hash. STH should catch that error and say to the user that they were temporarily banned from that certain website.

Error on certain hash input

sth -t "E4F070309AC20334B70C5EA9268CE4FC6438202D"
Traceback (most recent call last):
  File "c:\users\redacted\miniconda3\lib\runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "c:\users\redacted\miniconda3\lib\runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "C:\Users\redacted\miniconda3\Scripts\sth.exe\__main__.py", line 7, in <module>
  File "c:\users\redacted\miniconda3\lib\site-packages\click\core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "c:\users\redacted\miniconda3\lib\site-packages\click\core.py", line 782, in main
    rv = self.invoke(ctx)
  File "c:\users\redacted\miniconda3\lib\site-packages\click\core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "c:\users\redacted\miniconda3\lib\site-packages\click\core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "c:\users\redacted\miniconda3\lib\site-packages\search_that_hash\__main__.py", line 83, in main
    cracking_handler.start()
  File "c:\users\redacted\miniconda3\lib\site-packages\search_that_hash\cracker\handler.py", line 31, in start
    return self.fast.fast_crack()
  File "c:\users\redacted\miniconda3\lib\site-packages\search_that_hash\cracker\fast_mode_mod\runner.py", line 24, in fast_crack
    self.results.extend(results)
TypeError: 'NoneType' object is not iterable```

Breaks on file input

❯ sth -vvv -g -f hash.txt
2021-02-28 10:45:25 Saturnus root[9275] DEBUG Updated logging level
2021-02-28 10:45:25 Saturnus root[9275] INFO Called config updater
2021-02-28 10:45:25 Saturnus root[9275] DEBUG Hashes are from file
2021-02-28 10:45:25 Saturnus root[9275] DEBUG Called NTH to get hash types
2021-02-28 10:45:25 Saturnus root[9275] INFO Returning config
2021-02-28 10:45:25 Saturnus urllib3.connectionpool[9275] DEBUG Starting new HTTPS connection (1): av5b81zg3k.execute-api.us-east-2.amazonaws.com:443
2021-02-28 10:45:26 Saturnus urllib3.connectionpool[9275] DEBUG https://av5b81zg3k.execute-api.us-east-2.amazonaws.com:443 "GET /prod/lookup HTTP/1.1" 200 907
Traceback (most recent call last):
  File "/home/hydra/.local/bin/sth", line 8, in <module>
    sys.exit(main())
  File "/home/hydra/.local/lib/python3.9/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/home/hydra/.local/lib/python3.9/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/home/hydra/.local/lib/python3.9/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/hydra/.local/lib/python3.9/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/home/hydra/.local/lib/python3.9/site-packages/search_that_hash/__main__.py", line 89, in main
    cracking_handler = handler.Handler(config)
  File "/home/hydra/.local/lib/python3.9/site-packages/search_that_hash/cracker/handler.py", line 21, in __init__
    self.sth_results, self.config = sth.Sth_api.crack(self, config)
  File "/home/hydra/.local/lib/python3.9/site-packages/search_that_hash/cracker/sth_mod/sth.py", line 27, in crack
    output = response.json()["body"]
KeyError: 'body'

Where

❯ cat hash.txt
$2b$12$SVInH5XmuS3C7eQkmqa6UOM6sDIuumJPrvuiTr.Lbz3GCcUqdf.z6

Function `perform_search` in `cracking.py` is doing too many things

The function is:

  • Running STH
  • Printing the output or appending it to greppable
  • Running all other APIs
  • printing the output or appending to greppable

It should look like this (imo):

  • Multi-thread called STH (note: store all found hashes for printing + greppable in one variable), if not greppable and if not all hashes to search have not been found in STH return to main()
  • In main print all that's found so far
  • multi-thread run all other APIs (a 2nd time).
  • Return to main with the one output variable
  • Either call Greppable or pretty print it depending on user args

Let the user decide which hash to crack

Assuming that hashcat cracking is very slow, present the user with an interface like:

  1. Bcrypt
  2. Sha256
  3. sha512

And let the user select which one to try first. Don't show this in greppable mode.

greppable not working

Installed sth via pip
Command used to test:

  1. sth -t 279412f945939ba78ce0758d3fd83daa
  2. sth -t 279412f945939ba78ce0758d3fd83daa --greppable

I've attached a screenshot that will explain the issue! :)

image

READTIMEOUT in STH fails

config = {'api': True, 'api_keys': {'STH': None}, 'greppable': True, 'hashcat': False, ...}

    def crack(config):
        to_del = []
        url = "https://av5b81zg3k.execute-api.us-east-2.amazonaws.com/prod/lookup"
        payload = json.dumps({"Hash": list(config["hashes"].keys())})
        headers = {"Content-Type": "application/json"}
    
        try:
            response = requests.request(
                "GET", url, headers=headers, data=payload, timeout=config["timeout"]
            )
>       except ReadTimeout:
E       NameError: name 'ReadTimeout' is not defined

search_that_hash/cracker/sth_mod/sth.py:23: NameError

Also, set it to 3 seconds -- 2 seconds seems to be breaking it :)

Nitrxgen doesn't work

http://www.nitrxgen.net/md5db/ is one of the third-party website/APIs and it currently doesn't work in STH. It works when visiting the URL in the browser, but it always says Failed when running STH. Run sth -t "5f4dcc3b5aa765d61d8327deb882cf99" --greppable for an example.

Fix amazon DB

Currently, some of the hashcat command outputs are being directed to the amazon DB. We need to make sure it doesn't get mixed up.

Use of optimised kernels

By default, the script uses the unoptimised kernels, by adding -O to:

command = f"cd {config['hashcat_folder']} && {config['hashcat_exe_name']} -a 0 -m {possible_type} {hash_formatted} {config['wordlist']}"

It should get an easy and free speed increase with the only draw back of a slightly reduced max plain length, typically from 255 to 32 characters

> hashcat -m 0 -w 4 -b --quiet
Hashmode: 0 - MD5

Speed.#1.........:  4996.0 MH/s (170.43ms) @ Accel:64 Loops:1024 Thr:1024 Vec:1

> hashcat -m 0 -w 4 -b --quiet -O
Hashmode: 0 - MD5

Speed.#1.........:  9154.5 MH/s (90.30ms) @ Accel:64 Loops:1024 Thr:1024 Vec:1

[Cracking bcrypt hash] None: No such file or directory

Hi,

Came across the script on reddit, was trying to crack hash from HTB's delivery machine. Just before it proceeds there's an error saying None: No such file or directory

image


On Phonebook's web challenge:

image


Tested on Pop! OS 20.04 LTS:

┌──(umar_0x01@b0x)-[~/HTB]
└─$ cat /etc/*release
DISTRIB_ID=Pop
DISTRIB_RELEASE=20.04
DISTRIB_CODENAME=focal
DISTRIB_DESCRIPTION="Pop!_OS 20.04 LTS"
NAME="Pop!_OS"
VERSION="20.04 LTS"
ID=pop
ID_LIKE="ubuntu debian"
PRETTY_NAME="Pop!_OS 20.04 LTS"
VERSION_ID="20.04"
HOME_URL="https://pop.system76.com"
SUPPORT_URL="https://support.system76.com"
BUG_REPORT_URL="https://github.com/pop-os/pop/issues"
PRIVACY_POLICY_URL="https://system76.com/privacy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
LOGO=distributor-logo-pop-os

Let me know if you need more details, the hashes, or if it's an error on my side.

Thanks!

Manual type inputs

Most databases use a single type of hash, if we manually input that single type we can search all hash APIs for that type and then just crack that one type :)

Fix nitrgxen for the PyPi version

PyPi either doesn't include the .pem file with it, or something else is going wrong. We need to fix it so nitrxgen works with it.

Automatically rate limit requests made to third-party website/APIs

STH should automatically rate limit requests made to third-party website/APIs so ideally #67 doesn't happen. For example http://md5.my-addr.com says Using of our online md5 database is limited in time with 15-20 requests, otherwise IP will be blocked permanently. on their site. STH should not make a request if the rate limit has been reached for a specific website/API.

Windows Errors

If you want to use hashcat on windows you have to specify the PATH of where the hashcat binary is located,

Also, for the wordlist, we need to make it OS dependant as windows uses \ not /

ToDo

  • Offliine mode
  • Accessible Mode
  • Typehints
  • Comments
  • Documentation
  • Possible Google search?
  • Documentation on adding APIS <---- VERY IMPORTANT
  • Exit when an API returns True
  • Colour scheme
  • Design README
  • Import Name-That-Hash and use it
  • Release on PyPi
  • Create Setuptools to release on AUR
  • Make it as an API <---- VERY IMPORTANT (writing tests will help with this)
  • Writie Tests
  • Create GitHub action to run tests

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.