22.8 Password Spraying
Example first. In January 2024, Microsoft said a Russian state hacking group called Midnight Blizzard broke into its corporate email. The attackers did not use a clever new bug. They used password spraying on an old test account. That account had no MFA. From there, they read emails of some senior leaders.
Why it matters
Most companies lock an account after a few wrong passwords. So guessing many passwords for one person fails fast. Spraying gets around this lock. It is quiet, cheap and it still works, because many people pick weak passwords.
What it is
Password spraying means trying one common password on many accounts. Then the attacker waits, and tries the next password. Each account sees only one or two wrong tries. So no account gets locked.
| Word | Simple meaning |
|---|---|
| Account lockout | The system blocks an account after too many wrong passwords, for example 5. |
| Brute force | Many passwords tried on one account. Lockout stops it. |
| Credential stuffing | Trying real username and password pairs leaked from another website. |
| MFA | Multi-factor authentication. A second proof, like a code on your phone, after the password. |
| Sign-in log | A record of every login try: who, when, from which IP address, success or fail. |
| Attack | Accounts | Passwords per account |
|---|---|---|
| Brute force | 1 | Thousands |
| Password spraying | Thousands | 1 or 2 |
| Credential stuffing | Many | 1 leaked pair each |
How to defend against it
- Turn on MFA for every account, including old test and service accounts.
- Block common passwords. For example, Microsoft Entra ID Password Protection can ban words like the company name.
- Find and delete old accounts nobody uses.
- Watch sign-in logs. One IP failing on many different users is the main sign.
- Send that pattern to your SIEM as an alert (Chapter 31).
Worked examples
Worked example 1: The maths of spraying
A company has 1,000 staff. Lockout is after 5 wrong tries.
- The attacker tries
Welcome@123once on all 1,000 accounts. - Each account sees only 1 wrong try. Nobody is locked.
- If just 3 people use that password, the attacker now has 3 working logins.
- Next hour, the attacker tries
Pune@2024on all accounts.
Worked example 2: Spot it in a Linux log
On your own lab server, failed SSH logins go to /var/log/secure. Count how many different users each IP tried.
sudo grep 'Failed password' /var/log/secure \
| awk '{for(i=1;i<=NF;i++) if($i=="from") print $(i+1), $(i-1)}' \
| sort -u | awk '{print $1}' | uniq -c | sort -rn | head
Read it like this: an IP with many different user names is spraying. An IP with one user name and many tries is brute force.
Worked example 3: Spot it in the cloud
In Microsoft Entra ID or AWS CloudTrail, look for this pattern:
- Same IP address, or a small group of IPs.
- Many different user names.
- Mostly fails, a few successes.
- A success with no MFA is the most urgent. Reset that password first.
Real incident: Microsoft corporate email – Midnight Blizzard (January 2024)
1. What happened
Microsoft found the attack on 12 January 2024. A Russian state group got into a small number of corporate email accounts, including some senior leaders and security staff.
2. How it happened
- The attackers used password spraying against an old, non-production test account.
- That account had no MFA.
- They used the account's access to reach corporate email.
3. How to stop it
- MFA on every account, even test accounts.
- Remove or lock old accounts.
- Alert on one source trying many accounts.
In short
- Spraying = one common password, many accounts.
- It avoids lockout because each account sees very few wrong tries.
- MFA, banned weak passwords and log alerts stop it.
- In logs: one IP, many users, mostly fails.