Learn / Attack archive / Lesson 23

Stolen logins and infostealers

Why most break-ins are now just log-ins, where the passwords come from, and why a second factor on every account is the single cheapest defence there is.

Last updated: 2026-09-23

What it is

Most attackers no longer break in. They log in, with a real username and password that was stolen somewhere else. There are three main sources:

A stealer log is worse than an old breach: its passwords are current, and it often includes session cookies that skip the login entirely.

Why it is a rule

Why it keeps working

How to do it

1. A second factor on every account that matters

Staff, admin, cloud, database, domain registrar, email. Snowflake and Change Healthcare were both one missing checkbox. Prefer passkeys or security keys, which the next lesson shows cannot be phished. An authenticator app is still far better than nothing.

2. Refuse known-breached passwords

At sign-up and password change, check the password against a breached-password list. The Pwned Passwords API does this without ever sending the password: you send the first five characters of its SHA-1 hash and compare the results locally.

js
const hash = crypto.createHash('sha1').update(password).digest('hex').toUpperCase()
const res = await fetch(`https://api.pwnedpasswords.com/range/${hash.slice(0, 5)}`)
const breached = (await res.text()).split('\n').some((l) => l.startsWith(hash.slice(5)))

3. Slow the bots down

Rate-limit login attempts per account and per IP, and add a delay after failures. Stuffing works because trying is free.

4. Make stolen sessions short-lived

Sessions that expire, and that end on password change, limit what a stolen cookie is worth.

5. Retire old accounts

The logins in the Snowflake case were years old. Remove accounts for people and vendors who have left, and expire passwords that have not been used.

How we do it here

Passwords are stored only as slow, memory-hard hashes (scrypt), so a stolen table cannot be guessed through at speed. Sign-in attempts are limited both per IP and per account, sessions carry their own expiry, and access is checked on every request rather than trusted from the moment of sign-in.

Benefits

Disadvantages

Checklist

Sources

Read this lesson as Markdown