Password attacks and defences: spraying, stuffing and cracking
In short: Attackers get passwords by guessing, spraying common passwords across many accounts, reusing leaked credentials, or cracking stolen hashes offline. Strong defences combine MFA, long unique passwords, rate limiting, monitoring and slow salted hashing.
Why passwords are targeted
Stolen or weak credentials are one of the most common ways into an organisation. A valid username and password lets an attacker log in like a normal user, often without triggering any malware alerts. Understanding the main attack types helps you pick the right defence for each.
Online attacks
Online attacks try passwords against a live login page or service.
- Brute force and guessing: many attempts against one account. Easy to slow down with rate limiting and lockout.
- Password spraying: one or two very common passwords (such as a season and year) tried against many accounts. Because each account sees only a few failures, per-account lockout does not trigger.
- Credential stuffing: username and password pairs leaked from another website are tried automatically. It works because people reuse passwords.
- MFA fatigue: if an attacker already has the password, they trigger repeated push approvals hoping the user taps "approve" to make it stop.
Offline cracking and hashing
Systems should never store passwords in plain text. They store a hash, a one-way fingerprint. If an attacker steals the hash database, they can try candidate passwords offline at high speed, hashing each guess and comparing results, with no lockout to stop them. This is offline cracking.
| Storage choice | Resistance to cracking |
|---|---|
| Plain text or reversible encryption | None: never acceptable |
| Fast unsalted hash (MD5, SHA-1) | Very poor: precomputed tables and fast hardware break most passwords |
| Fast hash with a unique salt | Better, but still too fast |
| Slow, salted password hash (Argon2id, scrypt, bcrypt, PBKDF2) | Good: each guess is deliberately expensive |
A salt is a random value stored with each hash so identical passwords produce different hashes and precomputed tables are useless. Try the hash tool to see how a tiny change in input completely changes the output.
Defences that work
- Turn on MFA everywhere, preferring phishing-resistant methods such as passkeys or FIDO2 security keys. Use number matching for push approvals.
- Follow current guidance such as NIST SP 800-63B: favour length over complexity rules, check new passwords against lists of breached and common passwords, and do not force routine expiry without cause.
- Encourage a password manager so every account gets a long, unique password. The password generator shows what good looks like.
- Rate-limit and lock out sensibly, using progressive delays to avoid letting attackers lock everyone out.
- Monitor for many failed logins across many accounts from one source (spraying) and for logins from unusual places.
- Hash correctly in any application you build.
Example lockout settings for a Windows standalone host and a Linux host using pam_faillock:
net accounts /lockoutthreshold:10 /lockoutwindow:15 /lockoutduration:15
# /etc/security/faillock.conf
deny = 10
fail_interval = 900
unlock_time = 900
Tip: password auditing (for example checking your domain's hashes against breached lists) is a legitimate defensive task, but it handles very sensitive data. Do it only with written approval and a clear process.
Practice
Why does per-account lockout fail to stop password spraying?
What does a salt protect against?
Which single control prevents most account takeovers from stolen passwords?
Key takeaways
- Online attacks include guessing, spraying, stuffing and MFA fatigue.
- Offline cracking targets stolen hashes and is not limited by lockout.
- Store passwords with a slow, salted algorithm such as Argon2id or bcrypt.
- MFA, long unique passwords and breached-password checks stop most attacks.
- Monitor for spraying patterns across many accounts.
Original content written by Mohamed Fayas for FM TecHub. © 2026 FM TecHub. You're welcome to share a link to this page; please don't copy the text elsewhere without permission.