Chapter 63

LSASS Architecture

LSA process internals, authentication packages, Security Support Providers, credential caching in memory, and why LSASS is the primary target for credential theft.

Scenario

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:


  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

PackageDLLProtocolWhat it caches in LSASS memory
MSV1_0msv1_0.dllNTLM / NTLMv2NT hash (MD4 of password)
Kerberoskerberos.dllKerberos v5Kerberos tickets (TGT + service tickets)
Wdigestwdigest.dllHTTP Digest / SASLPlaintext password (required by protocol)
CredSSP / TSpkgtspkg.dllRDP CredSSPPlaintext password for RDP session
LiveSSPlivessp.dllMicrosoft AccountEncrypted credential
CloudAPcloudap.dllAzure AD / AADPRT (Primary Refresh Token), encrypted
Why Wdigest is critical to understand

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:

StepAPI CallAccess RightsSysmon Event
Open process handleOpenProcess(lsass PID)PROCESS_VM_READ | PROCESS_QUERY_INFORMATIONEvent 10 — ProcessAccess
Read memoryReadProcessMemory(lsass handle, addr)Requires PROCESS_VM_READNo dedicated event; covered by handle in Event 10
Create dumpMiniDumpWriteDump(lsass handle)Requires PROCESS_VM_READ + PROCESS_QUERY_INFORMATIONEvent 10 with GrantedAccess 0x1FFFFF (PROCESS_ALL_ACCESS)

Detection Rules

YAMLlsass_memory_access.yml
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

ProtectionHow it worksBypass
LSA Protection (PPL)lsass.exe runs as Protected Process Light — only other protected processes can open it with high rightsBYOVD (bring your own vulnerable driver) to load kernel code that disables PPL
Credential GuardKerberos TGTs and NTLM hashes stored in isolated VM (VSM) — LSASS can't access them even if readIf not fully deployed, still extracts from non-isolated packages
Disable WdigestHKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest → UseLogonCredential = 0Set UseLogonCredential = 1 and wait for re-logon
ETW Threat IntelligenceMicrosoft-Windows-Threat-Intelligence ETW provider logs LSASS access in kernel — can't be tampered from user modeNothing 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.