Password spraying is an authentication attack in which an adversary tries a small number of common passwords against a large number of accounts, rather than many passwords against one account. In cybersecurity, it belongs to the family of credential attacks within malware & attacks, and it succeeds because every large organization has some users with weak passwords.
The technique is designed to evade account lockout policies. By spacing attempts so that each account sees only one or two failures per lockout window, the attacker stays below the threshold while still testing thousands of accounts. Password spraying is cataloged in MITRE ATT&CK as sub-technique T1110.003 under brute force.
How a password spraying attack works
A password spraying attack follows a predictable sequence: collect usernames, choose likely passwords, and test them slowly across every account. The attacker gains access as soon as one combination works, and a single valid account is often enough for initial access.
- Username harvesting. Attackers build lists from public staff directories, social networks, email format guessing and earlier breaches.
- Password selection. They pick passwords that satisfy common complexity rules yet remain predictable, such as a season plus a year or the company name plus a digit.
- Throttled attempts. Each password is tried once against every account, followed by a pause longer than the lockout observation window.
- Distribution. Requests are spread across many IP addresses, residential proxies or cloud hosts to avoid rate limits and reputation blocks.
- Exploitation. Valid credentials are used for email access, VPN logins or further reconnaissance.
Targets are usually internet-facing authentication endpoints that accept a username and password directly. Legacy protocols are especially attractive because they often bypass modern controls.
| Target endpoint | Why attackers choose it | Typical weakness |
|---|---|---|
| Cloud identity portals | One login opens email and files | MFA gaps for some users |
| Legacy mail protocols | IMAP, POP3 and SMTP AUTH skip MFA | Basic authentication still enabled |
| VPN gateways | Direct network access | Password-only logins |
| Remote desktop services | Interactive control of hosts | Exposed to the internet |
| Web applications | Custom logins with weak limits | No lockout or rate limiting |
Password spraying compared with other credential attacks
Password spraying differs from related attacks mainly in the ratio of passwords to accounts and in the source of the guesses. These differences determine which defenses work and which detection signals appear.
| Attack | Pattern | Main defense |
|---|---|---|
| Password spraying | Few passwords, many accounts | Banned password lists and MFA |
| Brute-force attack | Many passwords, one account | Account lockout and rate limiting |
| Credential stuffing | Leaked pairs replayed on other sites | Breached password detection and MFA |
| Dictionary attack | Wordlist against one account or hash | Long, unique passwords |
| Offline hash cracking | Guessing against stolen hashes | Strong hashing such as Argon2 |
The key distinction is that account lockout defeats brute force but not spraying. A lockout threshold of five failures in 30 minutes stops an attacker hammering one account, yet it never triggers when each account sees one attempt per hour.
Detecting password spraying
Detection depends on looking across accounts rather than within one. Per-account monitoring sees only isolated failures, so defenders correlate authentication logs by source, time window and password outcome.
| Signal | What it reveals | Limitation |
|---|---|---|
| Many accounts, one source | One IP failing against hundreds of users | Defeated by distributed proxies |
| Failure spike across tenant | Sudden rise in bad-password events | Noisy in large organizations |
| Logins to nonexistent users | Guessed or outdated usernames | Requires user-not-found logging |
| Legacy protocol attempts | Use of basic authentication | Only useful if legacy is rare |
| Success after many failures | A sprayed password worked | Detected only after compromise |
Identity providers increasingly offer built-in spray detection that uses machine learning across many customers. Even so, on-premises Active Directory environments require event correlation in a SIEM, typically using Windows events 4625 and 4771 for failed logons and Kerberos pre-authentication failures.
Defending against password spraying
The most effective defense is phishing-resistant multifactor authentication, because a correct password alone no longer grants access. Since MFA coverage is rarely complete, layered controls remain necessary.
- Ban predictable passwords with a custom list containing the company name, local sports teams, seasons and years, as NIST SP 800-63B recommends.
- Disable legacy authentication so that every login passes through conditional access and MFA.
- Use smart lockout that tracks failures by source and familiar locations instead of locking legitimate users out.
- Remove forced periodic password changes, which push users toward patterns such as Spring2026 followed by Summer2026.
- Move toward passwordless sign-in with FIDO2 security keys or passkeys, which removes the guessable secret entirely.
A common mistake is lowering lockout thresholds in response to an attack. Aggressive lockout turns spraying into a denial-of-service tool against the organization’s own users, while doing little to stop an attacker who already throttles requests.
Response planning matters as much as prevention. When spraying succeeds, defenders should reset affected passwords, revoke refresh tokens and active sessions, review mailbox forwarding rules and newly registered MFA methods, and check whether the attacker accessed other services with the same identity. Attackers who obtain one mailbox often launch internal phishing from it within hours, so containment speed directly limits the damage. Regular simulated spraying exercises against the organization’s own directory, run with approval, also reveal weak passwords before an adversary finds them.
In plain words
Password spraying is guessing a few popular passwords on many accounts. Imagine a thief with a ring of ten common keys. Instead of trying every key on one door, the thief tries one key on every door in a large building.
Each door is tried only once, so no alarm goes off. In a big organization, a few doors will open. The key takeaway: avoid predictable passwords and use a second sign-in step, so a guessed password is not enough.
A real-world example
A university with about 18,000 staff and student accounts notices a rise in failed sign-ins to its cloud email portal over a weekend. Its security analyst groups the failures by password hash outcome and time and sees a clear pattern: one attempt per account every 45 minutes, coming from more than 600 residential IP addresses. The lockout policy, set to ten failures, never triggered.
The analyst finds that nine accounts signed in successfully through a legacy IMAP endpoint that did not enforce MFA. All nine used variations of the university name followed by the current year. The team resets those passwords, revokes active sessions, disables legacy authentication for the whole tenant and adds the university name to its banned password list. Follow-up monitoring over the next month shows similar spray waves with zero successful logins.