LSASS Architecture
LSA process internals, authentication packages, Security Support Providers, credential caching in memory, and why LSASS is the primary target for credential theft.
An analyst sees Sysmon Event 10: SourceImage: C:\Users\Public\mimikatz.exe → TargetImage: C:\Windows\System32\lsass.exe, GrantedAccess: 0x1010. That's PROCESS_QUERY_LIMITED_INFORMATION + PROCESS_VM_READ — the exact access rights Mimikatz uses to read LSASS memory. The analyst now knows: credentials may have been exfiltrated. But to understand why reading LSASS memory yields plaintext passwords, you need to understand what LSASS actually stores and why.
LSASS Role in Windows Authentication
LSASS (Local Security Authority Subsystem Service) is the Windows authentication broker. Every interactive logon, network authentication, and privilege check passes through it. Running as a protected process in lsass.exe, it:
- Loads Authentication Packages (APs) as DLLs
- Maintains the session key material and cached credentials for each logged-on user
- Enforces local security policy (account lockouts, privilege assignment)
- Issues access tokens after successful authentication
LSASS Authentication Flow
══════════════════════════════════════════════════════════════════
User logs in
│
▼
WinLogon.exe ──────────────────────────────────────►
(receives credentials from UI) │ LsaLogonUser()
▼
┌──────────────────┐
Loaded Authentication Packages │ lsass.exe │
──────────────────────────────── │ │
msv1_0.dll (NTLM) │ LSA Core │
kerberos.dll (Kerberos v5) ◄────────────│ Routes auth to │
wdigest.dll (Digest / HTTP) │ correct AP │
tspkg.dll (CredSSP) │ │
livessp.dll (Live ID) │ Credential cache│
cloudap.dll (AAD / Azure) │ (in-memory) │
└────────┬─────────┘
│ Access token
▼
User session begins
Authentication Packages
| Package | DLL | Protocol | What it caches in LSASS memory |
|---|---|---|---|
| MSV1_0 | msv1_0.dll | NTLM / NTLMv2 | NT hash (MD4 of password) |
| Kerberos | kerberos.dll | Kerberos v5 | Kerberos tickets (TGT + service tickets) |
| Wdigest | wdigest.dll | HTTP Digest / SASL | Plaintext password (required by protocol) |
| CredSSP / TSpkg | tspkg.dll | RDP CredSSP | Plaintext password for RDP session |
| LiveSSP | livessp.dll | Microsoft Account | Encrypted credential |
| CloudAP | cloudap.dll | Azure AD / AAD | PRT (Primary Refresh Token), encrypted |
The Digest authentication protocol requires the server to recompute a hash from the plaintext password. This means Wdigest.dll must keep the plaintext available in LSASS memory. On Windows 7 / Server 2008R2, Wdigest was enabled by default. On Windows 8.1 / Server 2012R2+, it's disabled by default — but an attacker with local admin can re-enable it, wait for a re-logon, and then harvest plaintext passwords. Mimikatz's sekurlsa::wdigest exploits exactly this.
Credential Material in LSASS Memory
LSASS Memory — LogonSession Structure
══════════════════════════════════════════════════════════════════
For each interactive/network logon, LSASS maintains a LogonSession:
┌─────────────────────────────────────────────────────────────┐
│ LogonSession │
│ LogonId : {0x0, 0x12345} (LUID) │
│ Username : "alice" │
│ DomainName : "CORP" │
│ LogonType : Interactive (2) │
│ │
│ Credential containers (per-AP): │
│ ┌──────────────┐ ┌──────────────┐ ┌───────────────────┐ │
│ │ MSV1_0 │ │ Wdigest │ │ Kerberos │ │
│ │ NTHash: │ │ Password: │ │ TGT: │ │
│ │ aabbcc... │ │ "P@ssw0rd!" │ │ [encrypted blob] │ │
│ │ (MD4 hash) │ │ (plaintext) │ │ Expires: 10h │ │
│ └──────────────┘ └──────────────┘ └───────────────────┘ │
└─────────────────────────────────────────────────────────────┘
This entire structure lives in lsass.exe virtual memory.
Read lsass.exe memory → extract all of the above.
LSASS Memory Access Patterns
Credential dumping tools read LSASS memory using the Windows process API. The typical access pattern:
| Step | API Call | Access Rights | Sysmon Event |
|---|---|---|---|
| Open process handle | OpenProcess(lsass PID) | PROCESS_VM_READ | PROCESS_QUERY_INFORMATION | Event 10 — ProcessAccess |
| Read memory | ReadProcessMemory(lsass handle, addr) | Requires PROCESS_VM_READ | No dedicated event; covered by handle in Event 10 |
| Create dump | MiniDumpWriteDump(lsass handle) | Requires PROCESS_VM_READ + PROCESS_QUERY_INFORMATION | Event 10 with GrantedAccess 0x1FFFFF (PROCESS_ALL_ACCESS) |
Detection Rules
title: LSASS Memory Read Access
status: stable
logsource:
product: windows
category: process_access
definition: 'Sysmon Event ID 10'
detection:
selection:
TargetImage|endswith: '\lsass.exe'
GrantedAccess|contains:
- '0x1010' # QUERY_LIMITED + VM_READ (Mimikatz)
- '0x1410' # QUERY_INFORMATION + VM_READ
- '0x143a' # multiple rights
- '0x1fffff' # PROCESS_ALL_ACCESS
filter_legitimate:
SourceImage|startswith:
- 'C:\Windows\System32\'
- 'C:\Windows\SysWOW64\'
condition: selection and not filter_legitimate
falsepositives:
- AV/EDR products reading LSASS for security scanning
- Crash dump tools on debug systems
level: critical
LSASS Protections
| Protection | How it works | Bypass |
|---|---|---|
| LSA Protection (PPL) | lsass.exe runs as Protected Process Light — only other protected processes can open it with high rights | BYOVD (bring your own vulnerable driver) to load kernel code that disables PPL |
| Credential Guard | Kerberos TGTs and NTLM hashes stored in isolated VM (VSM) — LSASS can't access them even if read | If not fully deployed, still extracts from non-isolated packages |
| Disable Wdigest | HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest → UseLogonCredential = 0 | Set UseLogonCredential = 1 and wait for re-logon |
| ETW Threat Intelligence | Microsoft-Windows-Threat-Intelligence ETW provider logs LSASS access in kernel — can't be tampered from user mode | Nothing from user mode; requires kernel access |
Q & A
Q: Why does Credential Guard protect against pass-the-hash but not against all credential theft?
Credential Guard moves NTLM hashes and Kerberos credentials into a hardware-isolated Virtual Secure Mode (VSM) enclave. The LSASS process can request authentication operations via RPC, but the raw credential material never appears in LSASS memory. Reading LSASS memory with Mimikatz yields empty credential fields for protected credentials. However: (1) Wdigest credentials (plaintext passwords) are not protected by Credential Guard — they live in regular LSASS memory. (2) Any credential not enrolled in VSM (e.g., from a non-domain logon) is still in plain LSASS memory. (3) If Credential Guard is not properly configured or hardware requirements aren't met, it may silently fall back. So Credential Guard is not a complete solution — it's one layer.
Q: Sysmon Event 10 shows lsass.exe as TargetImage with GrantedAccess 0x1010 from a process in C:\Windows\System32. Is this malicious?
Probably legitimate — many Windows components and AV/EDR products access LSASS memory as part of normal operation. The filter in the Sigma rule excludes sources from System32/SysWOW64 for exactly this reason. However: attackers can copy their tools to System32 (requires admin), or inject into a legitimate System32 process to use it as the source. For a high-confidence alert: focus on GrantedAccess values of 0x1FFFFF (all access) from System32, which is unusual even for legitimate tools. Also examine CallTrace — Sysmon logs the call stack for Event 10; unbacked memory (no module) in the call trace indicates reflective injection.