Reading Auth Logs for Password-Attack IoCs
How to spot online guessing, stolen passwords, password spraying, and credential stuffing in authentication logs, and why offline attacks stay invisible.
1Authentication logs
An authentication log (auth log) records every login attempt on a system: when, which account, from which address or device, and whether it succeeded. Online password attacks have to go through the login process, so they leave recognizable patterns here.
2Online guessing
A single user account with many wrong passwords is an indicator of an online password attack.
08:12:01 user=tnguyen FAIL src=198.51.100.23 08:12:03 user=tnguyen FAIL src=198.51.100.23 08:12:05 user=tnguyen FAIL src=198.51.100.23 08:12:07 user=tnguyen FAIL src=198.51.100.23 08:12:09 user=tnguyen FAIL src=198.51.100.23 08:12:11 user=tnguyen LOCKED (5 failures)
Five failures in 8 seconds from one outside address, then a lockout. A person mistyping does not try five times in eight seconds.
3Logins from the wrong place or time
If an authorized user logs in from a different location or IP address than expected, or at an unusual time, their password may have been compromised, even when there are no failed attempts at all.
Mon 08:31 user=pkhan OK src=10.10.4.22 (office laptop)
Tue 08:29 user=pkhan OK src=10.10.4.22 (office laptop)
Wed 03:12 user=pkhan OK src=203.0.113.240 (new device, another country)
Wed 08:33 user=pkhan OK src=10.10.4.22 (office laptop)
The Wednesday 03:12 login succeeded on the first try, from a new device in another country, while the user's normal pattern is the office laptop around 08:30. The attacker already had the right password.
4Password spraying
An indicator of password spraying is many different users trying to log in within seconds of each other, from one IP address or from unusual IP addresses. Each account sees only one failure, so per-account lockouts never trigger.
22:40:01 user=adiaz FAIL src=203.0.113.150
22:40:01 user=bfoster FAIL src=203.0.113.150
22:40:02 user=cgreene FAIL src=203.0.113.150
22:40:02 user=dhall OK src=203.0.113.150
22:40:03 user=eito FAIL src=203.0.113.150
22:40:03 user=fjames FAIL src=203.0.113.150
Six accounts in 2 seconds, all from 203.0.113.150. One login (dhall) succeeded: that account used the sprayed password.
5Credential stuffing
An indicator of credential stuffing is a series of default username and password combinations tried on a device in quick succession, often from the same IP address.
03:15:20 device=cam-lobby user=admin pass=admin FAIL src=192.0.2.66
03:15:21 device=cam-lobby user=admin pass=password FAIL src=192.0.2.66
03:15:21 device=cam-lobby user=admin pass=12345 FAIL src=192.0.2.66
03:15:22 device=cam-lobby user=root pass=root FAIL src=192.0.2.66
03:15:22 device=cam-lobby user=admin pass=1234 OK src=192.0.2.66
Common factory defaults (admin/admin, admin/password, root/root) tried within 2 seconds at 3 AM. The last one worked: the camera still had a default password.
6Offline attacks and stolen hash files
Offline password attacks cannot be detected in auth logs, because the guessing happens on the adversary's own computer against a stolen hash file. That is why, if a user:password hash database has been compromised, every password in it must be treated as insecure, and all users should be forced to reset their passwords, even with no suspicious logins yet.
| Pattern in the auth log | Indicates | Response |
|---|---|---|
| One user, many failures, seconds apart | Online guessing | Lockout is working; block the source; check if any attempt succeeded |
| Success from an unexpected place, device, or time | Compromised password | Reset the password; end sessions; review what the account did |
| Many users within seconds, one or unusual addresses | Password spraying | Block the source; reset any account that succeeded; ban common passwords |
| Default user:password pairs in quick succession | Credential stuffing | Change default credentials; block the source |
| (nothing visible) | Offline cracking of stolen hashes | If the hash file was stolen, force all users to reset |
Online password attacks leave shapes in the auth log: many failures on one account, many accounts at once, default pairs in a row, or a clean login from the wrong place. Offline attacks leave nothing, so a stolen hash file means everyone resets.
7Worked examples
Six accounts in two seconds
Using the spraying log above, identify the attack, the evidence, and the next steps.
- 1Six different accounts, each tried once, within 2 seconds, all from 203.0.113.150.
- 2Many users within seconds from one address is the pattern of password spraying.
- 3One account,
dhall, logged in successfully, so its password is the sprayed one. - 4Next: block the address, reset
dhall's password and end its sessions, and check what it accessed.
The camera at 3 AM
Using the camera's log above, what happened and how should it be fixed?
- 1Default pairs (
admin/admin,admin/password,admin/12345,root/root) tried in quick succession from one address. - 2That is credential stuffing with default credentials.
- 3
admin/1234succeeded: the camera never had its factory password changed.
The perfect login
Using the week of logins above, why is Wednesday 03:12 suspicious even though it was a successful login with no failures?
- 1The user normally logs in from the office laptop around 08:30.
- 2This login came from a new device in another country at 3 AM.
- 3No failed attempts means the attacker already knew the password, perhaps from phishing or a leak.
The stolen database
A company learns its database of password hashes was stolen two weeks ago. The auth logs show nothing unusual. What should it do?
- 1Offline attacks happen on the attacker's computer, so auth logs cannot show them.
- 2Every password in the stolen database must be treated as insecure.
- 3Force all users to reset their passwords, and encourage MFA.
8Common mistakes
A successful login from the wrong place or time can be the clearest sign of a stolen password.
Spraying puts one failure on each of many accounts. Look across accounts for bursts from one address.
Offline cracking leaves no trace. Reset all passwords as soon as the theft is known.
“The auth log shows six different accounts attempting to log in within two seconds, all from 203.0.113.150, with one success for dhall. This pattern indicates password spraying, and dhall's account is compromised. The address should be blocked and dhall's password reset.”
Quote the pattern, name the attack, and state the response.