trio.so
Explained

How to Prevent Pass-the-Hash Attacks: Detection and Defenses

What a pass-the-hash attack is, how attackers reuse NTLM hashes, how to detect it, and nine defenses, from Windows LAPS to Credential Guard.

Mountain landscape representing leadership perspective and vision
Written by
Atena Ladchartabi

Content writer, trio.so

Published on
Modified on

A pass-the-hash attack is when an attacker steals the NTLM password hash of a Windows account, usually from a computer's memory, and uses that hash to sign in to other machines as that user, without ever knowing the password. It is one of the most common ways attackers move from one compromised PC to the rest of a Windows network. To prevent it, stop the same local administrator password from working on every machine (Windows LAPS), keep privileged accounts off ordinary workstations, protect the credentials in memory (Credential Guard, LSA protection and the Protected Users group), restrict NTLM, and remove local admin rights from everyday users. To catch it, watch for unusual NTLM network logons and for tools reading the memory of the Windows credential process.

If a penetration test or an audit flagged pass-the-hash in your domain, the nine defenses below are in the order most teams can put them in place; the detection section covers what to watch while you do.

What Is a Pass-the-Hash Attack?

Windows does not need your password to prove who you are over NTLM, the older Windows authentication protocol. It needs a value derived from the password: the NTLM hash. Whoever holds that hash can answer the server's challenge exactly as the real user would. MITRE ATT&CK lists this as technique T1550.002, Use Alternate Authentication Material: Pass the Hash.

Hash Attack Types

  • Pass-the-hash: reusing a stolen NTLM hash to authenticate with NTLM.
  • Overpass-the-hash (also called pass-the-key): using the hash to get Kerberos tickets instead, covered below.
  • Pass-the-ticket: stealing and reusing a Kerberos ticket rather than a hash.
  • Hash cracking: trying to recover the password itself from a stolen hash, offline. Weak passwords fall quickly; pass-the-hash does not need to crack anything.

The Mechanics of Pass-the-Hash

  1. The attacker gets administrator rights on one Windows computer, for example through a phishing email or an unpatched vulnerability.
  2. They read the credentials cached in memory by the Local Security Authority process (LSASS), or the local account hashes stored on the disk, and take the NTLM hashes of every account that signed in there.
  3. They use a hash to authenticate to another computer or server over the network, as that user.
  4. They repeat this on each new machine, looking for a more privileged account, until they reach a domain administrator.

Two habits make this easy: the same local administrator password on every PC, and administrators signing in to ordinary workstations, where their credentials are left in memory.

Pass-the-Hash Tools

Defenders should know the names, because they show up in alerts and incident reports. Mimikatz is the best-known tool for extracting hashes from memory and using them. Impacket, NetExec (formerly CrackMapExec) and Metasploit include modules that authenticate with a hash to run commands remotely. Most endpoint protection and EDR products detect these tools, but attackers modify them, so do not rely on tool detection alone.

Overpass-the-Hash: An Advanced Technique

Overpass-the-hash turns a stolen NTLM hash into Kerberos access. Kerberos can use the NTLM hash as the key for the older RC4 encryption type, so an attacker with the hash can request a Kerberos ticket-granting ticket from a domain controller and then use normal Kerberos tickets. This helps the attacker where NTLM is blocked or watched closely. The defenses are to remove RC4 from Kerberos where your systems allow it, so domain controllers require AES, to put privileged accounts in the Protected Users group, and to watch for ticket requests that use RC4 (event 4768 with encryption type 0x17) from accounts that normally use AES.

How to Detect Pass-the-Hash

  • NTLM network logons where you expect Kerberos. Event 4624 with logon type 3 and the NTLM authentication package, from one workstation to another, especially with a local administrator account, is a classic sign. Workstations rarely need to sign in to each other.
  • New-credentials logons. Event 4624 with logon type 9 and the logon process "seclogo" is created by tools that run a process with someone else's credentials, including pass-the-hash tools. It also appears with legitimate runas /netonly use, so compare it with what is normal for that user.
  • NTLM validation on domain controllers. Event 4776 shows NTLM authentication attempts; a spike for one account, or from unusual hosts, is worth a look.
  • Access to LSASS memory. Endpoint protection and EDR tools alert when a process reads the credential process's memory, which is how hashes are stolen in the first place.
  • Decoy credentials. Planting fake admin credentials (honey tokens) that no one should ever use gives a high-confidence alert when an attacker tries one.

Collect these events centrally, and check Microsoft's current event documentation on Microsoft Learn, because field names and audit settings differ between Windows versions.

Strategies to Prevent Pass-the-Hash Attacks

Nine defenses, in roughly the order a small team can put them in place. Each one blocks a different step of the attack.

1. Give every PC a unique local administrator password with Windows LAPS

Windows LAPS sets a random, rotating password for the built-in local administrator account on each computer and stores it in Active Directory or Microsoft Entra ID. A hash stolen from one PC then opens only that PC, not the whole fleet.

2. Block local accounts from signing in over the network

Use the Group Policy settings "Deny access to this computer from the network" and "Deny log on through Remote Desktop Services" with the built-in group "Local account and member of Administrators group". Keep the registry value LocalAccountTokenFilterPolicy at its default of 0, so User Account Control strips admin rights from local accounts used remotely.

3. Turn on Credential Guard

Credential Guard uses virtualization-based security to isolate the secrets that LSASS would otherwise keep in normal memory, so tools cannot read NTLM hashes or Kerberos keys from it. Microsoft turns it on by default on eligible Windows 11 Enterprise and Education devices from version 22H2; check that it is actually running on yours.

4. Turn on LSA protection

LSA protection (RunAsPPL) runs LSASS as a protected process, which blocks most tools from reading its memory. Test it with your security and smart card software first, because some older add-ins do not load once it is on.

5. Put privileged accounts in the Protected Users group

Members of Protected Users cannot authenticate with NTLM, do not have their credentials cached, cannot use RC4 or DES in Kerberos, and get short-lived Kerberos tickets. Add domain administrators and other high-value accounts, after testing that nothing they use depends on NTLM.

6. Restrict and audit NTLM

Turn on NTLM auditing first, with the "Network security: Restrict NTLM" policies, to see what still uses it. Then block NTLM where nothing needs it, starting with privileged accounts and servers. Microsoft has deprecated NTLM and is moving Windows toward Kerberos, so this work also prepares you for that change.

7. Use a tiered admin model and privileged access workstations

Keep accounts that administer domain controllers and servers off ordinary workstations entirely. Admins use separate accounts for each tier and do their admin work from dedicated, hardened privileged access workstations. If a domain admin never signs in to a user's PC, there is no domain admin hash on it to steal. See privileged access management best practices.

8. Remove local admin rights from everyday users

Stealing hashes from memory needs administrator rights on the machine. Users who work as standard users make that first step much harder, and deploying apps centrally removes the usual reason they ask for admin rights. See least privilege access model and excessive permissions.

9. Patch and protect every endpoint

Attackers usually need a first foothold before they can steal hashes. Keep Windows and third-party apps patched, run endpoint protection or an EDR tool that flags credential theft, and act on its alerts. See EDR vs MDM.

A note on multi-factor authentication: MFA on cloud sign-ins and VPNs is essential, but it does not stop pass-the-hash inside a Windows network, because NTLM authentication with a stolen hash never asks for a second factor. The defenses above are what close that gap.

The Role of Active Directory in Pass-the-Hash Prevention

Most of the defenses above are set in Active Directory: Group Policy for local account restrictions, NTLM auditing and blocking, and Credential Guard; the Protected Users group; LAPS password storage; and the separation of admin accounts into tiers. Reviewing who is in Domain Admins and other privileged groups, removing stale accounts, and alerting on changes to those groups all reduce what an attacker can reach with a stolen hash. For the rest of the directory side, see Active Directory security.

Managing this across many devices

trio.so is not an EDR. It shows Microsoft Defender for Endpoint alerts next to each device, and patches Windows and third-party apps with the CVE severity of each finding, so the footholds attackers use to steal hashes get fixed.

The trio.so Microsoft Defender for Endpoint integration, Devices tab, listing devices with risk, exposure, sensor health and open alerts, one row opened to its two open alerts.
In trio.so, Defender's open alerts sit next to the device they belong to.

Conclusion

Pass-the-hash works because Windows accepts a hash in place of a password, and because the same credentials are reused across machines. Make local admin passwords unique, keep privileged accounts off workstations, protect credentials in memory, reduce NTLM, and remove local admin rights, then watch for the signs in your logs. For the wider picture of how attackers get in, see unauthorized access to computer systems and defense in depth.

Ready-to-use Templates

Must-have Template Toolkit for IT Admins

Explore All
Template Toolkit

See Defender alerts next to every PC

trio.so shows Microsoft Defender for Endpoint alerts next to each device and patches Windows and third-party apps with the CVE severity of each finding.

Start free trial

Manage Every Device From One Console

trio.so brings device management, patching and security policies for Windows, macOS, Linux, iOS/iPadOS and Android into one console. Enroll a device and see it in the console within minutes.

14-day free trial. No credit card required.

trio.so brings device management, patching and security policies for Windows, macOS, Linux, iOS/iPadOS and Android into one console. Enroll a device and see it in the console within minutes.

Smiling womanAbstract geometric patternAbstract geometric patternSmiling womanSmiling woman

Frequently Asked Questions (FAQ)

Have questions? We've got answers. This section covers some of the most commonly asked questions related to this topic.

An attack in which someone steals the NTLM hash of a Windows account and uses it to sign in to other computers as that user, without knowing the password.

The attacker gains admin rights on one PC, reads the password hashes held in memory, and uses a hash to authenticate to other machines over NTLM, moving toward more privileged accounts.

Use Windows LAPS for unique local admin passwords, block local accounts from network sign-in, turn on Credential Guard and LSA protection, add privileged accounts to Protected Users, restrict NTLM, keep admins off workstations, remove local admin rights, and patch every endpoint.

Look for NTLM network logons between workstations (event 4624, logon type 3), new-credentials logons with the seclogo process (logon type 9), unusual NTLM validation on domain controllers (event 4776), alerts on access to LSASS memory, and use of decoy credentials.

Not inside a Windows network. NTLM authentication with a stolen hash does not ask for a second factor. MFA still matters for cloud and remote access, but the defenses against pass-the-hash are unique local passwords, credential protection and restricting NTLM.

Related

From the blog

The related industry news, interviews, technologies, and resources.