Pass the Hash (PtH) Attacks
π― Overview
Pass the Hash (PtH) is a lateral movement technique where an attacker uses a password hash instead of the plain text password for authentication. The attacker doesn't need to decrypt the hash to obtain a plaintext password, exploiting the NTLM authentication protocol where password hashes remain static until the password is changed.
"PtH attacks exploit the authentication protocol, as the password hash remains static for every session until the password is changed."
π§ Windows NTLM Authentication Protocol
NTLM Overview
Microsoft's Windows New Technology LAN Manager (NTLM) is a set of security protocols that:
Authenticates users' identities
Protects data integrity and confidentiality
Provides Single Sign-On (SSO) functionality
Uses challenge-response protocol for verification
NTLM Vulnerabilities
# Key weaknesses exploited in PtH attacks:
1. Passwords stored without salt on servers/domain controllers
2. Password hashes remain static between password changes
3. Hash can be used directly for authentication
4. Legacy compatibility requirements keep NTLM active
5. Challenge-response doesn't validate hash freshnessHash Acquisition Methods
πͺ Windows-Based Pass the Hash Attacks
1. Mimikatz - sekurlsa::pth Module
Basic Mimikatz PtH Syntax
Mimikatz PtH Execution
Post-Exploitation with Mimikatz
2. Invoke-TheHash - PowerShell PtH Framework
Invoke-TheHash Overview
Collection of PowerShell functions for PtH attacks
WMI and SMB execution methods available
.NET TCPClient for network connections
NTLMv2 authentication protocol implementation
No local admin required (client-side)
Required Parameters
SMB Method with Invoke-TheHash
WMI Method with Reverse Shell
π§ Linux-Based Pass the Hash Attacks
1. Impacket PtH Tools
impacket-psexec
Other Impacket PtH Tools
Advanced PtH + VSS Extraction
Scenario: Use existing compromised hash to extract additional credentials via Volume Shadow Copy
Why VSS + PtH is Powerful:
No LSASS dumping - VSS reads from disk, avoiding memory detection
Complete domain dump - Extract all domain user hashes at once
Stealth extraction - Uses legitimate Windows VSS service
Hash chaining - Use one hash to get hundreds more
VSS Requirements:
Administrator/Local Admin privileges
Target must be Domain Controller
VSS service enabled (default on Windows Server)
Sufficient disk space for shadow copy
2. NetExec (CrackMapExec) PtH Attacks
Basic NetExec PtH
NetExec Command Execution
3. Evil-WinRM PtH
Basic Evil-WinRM Usage
Evil-WinRM Post-Exploitation
π₯οΈ RDP Pass the Hash Attacks
Prerequisites for RDP PtH
Restricted Admin Mode must be enabled on target host.
Enable Restricted Admin Mode
RDP PtH with xfreerdp
π‘οΈ UAC and PtH Limitations
Local Account Token Filter Policy
Domain vs Local Account Differences
π― HTB Academy Lab Exercises
Lab Environment
Target Systems: MS01 (Windows client) and DC01 (Domain Controller)
Access: MS01 with tools in
C:\toolsdirectoryHash Example: Administrator
30B3783CE2ABF1AF70F77D0660CF3453Domain: inlanefreight.htb
Exercise 1: Basic PtH Access
Objective: Access target using Pass-the-Hash and read C:\pth.txt
Exercise 2: RDP Registry Configuration
Objective: Identify and configure registry value for RDP PtH
Exercise 3: Hash Extraction with Mimikatz
Objective: Extract David's NTLM hash from current session
Exercise 4: Share Access with David's Hash
Objective: Use David's hash to access \\DC01\david share
Exercise 5: Julio Share Access
Objective: Use Julio's hash to access \\DC01\julio share
Exercise 6: Reverse Shell with Invoke-TheHash
Objective: Create reverse shell from DC01 to MS01 using Julio's hash
Optional Exercise: Remote Management Users
Objective: Test john's account with Remote Management Users membership
π Pass the Hash Methodology
Pre-Attack Requirements
Attack Decision Matrix
Execution Method Selection
π‘οΈ Detection and Defense
Detection Indicators
Defense Recommendations
π‘ Key Takeaways
NTLM weakness - Hash reuse without salt makes PtH possible
Multi-platform attacks - Both Windows and Linux tools available
UAC limitations - Local accounts restricted, domain accounts privileged
Registry dependencies - RDP PtH requires DisableRestrictedAdmin modification
Protocol diversity - SMB, WMI, WinRM, RDP all support hash authentication
Network impact - Single hash can compromise multiple systems
Detection challenges - Legitimate authentication protocols exploited
Defense strategy - LAPS, Kerberos, and network segmentation critical
This comprehensive guide covers Pass the Hash attack techniques using Windows and Linux tools, based on HTB Academy's Password Attacks module.
Last updated