But before we dive into that, let me tell you a little story.
Once upon a time, I was bored as hell and decided to try my luck at cracking some hashed passwords. Now, if you’re new to this game, let me explain what hashcat is all about. Hashcat is a tool used for cracking passwords by guessing the correct one based on its hash value. It works like this:
1. You have a list of hashed passwords (let’s call it “hashes”). 2. You have a dictionary or wordlist containing potential passwords (let’s call it “dictionary”). 3. Hashcat takes each hash from the first list and compares it to every single word in the second list, calculating their respective hashes. If they match, you’ve found your password!
Now, let me introduce our two heroes oclHashcat-plus and John the Ripper. Both of them are open source tools that can crack passwords using different methods. Let’s see how we can use them to crack some hashed passwords.
To start, you need to download both tools from their respective websites (https://hashcat.net/ and https://www.openwall.com/john/) and install them on your machine. Once they’re installed, let’s get started!
Let’s say we have a list of hashed passwords called “hashes” in the current directory. We also have a dictionary called “dictionary”. Here’s how you can use oclHashcat-plus to crack them:
1. Open your terminal and navigate to the directory where both tools are installed (let’s call it “hashcat_dir”). 2. Run this command to start oclHashcat-plus:
bash
#!/bin/bash # This line specifies the interpreter to be used for executing the script
# This script uses oclHashcat-plus to crack passwords from a dictionary file
# Navigate to the directory where both tools are installed
cd hashcat_dir
# Use oclHashcat-plus to crack the passwords
./oclHashcat64.bin -m 0 hashes dictionary --stdout > cracked_passwords
# -m 0 specifies the hash type to be cracked
# hashes is the file containing the hashes to be cracked
# dictionary is the dictionary file containing possible passwords
# --stdout outputs the cracked passwords to the terminal
# > redirects the output to a file called "cracked_passwords"
This will run oclHashcat-plus in “hashcat mode” (mode 0) and compare each hash from the “hashes” file to every word in the “dictionary”. The “–stdout” option tells oclHashcat-plus to output any matching passwords directly to a new file called “cracked_passwords”.
Now, let’s say we have some hashed passwords that are too long for oclHashcat-plus to handle. In this case, we can use John the Ripper instead. Here’s how:
1. Open your terminal and navigate to the directory where both tools are installed (let’s call it “john_dir”). 2. Run this command to start John the Ripper:
bash
#!/bin/bash # This line specifies the interpreter to be used for the script
# This script is used to crack hashed passwords that are too long for oclHashcat-plus to handle, using John the Ripper instead.
# Navigate to the directory where both tools are installed
cd john_dir
# Start John the Ripper with the specified command
./john hashes --format=raw-md5 | pipal -o cracked_passwords dictionary
# Explanation: The script first changes the current directory to "john_dir" where both tools are installed. Then, it starts John the Ripper with the specified command, which uses the "hashes" file as input and specifies the format of the hashed passwords as "raw-md5". The output of this command is then piped to the "pipal" tool, which uses a dictionary file to crack the passwords and outputs the cracked passwords to a file named "cracked_passwords".
This will run John the Ripper in “hashcat mode” (using raw MD5 format) and compare each hash from the “hashes” file to every word in the “dictionary”. The output of John the Ripper is then piped into a tool called Pipal, which analyzes the results and outputs them to a new file called “cracked_passwords”.
Now, let’s say we have some hashed passwords that are too long for both oclHashcat-plus and John the Ripper. In this case, we can use a combination of both tools! Here’s how:
1. Open your terminal and navigate to the directory where both tools are installed (let’s call it “hashcat_john_dir”). 2. Run this command to start oclHashcat-plus and pipe its output into John the Ripper:
#!/bin/bash # This line specifies the interpreter to be used for the script
# Navigate to the directory where both tools are installed
cd hashcat_john_dir
# Start oclHashcat-plus and pipe its output into John the Ripper
./oclHashcat64.bin -m 0 hashes dictionary --stdout | ./run/john -format=raw-md5 | pipal -o cracked_passwords dictionary
# The above line runs oclHashcat64.bin with the specified options and pipes its output to John the Ripper, which is then piped to pipal for further processing
# The -m 0 option specifies the hash type to be cracked (in this case, raw MD5)
# The --stdout option prints the cracked passwords to the standard output instead of saving them to a file
# The -format=raw-md5 option specifies the format of the input hashes for John the Ripper to process
# The -o option specifies the output file for pipal to save the cracked passwords
# The dictionary at the end specifies the dictionary file to be used for cracking the passwords
This will run oclHashcat-plus in “hashcat mode” and compare each hash from the “hashes” file to every word in the “dictionary”. The output of oclHashcat-plus is then piped into John the Ripper, which compares it against its own dictionary. Finally, the results are analyzed by Pipal and outputted to a new file called “cracked_passwords”.
And that’s it! You now know how to crack passwords using oclHashcat-plus and John the Ripper. Remember, always use strong passwords and never reuse them across multiple accounts.