LaZagne
Post-exploitation credential recovery tool that extracts stored passwords from browsers, WiFi, email clients, Windows credentials, databases, and sysadmin tools. Works on both Windows and Linux.
What is it?
LaZagne is a credential harvester. After you gain access to a machine, LaZagne searches for passwords that applications have stored, browser saved passwords, WiFi passwords, email credentials, database connection strings, and more.
The key insight: users save passwords everywhere. Browsers auto-save login forms. Email clients remember IMAP credentials. WiFi profiles store PSKs. Database tools save connection strings. LaZagne knows where each application stores these secrets and how to decrypt them.
This is different from Mimikatz, which pulls credentials from memory (LSASS). LaZagne pulls credentials from stored locations on disk: browser databases, registry keys, config files. You can think of it as:
- Mimikatz = credentials in memory (what's being used right now)
- LaZagne = credentials on disk (what's been saved for later use)
Running both gives you the most complete picture of available credentials on a compromised host.
Run this first
Run it with no arguments to check every supported source at once.
C:\> lazagne.exe all
allchecks every module: browsers, WiFi, Windows credentials, databases and more.
It prints whatever it finds for the current user. If you are SYSTEM or a different account, re-run it as the target user, because LaZagne only reads that account's saved credentials.
When do you use it?
LaZagne is a post-exploitation tool. You run it after you have a shell on a machine. The typical scenario:
- You've compromised a workstation and want to find passwords the user has saved in browsers, email, etc.
- You need lateral movement credentials: saved passwords often work on other machines (password reuse)
- Mimikatz didn't find what you need: the user logged in with a smart card or the password isn't in LSASS memory
- You're on a Linux box: LaZagne works on Linux too, finding credentials in .ssh, browsers, databases, etc.
- You want application-specific creds: database connection strings, FTP/SFTP saved sessions, email server passwords
On every compromised Windows host, run these in order: 1) Mimikatz (LSASS memory), 2) LaZagne (stored creds), 3) SessionGopher (saved sessions). Each finds different credentials. A browser password from LaZagne might be the same password used for their domain account, password reuse is extremely common.
Running LaZagne
Windows: run all modules
# Run all modules: this is what you want 99% of the time C:\> lazagne.exe all # Output to a file (useful for large amounts of found creds) C:\> lazagne.exe all -oN # -oN creates a file in the current directory with results # Format: credentials_YYYY-MM-DD_HH-MM-SS.txt
Specific modules only
# Only browser passwords C:\> lazagne.exe browsers # Only WiFi passwords C:\> lazagne.exe wifi # Only Windows credential manager C:\> lazagne.exe windows # Only sysadmin tools (FileZilla, WinSCP, etc.) C:\> lazagne.exe sysadmin # Only database tools C:\> lazagne.exe databases
Linux
# Run all modules on Linux $ python3 laZagne.py all # Linux checks: .ssh keys, browser passwords, database configs, # /etc/shadow (if readable), gnome keyring, etc.
Key modules and what they find
| Module | What it searches | Why it matters |
|---|---|---|
| browsers | Chrome, Firefox, Edge, IE saved passwords | Users save everything: email, banking, internal apps, VPNs. Often reuses same password for domain account |
| wifi | Saved WiFi PSKs | Corporate WiFi passwords can be WPA2-Enterprise creds (domain creds!) |
| windows | Credential Manager, Vault, DPAPI | Windows stores RDP passwords, mapped drive creds, and cached tokens here |
| sysadmin | FileZilla, WinSCP, PuTTY, OpenVPN | IT staff save server passwords in these tools. Gold for lateral movement |
| databases | SQL Server, MySQL Workbench, pgAdmin, SQLite | Database connection strings contain passwords for production databases |
| mails | Outlook, Thunderbird stored credentials | Email passwords; might be domain creds. Also look at sent emails for other passwords |
| git | Git credential stores | GitHub/GitLab tokens and passwords. Can access source code repos |
Reading the output
|====================================================================| | | | The LaZagne Project | | | | ! MUSIC EDITION ! | | | |====================================================================| ########## User: jsmith ########## ------------------- Chromium passwords ----------------- [+] Password found !!! URL: https://mail.corp.local/owa Login: jsmith@corp.local Password: Summer2024! [+] Password found !!! URL: https://gitlab.corp.local Login: j.smith Password: Summer2024! [+] Password found !!! URL: https://vpn.corp.local Login: jsmith Password: C0rpVPN#2024 ------------------- Wifi passwords --------------------- [+] Password found !!! SSID: CORP-WIFI Password: WirelessKey2024! ------------------- Windows credentials ---------------- [+] Password found !!! Target: Domain:target=TERMSRV/fileserver01 Username: CORP\jsmith Password: Summer2024! [+] 5 passwords have been found.
- Password reuse: same password on multiple sites = likely their domain password too
- Internal URLs: mail.corp.local, gitlab.corp.local reveal internal services you might not have found yet
- VPN credentials: could provide network access from outside
- Database passwords: direct access to production data
- Saved RDP credentials: the TERMSRV entries in Windows Credential Manager mean they RDP to those servers. Those are your next targets
What to do with found credentials
Every password LaZagne finds is a potential lateral movement opportunity:
- Test for domain password reuse: if they saved "Summer2024!" in Chrome, try it against their domain account with kerbrute or crackmapexec
- Try saved creds on other machines:
crackmapexec smb 10.10.10.0/24 -u jsmith -p 'Summer2024!' - Access new services: VPN creds, database creds, and git tokens open entirely new attack surfaces
- Add to your password list: build a custom wordlist from all found passwords for targeted cracking
- Check the URL list: internal URLs in browser passwords reveal services you might not have enumerated
LaZagne vs Mimikatz
| Feature | LaZagne | Mimikatz |
|---|---|---|
| Source of creds | Stored on disk (browser DBs, registry, config files) | In memory (LSASS process) |
| Requires admin | No: can find current user's saved passwords as standard user | Yes: needs SeDebugPrivilege to dump LSASS |
| Type of creds | Plaintext passwords from applications | NTLM hashes, Kerberos tickets, sometimes plaintext |
| Works offline | Yes: reads files and registry | No: needs running LSASS process |
| Cross-platform | Windows + Linux | Windows only |
| Detection risk | Lower: reads files, doesn't touch LSASS | Higher: accessing LSASS triggers most EDRs |
LaZagne and Mimikatz complement each other. Mimikatz gets you hashes for pass-the-hash attacks and Kerberos tickets. LaZagne gets you plaintext passwords for password spraying and accessing web apps. Run LaZagne first (doesn't need admin), then Mimikatz after you escalate.
Common mistakes
- Running as wrong user: LaZagne finds credentials for the current user. If you're running as SYSTEM, you won't find jsmith's browser passwords. Run as the target user, or run with
-uto specify another user's profile - Skipping it because you have admin: Even with admin/SYSTEM, LaZagne finds credentials that Mimikatz doesn't, browser passwords, WiFi keys, application-specific creds
- Not checking internal URLs: The URLs in browser passwords are enumeration gold, they reveal internal services, hostnames, and applications
- Ignoring "weak" finds: A WiFi password or a git token might seem unimportant, but corporate WiFi can use domain creds, and git tokens access source code with hardcoded secrets
- Not building a password list: Save every password you find into a custom wordlist. Users create passwords from patterns, if you find "Summer2024!", also try "Winter2024!", "Fall2024!", etc.
Check yourself
Answer each question out loud or on paper first, then open it. Retrieving the answer teaches you more than rereading the page.
You run LaZagne as SYSTEM looking for a specific user's browser passwords, and find nothing. Why?
You already have admin or SYSTEM. Is LaZagne still worth running?
LaZagne shows a saved password with a URL for an unfamiliar internal site. Why does that matter?
LaZagne finds a WiFi password and a git token. Worth keeping?
You find Summer2024!. What do you do with it beyond trying it directly?
Winter2024! and Fall2024!; people build passwords from patterns.