Pass the Ticket with Mimikatz
Mimikatz is a popular and powerful post-exploitation tool, most commonly used for dumping user credentials inside an Active Directory network. Here we use it to dump a TGT from LSASS memory.
This is only an overview of how pass the ticket attacks work, as THM does not currently support networks, but I challenge you to configure this on your own network.
You can run this attack on the given machine, but you will be escalating from a domain admin to a domain admin because of the way the domain controller is set up.
Pass the Ticket Overview
Pass the ticket works by dumping the TGT from the LSASS memory of the machine. The Local Security Authority Subsystem Service (LSASS) is a memory process that stores credentials on an Active Directory server. It can store Kerberos tickets along with other credential types and acts as the gatekeeper, accepting or rejecting the credentials provided. You can dump the Kerberos tickets from LSASS memory just like you can dump hashes. When you dump the tickets with Mimikatz it gives us a .kirbi ticket, which can be used to gain domain admin if a domain admin ticket is in LSASS memory.
This attack is great for privilege escalation and lateral movement if there are unsecured domain service account tickets lying around. It lets you escalate to domain admin if you dump a domain admin's ticket and then impersonate it using Mimikatz's PTT attack, allowing you to act as that domain admin. Think of a pass the ticket attack as reusing an existing ticket: we are not creating or destroying any tickets, simply reusing an existing ticket from another user on the domain and impersonating it.
Prepare Mimikatz & Dump Tickets
You will need to run the command prompt as an administrator using the same credentials you used to get into the machine. If you don't have an elevated command prompt, Mimikatz will not work properly.
cd Downloads
mimikatz.exe
privilege::debug
cd Downloads- navigate to the directory Mimikatz is in.mimikatz.exe- run Mimikatz.privilege::debug- ensure this outputs [output '20' OK]. If it does not, you do not have the administrator privileges to properly run Mimikatz.
Then export the tickets:
sekurlsa::tickets /export
sekurlsa::tickets /export exports all of the .kirbi tickets into the directory that you are currently in.
At this step you can also use the base64 encoded tickets from Rubeus that we harvested earlier.
When looking for which ticket to impersonate, I would recommend an administrator ticket from the krbtgt, just like the one outlined in red above.
Pass the Ticket w/ Mimikatz
Now that we have our ticket ready we can perform a pass the ticket attack to gain domain admin privileges.
kerberos::ptt <ticket>
klist
kerberos::ptt <ticket>- run this inside Mimikatz with the ticket you harvested earlier. It caches and impersonates the given ticket.klist- verify that we successfully impersonated the ticket by listing our cached tickets.
We will not be using Mimikatz for the rest of the attack.
You have now impersonated the ticket, giving you the same rights as the TGT you're impersonating. To verify this we can look at the admin share.
This is only a POC to understand how to pass the ticket and gain domain admin. The way you approach passing the ticket may be different based on the kind of engagement you're in, so do not take this as a definitive guide to running this attack.
Pass the Ticket Mitigation
A little blue team, and how to mitigate these types of attacks.
- Don't let your domain admins log onto anything except the domain controller. This is something so simple, yet a lot of domain admins still log onto low-level computers, leaving tickets around that we can use to attack and move laterally with.