john the ripper
Prove how weak a password really is, before someone with worse intentions does. The classic cracker, strong on format breadth and CPU work.
Authorized use only. Run these only on systems you own or have explicit written permission to test. Full notice at the foot of the page.
01What john is for
John the Ripper cracks password hashes: you give it hashes, it gives you back the passwords that produced them. Its particular strengths are format breadth (it understands an enormous range of hash types and can often detect them for you) and a clever default mode that applies smart rules automatically. Where hashcat is the GPU speed champion, john is the flexible, format-aware workhorse, and the jumbo build adds a huge library of hash formats and helper tools for extracting hashes from files.
02Install the jumbo build
You want john-the-ripper jumbo, not the bare core, because jumbo carries the extra formats and the *2john helper scripts that extract hashes from files. Most distributions package it.
$ sudo emerge app-crypt/johntheripper-jumbo # Gentoo (jumbo build)
$ sudo apt install john # Debian / Ubuntu / Kali
$ sudo dnf install john # Fedora / RHEL
03Getting hashes into a file
john reads hashes from a file, one per line, often in the format user:hash. The jumbo build includes dozens of *2john tools that pull a crackable hash out of something: a ZIP, a PDF, an SSH key, a KeePass database. This is how you audit the strength of a password protecting a file.
$ zip2john secret.zip > ziphash.txt
$ ssh2john id_rsa > keyhash.txt
$ sudo unshadow /etc/passwd /etc/shadow > linuxhashes.txt
04The default crack
Run john on the file with no mode and it does something smart: single-crack mode (using the username and GECOS as hints), then wordlist with its default rules, then incremental. For many weak passwords this one command is enough. Point --wordlist at a specific list to control it.
$ john linuxhashes.txt
$ john --wordlist=/usr/share/wordlists/rockyou.txt linuxhashes.txt
05Seeing what cracked
Cracked passwords go into a pot file, so you do not re-crack them. --show reads the pot against your hash file and prints the recovered passwords, which is how you get the results out after a run.
$ john --show linuxhashes.txt
06Wordlist rules, the force multiplier
Real passwords are rarely a bare dictionary word; they are a word mangled: a capital, a year, a bang on the end. Rules describe those mutations so one wordlist becomes thousands of variations. john ships rule sets; --rules=jumbo is a strong, broad default that catches the human habits people actually use.
$ john --wordlist=rockyou.txt --rules=jumbo linuxhashes.txt
» Rules are why a 14-million-word list cracks far more than 14 million passwords: Password becomes Password1, P@ssword, Password2019, and so on.
07Telling john the format
john usually detects the hash type, but when a format is ambiguous you specify it with --format. --list=formats shows what it supports. Getting the format right matters, because the wrong guess cracks nothing.
$ john --list=formats | tr ',' '\n' | grep -i ntlm
$ john --format=nt ntlmhashes.txt
08When to switch to hashcat
john is CPU-first and format-rich; hashcat is GPU-first and raw-speed king. For a few hashes, file formats, or quick audits, john is often the faster path start to finish. For slow hashes at volume where you have a GPU, convert your approach to hashcat. Knowing both and picking the right one per job is the real skill.
» Use john for breadth and convenience, hashcat for GPU-scale throughput. See the hashcat guide for the latter.
09What a successful crack tells you
Run john against your own hashes and whatever falls quickly is a password that must change, and often a policy that must change with it. The point of auditing is to find the weak ones before an attacker does, and to prove to users and management, concretely, why length and uniqueness matter.
» Any password john cracks from rockyou plus rules was never strong; require length (a passphrase) over complexity theatre.
» Slow, salted hashes (bcrypt, argon2, sha512crypt) buy time; fast unsalted ones (raw MD5, NTLM) fall instantly. Store passwords with a slow, salted algorithm.
» Audit periodically; a password that was fine may appear in next year's breach wordlist.
Only crack hashes from systems you own or are authorized to assess.
Authorized use only
The tools and techniques in these guides are for defending, testing, and understanding systems you own or have explicit written permission to assess. Unauthorized access to computers, networks, accounts, or data is a criminal offense in nearly every jurisdiction, and the penalties are real.
A few of the laws that apply, by way of example:
- Philippines: Cybercrime Prevention Act of 2012 (Republic Act No. 10175)
- United States: Computer Fraud and Abuse Act (18 U.S.C. § 1030)
- United Kingdom: Computer Misuse Act 1990
- European Union: Directive 2013/40/EU on attacks against information systems, as implemented by each member state
- Most other countries have equivalent computer-misuse laws
Wherever you are, the rule is the same: get authorization in writing, stay within the agreed scope, and never touch a system that is not yours to test. If you are unsure whether something is permitted, treat it as not permitted until you have clear authorization.
This is general information, not legal advice.