John the Ripper
John the Ripper is an active password cracking tool designed to detect weak passwords through dictionary attacks, rule mangling, and brute force methods. It supports numerous hash types and includes utilities for preprocessing wordlists and extracting hashes from various formats.
Description
John the Ripper helps systems administrators identify weak passwords that are easy to guess or crack via brute force. It supports crypt(3) hashes from Unix systems, Kerberos AFS, Windows NT/2000/XP/2003 LM hashes, and many more with contributed patches. The tool can automatically email users about weak passwords using the mailer utility.
Common use cases include cracking password hashes from shadow files, testing wordlists for uniqueness with the unique tool, and converting various encrypted files to John-compatible formats using specialized extractors like wpapcap2john or pdf2john. It offers modes like wordlist, incremental, mask, and PRINCE for flexible attack strategies.
The package includes john-data for character sets and scripts, plus companion tools like unique for deduplicating wordlists, mailer for notifications, and unshadow for combining passwd and shadow files.
How It Works
John loads password hashes, identifies their format (e.g., sha512crypt, Raw-MD5), and applies cracking modes: wordlist mode uses dictionaries with optional mangling rules; incremental mode generates systematic passwords; mask mode uses patterns; PRINCE combines word elements. It supports forking for parallelism, OpenMP, and memory-saving options. Utilities like unique use hashing (configurable memory via -mem) to remove duplicates while preserving order; extractors parse files into crackable hash lines.
Installation
sudo apt install johnFlags
Examples
john --wordlist=/usr/share/john/password.lst --rules unshadowed.txtecho -n test2 | md5sum | awk '{print $1}' > hashfor x in $(seq 0 9); do echo test$x >> wordlists; donejohn --list=formats | grep -i 'md5'john --format=raw-md5 --wordlist=wordlists hashunique -v -inp=allwords.txt uniques.txtmailer PASSWORD-FILEunshadow PASSWORD-FILE SHADOW-FILE