LSASS, Stored Credentials and Credential Guard
Single sign-on is convenient because Windows remembers. You type your password once in the morning, and for the rest of the day file shares, intranet sites and mail open without asking. Something has to keep the material that makes that work, and that something is the Local Security Authority Subsystem Service, lsass.exe. It holds password-derived keys and Kerberos tickets for everyone signed in to the machine, including any administrator who connected interactively to fix something. That is why "dump LSASS" is the most common step in Windows intrusions after the first foothold, and why Windows has spent a decade building walls around it.
This lesson explains what is stored where and in which form, why some of those forms are as good as the password, how reading them is detected, and what protects them. It names the tools attackers use (Mimikatz, Impacket's secretsdump, the many LSASS "dumpers") only to describe what defenders see; it shows no way to run them.
Where Windows keeps credential material
| Store | Where | What is in it | Who can read it |
|---|---|---|---|
| LSASS memory | process lsass.exe |
for signed-in users: NT hash, Kerberos keys and tickets; cleartext only if WDigest or another legacy provider is enabled | SYSTEM, or an admin with SeDebugPrivilege (unless LSA protection or Credential Guard is on) |
| SAM | HKLM\SAM (file config\SAM) |
local accounts' NT hashes | SYSTEM; a copy plus the SYSTEM hive decrypts them |
| LSA secrets | HKLM\SECURITY |
passwords of services running as user accounts, the machine account password, auto-logon passwords | SYSTEM |
| Cached domain logons | HKLM\SECURITY\Cache |
a slow, salted verifier (DCC2) of the last N domain users, for offline sign-in | SYSTEM |
| NTDS.dit | on every DC, C:\Windows\NTDS\ntds.dit |
NT hashes and Kerberos keys of every account in the domain, including krbtgt |
SYSTEM on a DC; anyone with backup rights to a DC or replication rights (DCSync) |
| DPAPI / Credential Manager | user profile | saved browser, RDP and network passwords, protected by keys derived from the user's password (and backed up by a domain key) | the user, and holders of the domain DPAPI backup key |
Why the NT hash is "password-equivalent"
The NT hash is MD4 over the password encoded as UTF-16 little-endian. There is no salt and no iteration count. Two facts follow, and the program shows both with lab passwords:
- NTLM authentication (see NTLM Step by Step) uses the NT hash as its key, never the password. So whoever has the hash can authenticate as the user without knowing the password: pass-the-hash. Kerberos RC4 keys are the same value, so the hash also works there.
- Equal passwords give equal hashes on every machine and in every domain, so a single precomputed table covers everyone. For defenders that is also useful: an audit of NTDS hashes finds shared passwords between accounts in one pass (tools such as DSInternals'
Test-PasswordQualitydo this).
Cached domain logons use DCC2 instead: the NT hash and the lower-case user name are hashed again and then run through PBKDF2-HMAC-SHA1 with 10,240 iterations, salted by the user name. A DCC2 value can't be used to authenticate, and guessing it is thousands of times slower.
from Crypto.Hash import MD4
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives.kdf.pbkdf2 import PBKDF2HMAC
def nt_hash(password: str) -> bytes:
return MD4.new(password.encode("utf-16-le")).digest()
def dcc2(password: str, user: str) -> bytes:
name = user.lower().encode("utf-16-le")
dcc1 = MD4.new(nt_hash(password) + name).digest()
return PBKDF2HMAC(hashes.SHA1(), length=16, salt=name, iterations=10240).derive(dcc1)
lab = [("alice", "Winter2026!"), ("bob", "Winter2026!"), ("svc-sql", "Sql-Lab-Only-7")] # lab-only passwords
print("account NT hash (unsalted) DCC2 (salted with the user name)")
for user, pw in lab:
print(f"{user:8} {nt_hash(pw).hex()} {dcc2(pw, user).hex()}")
seen = {}
for user, pw in lab:
seen.setdefault(nt_hash(pw), []).append(user)
for h, users in seen.items():
if len(users) > 1:
print("shared password detected by equal NT hashes:", ", ".join(users))
print("work per guess: NT hash = 1 MD4; DCC2 = 2 MD4 + PBKDF2 with 10240 HMAC-SHA1 iterations")account NT hash (unsalted) DCC2 (salted with the user name)
alice 186f5176db2c519a7b29b47a5437a4ad 5df82201ed197ea597633aab4f5c883e
bob 186f5176db2c519a7b29b47a5437a4ad 6d25bc34944f0b301d7ff45dd18dd5d3
svc-sql a9c1343f0bd364aa7880f6dc4ac0be09 d1e12bf19a4cd3cb8b0d32b43839621d
shared password detected by equal NT hashes: alice, bob
work per guess: NT hash = 1 MD4; DCC2 = 2 MD4 + PBKDF2 with 10240 HMAC-SHA1 iterations
Alice and Bob chose the same password, and their NT hashes are identical while their DCC2 values are not, because the user name is the salt. Each DCC2 guess costs over ten thousand HMAC computations instead of one MD4, so offline guessing of cached logons is thousands of times slower than guessing NT hashes.
How credential theft is detected
- Process access to LSASS. Sysmon event 10 (ProcessAccess) with
TargetImageending in\lsass.exeand aGrantedAccessthat includes memory read (0x0010, often seen as0x1010or0x1410), from a process that is not a known security or management agent. With a SACL on LSASS, 4656/4663 record the same. Microsoft Defender and other EDRs alert on this pattern by default. - Dump files. Sysmon 11 (file created) for
*.dmpfiles written by unusual processes, and 4688 process creation for system binaries started with arguments that create a memory dump of another process (debugging utilities, thecomsvcs.dllmini-dump export, Task Manager's "Create dump file" onlsass.exe). - Offline copies of hives and NTDS.dit. 4688 for
reg.exe saveofSAM,SYSTEMorSECURITY, for volume shadow copy creation followed by file copies from the shadow, and forntdsutilcreating installation media on a DC; ESENT events in the Application log when a copy of the database is opened. - Use of stolen material. Pass-the-hash shows as 4624 logon type 3 with
NTLMas the authentication package for accounts that normally use Kerberos, or type 9 (NewCredentials,seclogo) on the source machine; the detection pipeline builds rules for these.
How it is prevented
- Credential Guard moves the NT hashes and Kerberos keys of signed-in users into an isolated process (
LsaIso.exe) protected by virtualisation-based security. Even SYSTEM in the normal OS can't read them. It is enabled by default on domain-joined Windows 11 22H2 and later devices with Enterprise or Education licences, and on Windows Server 2025 member servers, when the hardware meets the requirements. It protects NTLM hashes, Kerberos TGTs and saved domain credentials; it doesn't protect the SAM, the LSA secrets of services, NTDS.dit or credentials typed into a keylogger, and Microsoft doesn't recommend it on domain controllers, where it adds no protection. - LSA protection (
RunAsPPL, registry settings) makes LSASS a protected process that unsigned code can't open, raising the bar for dumping. - Don't leave credentials behind. Administrators sign in to workstations only with accounts of the workstation tier (tiering); remote administration uses network logons (PowerShell remoting, MMC) that don't cache reusable credentials, or Restricted Admin / Remote Credential Guard for RDP; members of Protected Users get no NTLM hash or long-term key cached at all.
- Fewer cached logons on servers (
CachedLogonsCount0–2) and laptops (as few as roaming needs). - Unique local admin passwords (Windows LAPS) so one SAM hash opens one machine, not all of them.
Pitfalls
- "We have Credential Guard, so pass-the-hash is solved." Only for users whose secrets were in LSASS on protected machines. Service account passwords in LSA secrets, local SAM hashes and anything taken from a DC are untouched.
- Debug-privilege exceptions. Developers and backup software often hold
SeDebugPrivilege; every exception is a hole. - Treating DCC2 as harmless. It can't be passed, but weak passwords still fall to offline guessing.
- Signing in to a suspect machine with a domain admin account to investigate it: you hand the attacker the credentials you are trying to protect. Use a network logon from a clean admin workstation.
Practice
1. The NT hash of a password is the same on every Windows machine. Name one way defenders use this, and one way attackers do.
Defenders compare NTDS hashes to find shared and known-breached passwords. Attackers reuse one stolen hash against every machine that shares the password (pass-the-hash), and use precomputed tables for common passwords.
2. A Sysmon 10 shows SourceImage C:\Users\Public\t.exe, TargetImage C:\Windows\System32\lsass.exe, GrantedAccess 0x1010. What do you conclude?
An unknown program in a world-writable folder opened LSASS with query-limited-information (0x1000) and memory-read (0x0010) rights: the signature of a credential dump. Isolate the machine, reset the credentials of everyone who had signed in to it, and find how t.exe arrived.
3. Why doesn't Credential Guard stop the theft of a service account's password on a server?
Services that run as user accounts keep their passwords in LSA secrets (HKLM\SECURITY), not in the isolated LSA process. Replace them with gMSAs.
Test yourself
How is the NT hash computed?
- SHA-256 of the password with a random salt
- MD4 of the UTF-16LE password, no salt
- PBKDF2 with 10,240 iterations
- bcrypt cost 12
Which Sysmon event ID records one process opening another, such as access to lsass.exe?
- 1
- 3
- 10
- 13
Which store holds the keys of every account in the domain?
- The SAM of each workstation
- NTDS.dit on every domain controller
- The user's Credential Manager
- The Kerberos ticket cache
What does Credential Guard protect?
- Everything on the machine
- Signed-in users' NT hashes and Kerberos keys, by isolating them in a VBS-protected process
- The SAM database
- NTDS.dit on domain controllers