Hello again, champion! 👋
In Module 2, we installed John and ran our first test. We saw John crack a simple password using a wordlist. But what if the password is not in the wordlist? What if it is “password1” or “P@ssw0rd”?
That is where rules come in! Rules are like magic tricks that John uses to change words. For example, if John knows “password”, rules can turn it into “Password”, “password1”, or “P@ssw0rd”.
In this module, we will learn how to create our own wordlists and use rules to make John super smart. We will also learn about different hash types and how to tell John which one we are using.
Let’s make John a genius! 🧠✨
After this module, you will be able to:
--format option correctly.Kofi is now a great key‑maker. But he wants to be even better. He meets a wise chef named Mama Nkechi. She can cook any dish with just a few ingredients. How? She uses rules! She adds salt, pepper, or spices to change the taste.
Kofi realises: John can do the same! Instead of just using a list of words, John can change them – add numbers, change letters to symbols, or make them uppercase.
Kofi also learns that different locks need different keys. Some locks are like MD5, others are like SHA‑256. John needs to know which lock he is opening.
Now Kofi can open almost any chest! Let’s learn how John does this. 🍲🔑
Definition: A wordlist is a text file that contains many possible passwords, one per line.
Why it is important: John uses wordlists to guess passwords quickly.
Simple explanation: It is like a big dictionary of words John tries.
Real‑life example: A spelling bee contestant studies a list of words.
School example: Your teacher gives you a list of vocabulary words.
Home example: Your parent has a grocery list.
Nigerian example: A market trader has a list of items to buy.
Illustration (ASCII):
wordlist.txt
+-------------+
| abuja |
| lagos |
| naija |
| chidi |
| bola |
+-------------+
Mini summary: A wordlist is a list of guesses for John.
Definition: Making your own wordlist means creating a file with passwords you choose.
Why it is important: You can target specific passwords (e.g., Nigerian names).
Simple explanation: Like writing your own shopping list.
Real‑life example: You make a list of your friends’ names.
School example: You create a list of classmate names.
Home example: You list your family members’ names.
Nigerian example: You list common Nigerian names: Chidi, Ada, Bola, Tunde.
Illustration (ASCII):
Step 1: Open Notepad
Step 2: Type each password on a new line
Step 3: Save as "mylist.txt"
Example:
Chidi
Ada
Lagos
Nigeria
Mini summary: You can create a wordlist with any text editor.
Definition: Rules are instructions that modify words to create new guesses.
Why it is important: Rules make John much smarter by trying many variations.
Simple explanation: It is like adding toppings to a pizza to make different flavours.
Real‑life example: You take a plain t‑shirt and add a logo.
School example: You take a basic sentence and add adjectives.
Home example: You take a basic recipe and add spices.
Nigerian example: You take jollof rice and add different meats.
Illustration (ASCII):
Base word: "chidi"
Rules:
+ add 1 → "chidi1"
+ uppercase → "Chidi"
+ substitute i→! → "ch!d!"
+ add 2024 → "chidi2024"
Mini summary: Rules change words into many new passwords.
Definition: John comes with default rules that are ready to use.
Why it is important: You can use them without writing your own.
Simple explanation: It is like having a pre‑set recipe book.
Real‑life example: A smartphone has pre‑set camera filters.
School example: Your teacher gives you a template for an essay.
Home example: Your TV has pre‑set picture modes.
Nigerian example: A bank has pre‑set account types.
Illustration (ASCII):
To use rules:
$ john --wordlist=mylist.txt --rules test.hash
John will now apply default rules.
Mini summary: Use --rules to activate John’s built‑in rules.
Definition: Custom rules are rules you write yourself to suit your needs.
Why it is important: You can target specific patterns.
Simple explanation: Like creating your own pizza recipe.
Real‑life example: You create a custom playlist.
School example: You write your own study guide.
Home example: You create a custom cleaning schedule.
Nigerian example: You create a custom menu for a party.
Illustration (ASCII):
Rule syntax example:
$ john --wordlist=mylist.txt --rules=myrules test.hash
In the john.conf file:
[List.Rules:myrules]
$1 # add 1 at the end
u # uppercase all letters
c # capitalize first letter
s?l?l # substitute l with !
Mini summary: You can write custom rules in john.conf.
Definition: Operations are actions rules can perform, like adding, deleting, or changing characters.
Why it is important: They allow endless variations.
Simple explanation: Like having different tools in a toolbox.
Real‑life example: A chef uses a knife, a pan, and a spoon.
School example: You use a pen, ruler, and eraser.
Home example: You use a broom, dustpan, and mop.
Nigerian example: A trader uses a scale, calculator, and bag.
Illustration (ASCII):
Rule operations:
l : lowercase all letters
u : uppercase all letters
c : capitalize first letter
r : reverse the word
d : duplicate the word
$X : append X (e.g., $1 adds 1)
^X : prepend X (e.g., ^A adds A at start)
sXY : substitute X with Y
Mini summary: Rules have many operations to change words.
Definition: Combining wordlists and rules means John tries every word in the wordlist and every variation from the rules.
Why it is important: This gives the best chance of cracking passwords.
Simple explanation: Like having a huge menu with many options.
Real‑life example: A restaurant has a menu and specials.
School example: You have a textbook and notes.
Home example: You have a pantry and recipes.
Nigerian example: A market has a list of goods and special offers.
Illustration (ASCII):
Wordlist: [chidi, bola, ade]
Rules: add 1, uppercase, substitute i→!
John tries:
chidi, Chidi, chidi1, ch!d!, Ch!d!1, ...
bola, Bola, bola1, b0la, ...
ade, Ade, ade1, ...
Mini summary: Rules multiply the number of guesses John makes.
Definition: MD5 is a common hash format that produces a 32‑character hash.
Why it is important: Many systems use MD5, so John needs to recognise it.
Simple explanation: It is like a lock that has a specific keyhole shape.
Real‑life example: A car key has a specific shape.
School example: Your student ID has a specific format.
Home example: Your house key has a specific cut.
Nigerian example: Your BVN has a specific format.
Illustration (ASCII):
Password: "hello"
MD5 hash: 5d41402abc4b2a76b9719d911017c592
(32 characters)
Mini summary: MD5 is a 32‑character hash format.
Definition: SHA‑256 is a more secure hash that produces a 64‑character hash.
Why it is important: It is stronger than MD5 and used in modern systems.
Simple explanation: A stronger lock with a more complex keyhole.
Real‑life example: A high‑security safe.
School example: A school vault for important documents.
Home example: A safe for valuables.
Nigerian example: A bank vault.
Illustration (ASCII):
Password: "hello"
SHA-256 hash: 2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824
(64 characters)
Mini summary: SHA‑256 is a 64‑character hash format.
Definition: The --format option tells John what type of hash it is.
Why it is important: John needs to know the format to crack it correctly.
Simple explanation: Like telling a locksmith what type of lock you have.
Real‑life example: You tell the mechanic your car model.
School example: You tell the teacher which subject.
Home example: You tell the plumber what is broken.
Nigerian example: You tell the electrician the appliance type.
Illustration (ASCII):
$ john --format=raw-md5 test.hash
$ john --format=raw-sha256 test.hash
$ john --format=nt test.hash # for Windows hashes
Mini summary: Use --format to specify the hash type.
Definition: There are many hash types like MD5, SHA‑1, SHA‑256, NT, and LM.
Why it is important: Different systems use different hashes.
Simple explanation: Different locks need different keys.
Real‑life example: Your house, car, and locker all have different keys.
School example: Your locker, bike, and computer all have different passwords.
Home example: Your front door, garage, and safe have different locks.
Nigerian example: Your bank card, phone, and email have different PINs.
Illustration (ASCII):
Hash formats:
+----------+------------------+------------------+
| Format | Length | Example |
+----------+------------------+------------------+
| MD5 | 32 chars | 5d41402abc... |
| SHA‑1 | 40 chars | aaf4c61ddc... |
| SHA‑256 | 64 chars | 2cf24dba5f... |
| NT | 32 chars (hex) | 8846f7ea... |
| LM | 32 chars (hex) | f0e4c2f7... |
+----------+------------------+------------------+
Mini summary: John supports many hash formats.
Definition: Using all three together gives the best chance of cracking.
Why it is important: This is the most powerful way to use John.
Simple explanation: Like using all the best tools at once.
Real‑life example: A chef uses the best ingredients, recipe, and cooking method.
School example: You study with a textbook, notes, and practice questions.
Home example: You clean with a broom, mop, and cleaning spray.
Nigerian example: A farmer uses good seeds, fertiliser, and water.
Illustration (ASCII):
$ john --wordlist=mylist.txt --rules --format=raw-md5 test.hash
This tells John:
1. Use the wordlist mylist.txt
2. Apply rules
3. The hash is MD5
Mini summary: Combine options for maximum power.
Definition: Rules can turn “password” into many variations.
Why it is important: This cracks passwords that are not in the wordlist.
Simple explanation: Rules make John a magician.
Real‑life example: A magician makes one coin into many.
School example: A teacher explains one topic in many ways.
Home example: You use one ingredient in many dishes.
Nigerian example: A tailor uses one fabric for many styles.
Illustration (ASCII):
Base: “lagos”
Rules:
+ uppercase → “LAGOS”
+ capitalize → “Lagos”
+ add 2024 → “lagos2024”
+ substitute a→@ → “l@gos”
+ reverse → “sogal”
John tries all of these!
Mini summary: Rules create many guesses from one word.
Definition: Wordlist etiquette means using wordlists respectfully and legally.
Why it is important: Some wordlists come from data breaches – using them ethically is important.
Simple explanation: Like respecting others’ property.
Real‑life example: You do not use someone’s toothbrush.
School example: You do not copy someone’s homework.
Home example: You do not read someone’s diary.
Nigerian example: You do not use someone’s phone without permission.
Illustration (ASCII):
Do:
+ Use public wordlists
+ Create your own
+ Use for learning
Don't:
- Use leaked passwords
- Use without permission
- Use to hack people
Mini summary: Use wordlists ethically and legally.
Definition: A wordlist master knows how to create, use, and optimise wordlists.
Why it is important: This skill makes you a better John user.
Simple explanation: Like becoming a master chef.
Real‑life example: A master carpenter knows all tools.
School example: A top student knows all subjects.
Home example: A parent who can fix anything.
Nigerian example: A master tailor who can make any outfit.
Illustration (ASCII):
Wordlist Master:
+ Knows how to create custom lists
+ Understands rules
+ Knows hash formats
+ Uses John efficiently
+ Always acts ethically
Mini summary: You are becoming a wordlist master!
--format to tell John the hash type.mylist.txt.test.hash.john --wordlist=mylist.txt test.hash.john --wordlist=mylist.txt --rules test.hash.john --format=raw-md5 --wordlist=mylist.txt --rules test.hash.john --show test.hash.Illustration (flowchart):
Start
|
v
Create wordlist (mylist.txt)
|
v
Save hash (test.hash)
|
v
Run John with wordlist
|
v
Add rules
|
v
Specify format
|
v
Show results
|
v
End
--rules.--rules to activate rules.--format.--rules. --rules when you want variations.--format correctly.
1991 ── MD5 introduced
1995 ── SHA‑1 introduced
2001 ── SHA‑256 introduced
2005 ── NT/LM hashes used in Windows
2024 ── John supports 30+ formats
| Feature | MD5 | SHA‑256 |
|---|---|---|
| Length | 32 characters | 64 characters |
| Security | Weak (can be cracked quickly) | Strong (much harder to crack) |
| Speed | Fast | Slower |
| Common use | Older systems, checksums | Modern systems, security |
Start
|
v
Load wordlist
|
v
For each word:
|
+---> Apply rules
| |
+---> Generate variations
| |
+---> Hash each variation
| |
+---> Compare to target
| |
+---> Match? ── Yes ──> Password found!
| |
+---> No ──> Next word
|
v
End
| Operation | Description | Example |
|---|---|---|
| l | Lowercase all letters | HELLO → hello |
| u | Uppercase all letters | hello → HELLO |
| c | Capitalize first letter | hello → Hello |
| r | Reverse the word | hello → olleh |
| $X | Append X | hello + 1 → hello1 |
| ^X | Prepend X | hello ← A → Ahello |
| sXY | Substitute X with Y | hello → he11o (s l 1) |
Excellent work! You have completed the third module. Here is what we learned:
--format to specify the hash type.You are now a wordlist and rules expert! In the next module, we will learn about advanced cracking techniques and how to optimise John for speed.
--wordlist=file1,file2.--format option used for?--________ to specify the hash type.$1 ________ a 1 to the word.--rules --rule --apply --format --hash --type u do?$1 do?--rules --rules Match the term on the left with its description on the right.
| Term | Description |
|---|---|
| 1. Wordlist | A. Adds 1 to the end |
| 2. Rule | B. A list of passwords |
| 3. $1 | C. An instruction to change a word |
| 4. MD5 | D. A 64‑character hash |
| 5. SHA‑256 | E. A 32‑character hash |
Answers: 1‑B, 2‑C, 3‑A, 4‑E, 5‑D
Scenario 1: Kofi has a wordlist with “chidi” but the password is “Chidi2024”.
--rules.)Scenario 2: Ada has a hash that looks like 64 characters. She tries to crack it but John fails.
--format=raw-sha256.)Activity: In groups, create a wordlist with 10 Nigerian cities. Then, use John with rules to see how many variations you can generate. Present your results.
Activity: Create a custom wordlist with your name, your pet’s name, and your favourite food. Then, use John with rules to crack a test hash with one of those words.
Project: Create a custom wordlist for a specific target (e.g., your school). Include names, places, and common terms. Then, write a set of rules to crack typical passwords. Test it on a dummy hash.
Assignment: Using a test hash, run John with a wordlist without rules, then with rules. Compare the results and write a short report on the difference.
Challenge: Create a rule that generates “Password2024!” from “password”. Then, use it to crack a test hash. (Hint: you need uppercase, append, and substitute.)
(Answers to Fill-in-the-Blank, True/False, and Multiple Choice are provided within each section.)
In Module 4, we will learn about advanced cracking. We will optimise John for speed, use GPU acceleration, and crack complex hashes like ZIP and PDF passwords. We will also learn about session management and restoring jobs.
Make sure you have your John installation ready. See you in Module 4! 🚀
End of Module 3