LSASS
LSASS Processes
The Local Security Authority Subsystem Service (LSASS) is a critical Windows process that handles authentication and security policies. For penetration testers and security professionals, understanding LSASS and how to interact with it can be invaluable for credential extraction during authorized security assessments.
Understanding LSASS
LSASS (lsass.exe) is responsible for several key security functions:
Authenticating users for local and remote logons
Enforcing local security policies
Generating access tokens
Writing to Windows security log
Handling password changes
Caching credentials for domain authentication when the domain controller is unavailable
Most importantly for security professionals, LSASS caches credentials in memory, making it a high-value target during security assessments.
LSASS Process Information
LSASS runs as a Windows system process with the following characteristics:
Process name:
lsass.exeDefault location:
C:\Windows\System32\lsass.exeRuns as
NT AUTHORITY\SYSTEMProcess is protected by various Windows security features in modern systems
Dumping LSASS Memory
There are several methods to extract credentials from LSASS memory. All of these methods require administrative privileges.
Method 1: Task Manager
The simplest (but most detectable) method uses Windows Task Manager:
Open Task Manager (right-click Taskbar → Task Manager or Ctrl+Shift+Esc)
Navigate to the "Details" tab
Find
lsass.exein the listRight-click → "Create dump file"
The dump will be saved to
%TEMP%\lsass.DMP
Method 2: Process Explorer
Sysinternals Process Explorer provides a similar but more feature-rich option:
Download and run Process Explorer
Find
lsass.exein the process listRight-click → "Create Dump" → "Create Full Dump"
Method 3: Using PowerShell
PowerShell can be used to create memory dumps with the Debug-Process cmdlet:
Where 672 is the process ID of LSASS from the first command. This technique is commonly used because it leverages built-in Windows components.
Method 4: Using Mimikatz
Mimikatz is a specialized tool for extracting credentials:
Method 5: Procdump from Sysinternals
Microsoft's ProcDump can create process dumps while avoiding many security detections:
Extracting Credentials from LSASS Dumps
Once you have the memory dump, you need to extract the credentials.
Using Mimikatz
Example output:
Using pypykatz (Linux)
pypykatz is a Python implementation of Mimikatz that works on Linux systems:
Example output:
Types of Credentials in LSASS
LSASS stores various types of credentials:
NTLM Hashes: The primary format for Windows password storage
Kerberos Tickets: Used for Single Sign-On in domains
Plaintext Passwords: In some configurations, plaintext passwords may be recoverable
Cached Domain Credentials: Stored for offline domain authentication
Service Account Credentials: For background services and scheduled tasks
Defensive Measures Against LSASS Credential Dumping
Windows Built-in Protections
Modern Windows systems include several protections against LSASS credential theft:
LSA Protection (RunAsPPL): Prevents direct memory access to LSASS
Credential Guard: Uses virtualization-based security to isolate secrets
Protected Process Light (PPL): Enhanced process protection
Detection Strategies
Security teams often monitor for these indicators of LSASS dumping:
Process access monitoring for lsass.exe
Creation of dump files
Use of tools like Mimikatz, ProcDump, or Task Manager dump functionality
Unusual handle creation to LSASS
Command-line monitoring for suspicious parameters
Bypassing LSASS Protections
During authorized penetration tests, you might encounter systems with LSASS protections. Here are some bypass techniques (use only with permission):
Bypassing RunAsPPL
Using Direct Physical Memory Access
Remote Access
Attack-Defense Scenario
To illustrate the importance of LSASS protection, consider this example scenario:
Initial Access: Attacker gains administrator access to a workstation
Credential Harvesting: Dumps LSASS memory using rundll32.exe technique
Defensive Monitoring: Security team detects the LSASS memory access
Lateral Movement: Attacker uses harvested domain credentials to move laterally
Defensive Response: Security team isolates affected systems
Remediation: Domain-wide password reset to invalidate stolen credentials
Best Practices for Security Testing
When performing authorized LSASS credential extraction:
Document all activities: Keep detailed records of all credential extraction
Handle with care: Treat extracted credentials as highly sensitive
Clean up: Remove dump files after analysis
Report findings: Document the ability to extract credentials in your report
Recommend mitigations: Suggest appropriate protections like Credential Guard
LSASS Protection Verification
To verify if LSASS protection is enabled on a system:
Conclusion
LSASS credential extraction remains a critical technique in penetration testing and security assessments. Understanding how LSASS stores credentials, the methods to extract them, and the protective measures available helps security professionals evaluate an organization's security posture against credential theft attacks.
Remember that LSASS credential dumping should only be performed with proper authorization during security assessments. Unauthorized extraction of credentials is illegal and unethical.
Last updated