Remote Desktop on, NLA off
HighW04Windows PCs and serversIf you use Remote Desktop, turn on Network Level Authentication (NLA) and…
What is the risk
Without NLA a Remote Desktop session starts before login, so pre-authentication bugs such as CVE-2019-0708 (BlueKeep) are reachable.
Port 3389 open to the internet gets nonstop password guessing and is a common way in for ransomware.
How to check
Windows PowerShell (admin)
(Get-ItemProperty 'HKLM:\System\CurrentControlSet\Control\Terminal Server').fDenyTSConnections
(Get-ItemProperty 'HKLM:\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp').UserAuthenticationA first value of 0 means Remote Desktop is on. A second value of 1 means NLA is on.
How to fix
Windows PowerShell (admin)
Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -Name UserAuthentication -Value 1Turns NLA on.
Windows PowerShell (admin)
Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server' -Name fDenyTSConnections -Value 1If you do not use Remote Desktop, turn it off. Careful: this drops a remote session.
Windows PowerShell (admin)
Set-NetFirewallRule -Group "@FirewallAPI.dll,-28752" -RemoteAddress 203.0.113.10If you do use it, allow only your IP in the firewall. 203.0.113.10 is an example.
How to prevent it
- Do not expose 3389 directly. Go through a VPN or a Remote Desktop Gateway.
- Turn on account lockout (W10).
- Keep Windows updated (W01).
Check again after fixing
Windows PowerShell (admin)
(Get-ItemProperty 'HKLM:\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp').UserAuthenticationIt should be 1.
Run the downloaded check again and make sure this item passes.