Get a Pentest and security assessment of your IT network.

Cyber Security

JohnTheRipper: Brute Force Passwords

TL;DR

This guide shows you how to use JohnTheRipper to crack alphanumeric passwords using a brute-force attack. It’s important to understand this is for testing your own systems and learning about password security, not for illegal activities.

Prerequisites

  • JohnTheRipper installed on your system (Linux, macOS, or Windows via WSL). See the official website for installation instructions.
  • A password hash file you want to crack. This could be from a compromised application or a test environment.

Steps

  1. Understand Your Hash Type
  2. First, identify the type of hash you’re dealing with. JohnTheRipper needs to know this to crack it correctly. Use john --hash-type followed by your hash file name.

    john --hash-type my_hashes.txt

    This will output the hash type (e.g., MD5, SHA256). Note this down; you’ll need it in the next step.

  3. Run a Basic Brute Force Attack
  4. For an alphanumeric password, we’ll use the --incremental mode with a character set. This tells JohnTheRipper to try every possible combination of characters starting from a specified length.

    john --hash-type=MD5 --incremental my_hashes.txt

    Replace MD5 with the hash type you identified in step 1. This command will start cracking passwords, beginning with single-character combinations and increasing length until a match is found or you stop it.

  5. Specify Character Set (Important for Speed)
  6. To speed up the process, tell JohnTheRipper exactly which characters to use. Use the --charset option. For lowercase letters, uppercase letters and numbers:

    john --hash-type=MD5 --incremental --charset='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' my_hashes.txt

    You can customize the character set to include symbols if you know they were used in the passwords.

  7. Limit Password Length (Further Speed Improvement)
  8. If you have an idea of the maximum password length, use --max-length. This significantly reduces cracking time.

    john --hash-type=MD5 --incremental --charset='abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789' --max-length=8 my_hashes.txt

    This will only try passwords up to 8 characters long.

  9. Monitor Progress and Stop the Attack
  10. JohnTheRipper displays its progress in real-time. You can stop the attack at any time by pressing Ctrl+C.

  11. View Cracked Passwords
  12. Once JohnTheRipper finds a password, it will display it. To view all cracked passwords, use john --show my_hashes.txt

    john --show my_hashes.txt

    This will output the plain-text passwords that were successfully cracked.

  13. Using a Wordlist (Alternative Approach)
  14. If you suspect the passwords are based on common words, use a wordlist instead of brute force. Download a suitable wordlist (e.g., RockYou.txt). Then run:

    john --hash-type=MD5 my_hashes.txt rockyou.txt
  15. Rules for More Complex Cracking
  16. JohnTheRipper supports rules to apply transformations to wordlist entries (e.g., capitalization, adding numbers). Use the --rule= option.

    john --hash-type=MD5 my_hashes.txt rockyou.txt --rule=best64
Related posts
Cyber Security

Zip Codes & PII: Are They Personal Data?

Cyber Security

Zero-Day Vulnerabilities: User Defence Guide

Cyber Security

Zero Knowledge Voting with Trusted Server

Cyber Security

ZeroNet: 51% Attack Risks & Mitigation