This is a basic password cracker written in Python. It uses a wordlist to perform a brute-force attack to check if a given password is a common or leaked password.
- Python 3.x
- Icecream library (for debugging)
- Install Python 3.x from python.org.
- Install the required library using pip:
pip install icecream
Run the script with the following command:
python main.py
You will be prompted to input a password. The script will then check if the password is in the wordlist.
python main.py
input password here: password123
hashlib
: Provides hashing algorithms.
urllib.request
: Used to fetch the wordlist from a URL.icecream
: A library for debugging.
read_word_list(url)
Fetches the wordlist from the specified URL and returns it.
hash(word_list_password)
Hashes a password using the SHA-1 algorithm and returns the hexadecimal digest.
bruteforce(guess_password_list, actual_password_hash)
Iterates through the password list to check if the inputted password matches any item in the wordlist. If a match is found, it prints the matched password and exits the program.
- Defines the URL of the wordlist file.
- Prompts the user to input a password.
- Hashes the inputted password.
- Reads the wordlist from the URL and splits it into individual passwords.
- Calls the bruteforce function to check if the password is in the wordlist. 6. Prints a message if the password could not be found in the wordlist.
The wordlist used in this script is fetched from the following URL: Top12Thousand-probable-v2.txt