How Banks and Netflix Stop Bots Trying Millions of Stolen Passwords: Credential Stuffing, Made Simple
By Devang Pandya · Cloud Tech by Devang · Cloud • DevOps • AI — Made Simple
This post is the full breakdown for the Bapu ki Class Reel on credential stuffing. If you came here after commenting BOTS, welcome!
The story in the Reel: Beta panics: "Bapu, 50,000 wrong passwords a minute on our login page!" Bapu calmly explains:
- This is credential stuffing: bots take passwords leaked from other sites and try them on every door.
- Blocking IPs alone fails. Block one and a hundred proxy IPs appear.
- Use layers: limit attempts per account, show a CAPTCHA only when a login looks risky, and reject passwords found in known breaches.
- The biggest lock is MFA. Per Microsoft's analysis (cited by OWASP), it would have stopped 99.9% of account compromises.
Below is the detailed version.
Every big login page on the internet is attacked by bots, all day. Not by a hacker typing passwords by hand, but by automated tools trying millions of username and password pairs that leaked from other websites. This attack is called credential stuffing, and it is one of the most common ways accounts get taken over.
If you work in cloud, DevOps, SRE or backend, you will meet this in production, and you will meet it in interviews. Here is how the question often sounds:
"Your login API gets 50,000 failed logins a minute, from thousands of IPs. Stop it."
In this post I will explain, in simple English, what credential stuffing is, why simply blocking IP addresses does not work, the layered defences that do work, and how to answer this in an interview. After 14+ years in cloud and operations, my strongest lesson here is simple: there is no single fix. You need layers.
A quick note: banks and Netflix do not publish the full details of their login defences, and they should not. I use them as familiar examples of services that are constantly targeted. The defences below come from the OWASP Credential Stuffing Prevention Cheat Sheet, which is the standard reference.
1. What is credential stuffing?
People reuse passwords. When one website is breached, the leaked email and password pairs get collected into huge lists. Attackers then use bots to replay those pairs against other websites: banks, streaming services, shopping sites, email providers. Because many people reuse the same password, a small percentage of attempts succeed. A small percentage of millions is still a lot of hijacked accounts.
Three attacks people mix up
The OWASP cheat sheet separates these clearly:
- Brute force: trying many passwords against one account.
- Credential stuffing: trying known username and password pairs from other breaches.
- Password spraying: trying a few common passwords (like
Password123) against many accounts.
They look different in your logs, so the defences need to cover all three.
2. What the attack looks like in your system
In the interview scenario, you see:
- A big jump in failed logins (50,000 a minute in our example).
- Requests from thousands of different IP addresses.
- Each IP sends only a few attempts, so per-IP limits barely trigger.
- Many different usernames, often ones that do not even exist on your site.
- Some logins succeed, and those accounts may then be abused: changed emails, stolen gift cards, fraud.
The goal is to make the attack slow, expensive and noisy for the attacker, while keeping login easy for real users.
3. Why blocking IPs alone fails
The first idea most people have is "block the bad IPs". It helps a little, but OWASP warns that you should not rely on IP blocking alone. Attackers rotate through large proxy networks, including residential proxies, so traffic comes from IPs that look like normal home users. If you block too aggressively, you also block real customers who share those networks.
IP information is still useful as one signal: known hosting providers, known bad proxy ranges, unusual countries for that user. But it must be combined with others.
4. The layered defence
Layer 1: Multi-factor authentication (MFA)
The OWASP cheat sheet calls MFA by far the best defence against password-based attacks. It cites Microsoft's analysis that MFA would have stopped 99.9% of account compromises. Even if the attacker has the right password, they do not have the second factor.
In practice, many services use risk-based or step-up MFA: you are not asked for a code every time, but you are asked when the login looks unusual (new device, new country, many recent failures).
Layer 2: Rate limiting on more than IP
Limit login attempts on several keys:
- Per account: slow down repeated failures for one username (but be careful, an attacker can use this to lock real users out, so prefer delays and step-up checks over hard lockouts).
- Per IP and per network range.
- Globally: alert when the overall failure rate jumps far above normal.
Layer 3: Device and bot signals
OWASP describes device fingerprinting and connection fingerprinting (for example, the TLS client fingerprint known as JA3). Real browsers and phones look different from simple bot scripts. Combine signals like:
- Is the device known for this user?
- Does the client behave like a real browser?
- Does the connection fingerprint match a known automation tool?
Many companies use a managed bot management service or a web application firewall (WAF) with bot rules for this.
Layer 4: CAPTCHA, but only when risky
CAPTCHAs annoy real users and can be solved by paid services, so OWASP recommends using them only when a request looks suspicious, not on every login. Think of a CAPTCHA as a speed bump for risky traffic, not a wall for everyone.
Layer 5: Block breached passwords
Stop the problem at the source: do not let users choose passwords that are already in breach lists. The Pwned Passwords service from Have I Been Pwned lets you check a password safely using k-anonymity: you hash the password and send only the first five characters of the hash. The service returns all matching hash suffixes, and you check locally. The full password, and even the full hash, never leaves your system.
Layer 6: Tell the user
Notify users about logins from new devices or locations, and about password changes. If an attacker does get in, the real user can react quickly.
5. Putting it together: a login request, step by step
Here is a simple design you can draw on a whiteboard:
- Edge / WAF: basic rate limits per IP and range, known-bad IP lists, bot rules.
- Login service: checks per-account and global failure rates.
- Risk engine: scores the attempt using device, connection fingerprint, location and history.
- Decision:
- Low risk: allow normal login.
- Medium risk: show a CAPTCHA or ask for MFA.
- High risk: block, delay, or require MFA.
- After login: notify on new devices, and protect sensitive actions (email change, payout) with step-up MFA.
- Monitoring: dashboards for failed-login rate, success rate on suspicious traffic, and accounts that changed details right after login.
6. Common mistakes
- Only IP blocking. Proxy networks make it weak on its own.
- Hard account lockouts after a few failures. Attackers can lock out real users on purpose. Prefer increasing delays and step-up checks.
- Different error messages for "user does not exist" vs "wrong password". This tells attackers which accounts are real. Use one generic message.
- CAPTCHA for everyone. It hurts conversion and attackers solve it anyway.
- No monitoring. Many teams only notice the attack when customers complain.
7. The example visuals
The "50,000 failed logins a minute from thousands of IPs" line is an example scenario, the way interviewers phrase it. The proxy boxes in the Reel are illustrative. Banks and Netflix are used as familiar examples of targeted services; their exact defences are not public. The definitions, the MFA guidance and the 99.9% figure (Microsoft, cited by OWASP), the CAPTCHA and IP guidance, fingerprinting, and the Pwned Passwords k-anonymity model are verified from the sources below.
8. How to answer this in an interview
Question: "Your login API gets 50,000 failed logins a minute, from thousands of IPs. Stop it."
Strong answer:
"This looks like credential stuffing: bots replaying username and password pairs leaked from other sites. Blocking IPs alone won't work because attackers spread requests across large proxy networks. So I would add layers. Rate limits per account, per IP and globally. Device and connection fingerprinting to spot bots. A CAPTCHA only for risky attempts, not for everyone. A breached-password check so users can't pick leaked passwords. And the strongest control is MFA, ideally risk-based, because Microsoft's analysis says MFA would stop 99.9% of account compromises. I would also notify users about new-device logins and monitor the failed-login rate."
Follow-ups to expect:
- Credential stuffing vs brute force vs password spraying? Known pairs vs many passwords on one account vs few passwords on many accounts.
- Why not lock the account after 5 failures? Attackers can lock out real users. Use delays and step-up checks.
- How do you check breached passwords without sending them? k-anonymity: send only a hash prefix.
- How do you know it is working? Failed-login rate drops, success rate on suspicious traffic drops, fewer account takeover reports.
Sources
- OWASP, "Credential Stuffing Prevention Cheat Sheet" (definitions; MFA as the best defence and Microsoft's 99.9% figure; CAPTCHA only when suspicious; IP blocking alone is not enough; device and connection fingerprinting including JA3; breached password checks; notifying users): https://cheatsheetseries.owasp.org/cheatsheets/Credential_Stuffing_Prevention_Cheat_Sheet.html
- Have I Been Pwned, "Pwned Passwords" and API v3 docs (k-anonymity range API, first five characters of the SHA-1 hash): https://haveibeenpwned.com/Passwords ; https://haveibeenpwned.com/API/v3
- OWASP, "Authentication Cheat Sheet" (generic error messages, protecting against automated attacks): https://cheatsheetseries.owasp.org/cheatsheets/Authentication_Cheat_Sheet.html
Preparing for a Cloud, DevOps or SRE interview? Book a Free 15-min Cloud & DevOps Interview Guidance Call with me: what to study, how to answer system-design and on-call questions, plus a CV and roadmap check 👉 topmate.io/cloudtechbydevang
About the author
- I help engineers learn cloud, DevOps, SRE and AI in simple English, crack interviews and follow clear roadmaps. 14+ years building and running platforms on AWS, GCP, Kubernetes and Terraform. One topic a day.
Comments
Join the discussionSection 3 is the part I'd expand in an interview answer, because "use IP as one signal" invites the follow-up "which signal, exactly?"
Three that carry their weight:
- Network type. Hosting/cloud ASNs on a consumer login page are unusual. Cheap to check, catches the lazier attacks.
- Anonymizer flags. VPN exits, Tor, residential proxy pools. Residential proxies are the hard case you mention, since they look like home users, so this needs a source that tracks proxy networks, not just ASN owners.
- Distance from the account's history. A login from a country the account has never used, through a VPN, is a much stronger reason for step-up MFA than either fact alone.
None of these should block on their own. They feed the risk engine in your step 5 and decide between "allow" and "ask for MFA".
On the per-range limits in Layer 2: for IPv6, key on the /64 rather than the full address, otherwise one host can rotate through billions of addresses for free.
(Disclosure: I work on IPGeolocation.io, which provides the flags in point 2. Other providers do too; the design works with any of them.)
