Leaked Active Directory Passwords: What to Do, Step by Step
What to do in Active Directory when user passwords leak: find affected accounts, reset passwords with PowerShell, handle open sessions and prevent a repeat.
Most employee passwords don't leak from the organisation's own systems. They leak from somewhere else:
- Another site's breach. Someone signed up with their work email and reused their password. That site's database ends up online.
- Infostealer malware. Malware on a home or work machine collects the passwords saved in the browser and sells them.
- Phishing. The user types the password into a fake sign-in page.
If the leaked password matches the domain password, or is close to it, the Active Directory account is at risk. Here is the order we'd work in.
1. Which accounts are affected?
Leak data usually contains email addresses. Start by matching them to AD accounts. For a single address:
Get-ADUser -Filter "mail -eq 'john.smith@example.com'" -Properties mail, PasswordLastSet, Enabled |
Select-Object SamAccountName, mail, Enabled, PasswordLastSet
For a CSV file with an Email column:
Import-Csv .\leaked-addresses.csv | ForEach-Object {
Get-ADUser -Filter "mail -eq '$($_.Email)'" -Properties mail, PasswordLastSet
} | Select-Object SamAccountName, mail, PasswordLastSet |
Export-Csv .\affected-accounts.csv -NoTypeInformation -Encoding UTF8
Users who changed their password after the leak date (a newer
PasswordLastSet) are lower priority, though they may still have reused
the password elsewhere.
If any account in the list belongs to a privileged group such as Domain Admins, deal with it first.
2. Reset the passwords
For privileged accounts, don't wait for the user. Reset the password yourself:
Set-ADAccountPassword -Identity admin.account -Reset -NewPassword (Read-Host -AsSecureString "New password")
For everyone else, requiring a change at next sign-in is usually enough:
Import-Csv .\affected-accounts.csv | ForEach-Object {
Set-ADUser -Identity $_.SamAccountName -ChangePasswordAtLogon $true
}
Two things to watch:
- If "Password never expires" is set on the account,
-ChangePasswordAtLogonfails. Clear that flag first; see users whose password never expires. - Remote users can get stuck. Remote Desktop with NLA and some VPN clients don't offer a password change prompt, so the user can't sign in and calls the help desk.
3. Don't forget open sessions
Changing the password doesn't always end what an attacker already has. Kerberos tickets that were already issued can stay valid until they expire; the default maximum lifetime for a user ticket is 10 hours. Sessions in VPN, Outlook on the web and cloud apps have to be revoked in those systems.
If you suspect a privileged account, disabling it for a while
(Disable-ADAccount) is the safer first move.
4. Is the attack still going on?
Leaked passwords tend to be tried quickly. On domain controllers, look at:
- 4771: Kerberos pre-authentication failed (wrong password).
- 4776: NTLM credential validation.
- 4740: Account locked out, with the caller computer name.
- 4625: Failed sign-in on member servers and clients.
A few failures on each of many different accounts points to password
spraying. To trace where lockouts come from, use Find-LockoutSource.ps1
on the free tools page and read
account lockouts in Active Directory.
For threshold values, see
recommended lockout policy settings.
5. Keep it from happening again
- Check against breached passwords. NIST SP 800-63B requires new passwords to be compared against a blocklist of commonly used and known compromised values. It also requires a password change when there is evidence of compromise.
- Length over complexity. Review your password policy.
- A second factor on everything reachable from outside: VPN, email and remote access.
- Passwords that never expire are the doors left open the longest.
6. Find out before your users do
Everything above starts once you know about the leak. Most organisations find out after an attack, or when a user notices. Services that keep scanning leak sources and the dark web for your domain cut that time from days to hours.
ThreatPort's dark web credential monitoring finds leaked credentials tied to your domain and alerts you. ThreatPort is built by the same team as PRESS.
In PRESS
The hard part of a mass reset is the help desk queue. With PRESS, users reset their own password with an SMS one-time code sent to their phone, including remote users working from a browser.
- Admins can set a temporary password from the panel; the user must change it at next sign-in.
- Accounts in privileged groups are excluded from self-service reset; only admins reset them.
- Every action is written to the audit log and can be forwarded to your SIEM over Syslog.
Try the reset flow in the live demo
Sources
- NIST SP 800-63B, Digital Identity Guidelines: Authentication and Authenticator Management: https://pages.nist.gov/800-63-4/sp800-63b.html
- Microsoft Learn, Maximum lifetime for user ticket: https://learn.microsoft.com/windows/security/threat-protection/security-policy-settings/maximum-lifetime-for-user-ticket
- Microsoft Learn, Set-ADUser: https://learn.microsoft.com/powershell/module/activedirectory/set-aduser
Evaluate PRESS in your own environment.
Through the live demo you can explore the user portal and the admin panel directly.