HashCheck is a project aims to assist in the search for leaked passwords while maintaining a high level of privacy using the k-anonymity method.
To achieve this, the APIs of different services are used, sending only a part of the Hash of the password we want to check, for example, the first 5 characters.
Prerequisites
The project needs some libraries in order to work, to install it use the next command:
pip install -r requirements
Remember that Python 3 is required.
Usage
passme.py [FUNC] [ELEMENT] -engine [ENGINE] -api_key [API_KEY]
FUNC: The kind of element tha you want to check, it can be -h/–hash or -p/–password
or -f/–file or -l/–list or –help.
ELEMENT: The “Hash”, “Password” or the name of the file that contains a list of
hashes or password separeted by a new line.
ENGINE: The leaks engine that you want to be used, by default it uses HIBP (Have I been PWN).
API_KEY: The API_KEY necessary for some functions of some engines.
Functions
PASSME_HASH
The main project function receives the hashed password, the engine to be used and the API key.
Depending on the engine that is received, both the API key and the hashed password will be sent to one function or another.
If you want to add your own engine or an engine that is not already implemented, simply add one more option here.
passme_hash(hashed_password, engine=”HIBP”, api_key=”0″)
PASSME_PASSWORD
This function hashes the password it receives using SHA-1 and sends the hash to the passme_hash() function.
passme_password(password, engine=”HIBP”, api_key=”0″)
PASSME_FILE
This function reads one by one the lines of the received file to check each password, giving information about the received password and whether it has been filtered or not.
passme_file(filename, engine=”HIBP”, api_key=”0″)
PASSME_LIST
This function reads one by one the lines of the received file to check each hash, giving information about the received hash and whether it has been filtered or not.
passme_list(filename, engine=”HIBP”, api_key=”0″)
PASSME_LIST
The function that deals with the HIBP (Have i been pwned) API, sends the first five characters of the hash, then compares it with the full hash to see if the password/hash has been leaked.
engine_HIBP(hashed_password, engine, api_key)
Test
This project has a series of tests to check the correct operation of all its functions, for this purpose the “pytest” library has been used. To run the tests, install pytest with the following command:
pip install pytest
Once installed, simply run the “pytest” command to have the tests run automatically, any errors encountered will be returned by the terminal.
The results of the test in the lab are the following:
| Python Version | Function Hash | Function List | Function Password | RANDOM Hash | RANDOM Password | Comment |
|---|---|---|---|---|---|---|
| 3.9 | ✅ | ✅ | ✅ | ✅ | ✅ | |
| 3.8 | ✅ | ✅ | ✅ | ✅ | ✅ | |
| 3.7 | ✅ | ✅ | ✅ | ✅ | ✅ | |
| 3.6 | ✅ | ✅ | ✅ | ✅ | ✅ | |
| 3.5 | ✅ | ✅ | ✅ | ❌ | ❌ | Random.choice is not available in Python 3.5 // Deprecated Python Version |
phpMyAdmin is a free, open-source PHP application that provides a browser-based interface for managing MySQL and…
Zabbix is a mature open-source infrastructure monitoring platform that collects metrics from network devices, servers, virtual…
Gradle is a powerful open-source build automation tool used primarily for Java, Kotlin, Groovy, and Android…
TeamViewer is a proprietary cross-platform remote access application for remote control, desktop sharing, file transfer, and online meetings. It is one of the most widely used remote support tools in the world, available for Windows, macOS, Linux, iOS, and Android. TeamViewer is not included in the Ubuntu repositories because it is proprietary software. This guide covers how to install TeamViewer on Ubuntu 18.04 using the official .deb package. The same steps apply to Ubuntu 16.04, Debian, Linux Mint, and Elementary OS. <strong>Prerequisite:</strong> You need sudo access. Install TeamViewer on Ubuntu: Download the .deb Package Download the official TeamViewer .deb package. The _amd64.deb suffix indicates this package is for 64-bit x86-64 systems. For ARM-based machines, download the appropriate package from the TeamViewer Linux downloads page: bashwget https://download.teamviewer.com/download/linux/teamviewer_amd64.deb Install the package using apt. The ./ prefix tells apt this is a local file path, not a package name from the repositories:…
Nagios is one of the most widely used open-source infrastructure monitoring systems in the world. It…
Laravel is an open-source PHP web application framework built around an expressive, developer-friendly syntax. It is…