Password lab: John the Ripper, MFA and passkeys
This lab gives each student John the Ripper, the open source password cracker, and a small college sign-in site to defend. They crack password hashes the lab made itself with a word list, rules and a mask, compare a fast unsalted hash with bcrypt, replay a leaked list against the site, switch on throttling and a breached-password check, sign in with a one-time code and watch a passkey refuse a look-alike site.
Every account, password, address and leaked list in it is made up, and the word list is planted. A student cracks only these hashes and attacks only this site: under the Computer Misuse Act 1990, trying passwords against anybody else’s system without written permission is a crime. Every copy has no route to the internet beyond the platform’s list of allowed hosts and none to any other student.
What students learn
Why weak passwords and fast hashes fail. John loads five hashes from six accounts, because two shared a password and the hash had no salt, and a list of 97 words cracks two at once. Rules make 274,381 guesses from those words and find Liverpool1; a mask finds Summer2026. Against bcrypt John reports six salts and a cost of 256, so every guess costs far more, and a long phrase of random words holds throughout.
How accounts are taken without cracking anything. Thirty made-up leaked pairs replayed over eight addresses take over one reused account; throttling never fires, because each account is tried once, while a breached-password check refuses both reused passwords. Students sign in with a TOTP code worked out from the published test values, and see a passkey refuse a look-alike site and a replayed signature.
Run it in your browser
The lab starts two services. john is John the Ripper, the jumbo version, with Python, a planted word list, the hashes and short scripts in steps/. site is the sign-in site on port 8000, JSON over HTTP, with a log and defences to switch on. The terminal beside the lab reaches them with docker exec and curl.
- Open the Container page. Open Build on the bar and choose Run a container. Anybody may open it, and the Git lab and the SQL lab start with no account. Every other lab needs a free account: create one, sign in, then press Start.
- Find the lab. The Sample labs card lists every sample. Find Passwords: John the Ripper, MFA and passkeys.
- Press Start. Start runs it as it is, in one press. Edit the file first opens the compose file so you can change it before you start. It is ready in under a minute.
- Open it. On the lab's page, press Open terminal and type docker exec john john --format=raw-sha256 --wordlist=words.txt hashes/fast.txt to crack the first file.
What to ask students to hand in
A short report on their own copy: which of the six passwords John cracked in each file and with which mode, and why the last one held; what credential stuffing did to the site before and after its defences, with the log summarised by address; and which sign-in they would give the college's staff, and why. Nothing is marked automatically: the reasons show whether it was understood.
A basic lesson on this lab
Password Cracking Basics is a small lesson worked in this lab. In it a student reads a stolen table, cracks it with a word list and with rules, and runs the same word list against bcrypt.
Free personal accounts have it in the Basics module, which is on Home, and every college can copy it from the Library's Basics folder. It is deliberately small: it shows a teacher what a lesson worked in a lab is, and the lab does the rest. The module Passwords, MFA and passkeys goes further in six lessons.
The code on GitHub
The compose file has no Dockerfile. John runs from our own image, ghcr.io/mitsurutech/john, built in the open from Kali Linux's packaged jumbo build (GPL-2.0 or later) and pinned by digest; the site runs on Python 3.12 on Alpine (the PSF licence). Both run as unprivileged accounts. The file writes the word list, the scripts and the site from fixed text when it starts, and makes the hashes with fixed salts, so nothing is downloaded and every copy prints the same.
Set it as work
Say in the task what to hand in.
- Make the lab. In your module add a task and choose the Container lab card, then In a GitHub repository. Give https://github.com/mitsurutech/lab-password-lab with the branch main. The compose file is the default, compose.yaml. Fork the repository first if you want to change it, for example to plant a word list or accounts of your own.
- Publish and try it. Publish pins the commit you were shown, so a later change in the repository does not alter a lab you have already set. Start your own copy first.
- Hand it out. Assign it like any task, with a due date if you want one, and say in the task what to do and what to hand in.
- Mark what is handed in. Open a student’s copy and the work they handed in, mark it, and send it back with a reason if it needs more.
Try this lab, and what it costs
A free personal account can work through the basic lessons in this lab, with enough free credit each month to follow most lessons and no card. For a class, a school or college has its first 365 days free for up to 50 students, then pays per student a year, with every lab included and staff free.
Questions people ask
- Is it legal to teach password cracking?
- Yes, against hashes you made or have written permission to test, which is what security teams do to audit their own passwords. Every hash and account here is made up, and each lesson that attacks opens with the rule and ends with the fix and how to detect it.
- Can students crack a real password with it?
- No. The lab has no way out to the internet, so nothing can be brought in or sent out, and its word list is 97 common choices. It shows why weak passwords fall, not how to attack a real system.
- Why are the timings never given?
- Speed depends on the machine, so two copies differ. The lessons count guesses and salts instead, which are the same everywhere and show the same trade-off.
- Is the passkey a real one?
- It follows the same steps as WebAuthn, written out in plain Python so every check can be read: one key pair per site, a fresh challenge, the origin and the sign count. It is a teaching copy, not a phone or a browser.
- Does it cost anything or use credits for AI?
- No AI is used, so nothing is charged for it. The lab runs like any other container lab.