Tools
Log in
English

Learn to codeSecurity check

Remote Desktop on, NLA off

HighW04Windows PCs and servers

If 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').UserAuthentication

A 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 1

Turns NLA on.

Windows PowerShell (admin)

Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server' -Name fDenyTSConnections -Value 1

If 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.10

If 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').UserAuthentication

It should be 1.

Run the downloaded check again and make sure this item passes.

Related CVEs

CriticalCVE-2019-07089.8

Security check home