Pass-the-hash attacks

5 minutes 5 Questions

In the context of CompTIA PenTest+, a Pass-the-Hash (PtH) attack is a critical lateral movement technique where an attacker captures a password hash (typically NTLM) and uses it to authenticate to a remote server or service, bypassing the need to decrypt or crack the hash into a plaintext password. This exploit leverages the design of authentication protocols like NTLM, where the protocol accepts the hash itself as proof of identity during the challenge-response handshake. The attack lifecycle generally begins after an attacker has compromised a machine and escalated privileges to a local administrator or SYSTEM level. Using post-exploitation tools such as Mimikatz, Metasploit, or Cobalt Strike, the attacker scrapes memory (specifically the LSASS process) or the SAM database to extract stored hashes. Once obtained, the attacker uses these hashes to authenticate against other systems in the network via SMB, WMI, or other protocols. If the compromised credentials belong to a user with administrative rights on other hosts—a common scenario with shared local admin passwords—the attacker can execute commands remotely and compromise the entire domain. From a defensive perspective relevant to the exam, mitigation involves disabling NTLM in favor of Kerberos, using the 'Protected Users' Active Directory group, enabling Windows Defender Credential Guard to protect LSASS memory, and strictly limiting the overlap of administrative privileges across the network. For a penetration tester, demonstrating a PtH attack is a powerful way to highlight the risks of credential reuse and the importance of securing authentication subsystems.

Comprehensive Guide: Pass-the-Hash Attacks for CompTIA PenTest+

What is a Pass-the-Hash (PtH) Attack?
A Pass-the-Hash attack is a hacking technique that allows an attacker to authenticate to a remote server or service by using the underlying NTLM or LanMan hash of a user's password, rather than requiring the associated plaintext password. It is primarily used to perform lateral movement within a networked environment.

Why is it Important?
This attack is significant because it bypasses the need for password cracking. Even if a user has a complex, long password, the hash is all that is required for authentication in NTLM-based systems. It demonstrates how attackers can leverage local administrative privileges on one compromised machine to jump to others, eventually aiming for the Domain Controller.

How it Works
The process generally follows these steps:
1. Compromise: The attacker gains administrative access to a Windows machine.
2. Extraction: Using tools like Mimikatz or getting a dump of the SAM database or LSASS memory, the attacker extracts the NTLM hashes of users who have logged into that machine.
3. Replay: The attacker uses a tool (such as the Metasploit psexec module, CrackMapExec, or Impacket) to present this hash to a remote target. The remote target accepts the hash for authentication purposes, believing the attacker possesses the valid credentials.

Exam Tips: Answering Questions on Pass-the-hash attacks
When facing PtH questions on the CompTIA PenTest+ exam, look for these specific indicators and strategies:

1. Identify the Scenario:
If the question describes an attacker dumping the SAM database or LSASS and using the output to log into another machine without running a cracking tool (like John the Ripper or Hashcat), the answer is Pass-the-Hash.

2. Key Tools and Artifacts:
Associate Mimikatz with the extraction of hashes from memory. Associate tools like PsExec, WMI, or SMB with the execution of the attack.

3. Remediation Questions:
If asked how to mitigate PtH, look for answers involving:
- Disabling NTLM and forcing Kerberos (though Kerberos has its own 'Pass-the-Ticket' attacks).
- Using the Protected Users security group in Active Directory.
- Limiting the reuse of Local Administrator passwords (LAPS).

4. Differentiation:
Do not confuse Pass-the-Hash with Pass-the-Ticket. PtH uses NTLM hashes; Pass-the-Ticket uses Kerberos tickets (TGT/TGS).
Test mode:
More Pass-the-hash attacks questions
30 questions (total)

Other Attacks and Exploits concepts

Adversarial machine learningAI data poisoningAI system attack vectorsAPI authentication attacksAPI security testingARP spoofing and poisoningAS-REP roastingAuthentication bypass techniquesAWS security testingAzure security testingBloodHound for ADBluetooth attacksBrute-force attacksCloud penetration testingCobalt Strike basicsCommand injectionContainer escape attacksCookie manipulationCredential dumpingCredential stuffingCross-site request forgery (CSRF)Cross-site scripting (XSS)Directory traversal attacksDLL hijackingDNS poisoning attacksEmbedded device attacksEmpire frameworkFile inclusion vulnerabilitiesFirmware analysisGolden ticket attacksGraphQL security issuesHardware hacking basicsHashcat password crackingHydra password crackingIAM misconfiguration exploitationImpacket toolkitInsecure deserializationIoT penetration testingJohn the RipperKerberoastingKubernetes security attacksLinux privilege escalationLiving off the land binaries (LOLBins)LLMNR/NBT-NS poisoningMetadata service attacksMetasploit frameworkMimikatz usageModel manipulation attacksNetwork protocol attacksNTLM relay attacksOn-path attacks (MITM)Pass-the-ticket attacksPassword sprayingPrivilege escalation techniquesProcess injectionPrompt injection attacksRate limiting bypassResponder toolREST API vulnerabilitiesS3 bucket misconfigurationServerless function attacksServer-side request forgery (SSRF)Service exploitationSession hijackingSilver ticket attacksSQL injection attacksSQLmap usageToken manipulationUAC bypass techniquesVLAN hopping attacksWindows privilege escalationWireless network attacksXML external entity (XXE) attacks