Disable NTLMv1 to Prevent Weak Authentication Hash Cracking and Relay Attacks
NTLMv1 hashes can be cracked in seconds on modern hardware and are trivially relayed to authenticate to other servers — disabling NTLMv1 forces the use of stronger NTLMv2 or Kerberos.
✓ Tested on WS2022·Rollback included
An attacker who captures an NTLMv1 challenge-response (via network sniffing, responder tools, or forced authentication) can crack the hash offline in seconds to recover the plaintext password, or relay it to authenticate to other servers without ever knowing the password. NTLMv1 relay attacks are trivial with freely available tools.
NTLMv1 is a 1990s-era authentication protocol that uses a DES-based challenge-response mechanism. DES is completely broken by modern standards — NTLMv1 hashes can be cracked in seconds using rainbow tables or modern GPU hardware. Windows Server allows NTLMv1 by default for backward compatibility with legacy systems. Any server that accepts NTLMv1 authentication is vulnerable to offline hash cracking and NTLM relay attacks.
Probably yes if any of these apply:
Affected OS versions
During a penetration test, the tester runs Responder on the network to capture authentication attempts. Several servers are still configured to use NTLMv1 — the captured hashes are cracked using a rainbow table lookup in under 10 seconds, yielding plaintext passwords for three service accounts, one of which has local admin rights on all servers in the domain.
Fix-Windows-Server-Ntlmv1-Protocol-Disabled-Hardening.ps1
3.4 KBRollback-Windows-Server-Ntlmv1-Protocol-Disabled-Hardening.ps1
1.9 KBSHA-256: dcfa33d08724642cc8b2a37d492484bc71ec21d6cb25db608c13ad62d033c004
Run interactively
.\Fix-Windows-Server-Ntlmv1-Protocol-Disabled-Hardening.ps1
Run silently (SCCM / Intune)
.\Fix-Windows-Server-Ntlmv1-Protocol-Disabled-Hardening.ps1 -Silent -OutputPath C:\Logs
Manual fallback (no script)
⏱ 10 minutesCheck Current NTLM Authentication Level
$val = Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Lsa' -Name LmCompatibilityLevel -ErrorAction SilentlyContinue
$level = if ($val.LmCompatibilityLevel) { $val.LmCompatibilityLevel } else { 0 }
Write-Host "Current LmCompatibilityLevel: $level"
if ($level -ge 3) {
Write-Host "SECURE: NTLMv1 is disabled" -ForegroundColor Green
} else {
Write-Host "VULNERABLE: NTLMv1 is permitted (level $level)" -ForegroundColor Red
}
Disable NTLMv1
# Level 5: Only NTLMv2 responses. Refuses LM and NTLMv1.
Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Lsa' -Name LmCompatibilityLevel -Value 5 -Type DWord
Verification
(Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Lsa').LmCompatibilityLevel
# Must return 5
Notes
Verify after patching
Confirm the patched version is running:
# Expect: NTLMv1 disabled (LmCompatibilityLevel = 5) or later
Script details · parameters · exit codes↓
Tested On
—
Reboot
No RebootSCCM
✓ Compatible
Est. Time
10 minutes
Parameters
How to Run
Interactive — see output in console
.\Fix-Windows-Server-Ntlmv1-Protocol-Disabled-Hardening.ps1
Silent mode — for SCCM / automation
.\Fix-Windows-Server-Ntlmv1-Protocol-Disabled-Hardening.ps1 -Silent
With custom log path
.\Fix-Windows-Server-Ntlmv1-Protocol-Disabled-Hardening.ps1 -OutputPath "C:\Logs"
Exit Codes
| Code | Meaning |
|---|---|
| 0 | Success — fix applied or already patched |
| 1 | Failure — check log file |
| 3010 | Success — reboot required to complete |
Fix, idempotency, and rollback verified on
⚠ Rollback available. If this fix causes issues, run Rollback-Windows-Server-Ntlmv1-Protocol-Disabled-Hardening.ps1 to restore the previous state.