Lion Cipher Lab

Defend a Login Against Credential Stuffing

Why it matters

Credential stuffing is the most common account-takeover technique on the internet: attackers take the billions of email:password pairs leaked from past breaches and simply try them on your login, because people reuse passwords everywhere. It needs no clever exploit — just your login form and a list. Knowing how to see it happen against your own app, and how to layer the handful of defenses that actually stop it (rate limiting, breach screening, and above all MFA), is core identity-and-access work and one of the most common real-world and interview topics in the field.

What you'll learn

Steps in this lab

  1. What credential stuffing is — and how it differs from brute force
  2. Set up Python, the packages, and the lab folder
  3. Build the VULNERABLE login app (passwords hashed, but no defenses)
  4. Make a combo list and an attacker script
  5. Run the attack against the unprotected login
  6. Build the hardened app with layered defenses (rate limit + MFA, flag-controlled)
  7. Layer 1 — rate limiting, and the per-account-lockout trap
  8. Layer 2 — screen passwords against breaches with HIBP k-anonymity
  9. Layer 3 — MFA, the control that stops stuffing even with a valid password
  10. Judgment: what actually stops stuffing, and what is theatre

Open the full interactive lab →