In short
- RDP (3389) should never be exposed directly to the internet; access should go through a VPN or RD Gateway, with MFA.
- On the internal network too, NLA, account lockout and limited sign-in rights are essential.
- For admin connections, use Remote Credential Guard or Restricted Admin to protect credentials.
Remote Desktop Protocol (RDP) is the most common way to manage Windows servers and computers remotely. For the same reason, it is a favourite of attackers: internet-facing RDP ports are scanned constantly by automated tools, weak passwords are brute-forced, and a compromised RDP session is often the start of a ransomware attack. This article summarises the technical steps IT teams can take to harden RDP.
1. First, check whether any RDP is exposed to the outside world
Review the port forwarding (NAT) rules on your firewall and check whether RDP is forwarded to an internal machine on 3389 or any other port. You can test from a connection outside the office against your company’s external IP address:
# Run from a computer OUTSIDE the office (replace 203.0.113.10 with your company's external IP)
Test-NetConnection -ComputerName 203.0.113.10 -Port 3389
A result of TcpTestSucceeded : True shows that RDP is exposed to the internet and must be closed immediately. RDP moved to a different port carries the same risk.
2. Put remote access behind a VPN or RD Gateway
- VPN: the user first connects to the network through an MFA-protected VPN, then uses RDP to an internal IP. Details: VPN guide.
- RD Gateway: tunnels RDP traffic over HTTPS (443); resource authorisation policies limit who can connect to which machine. Microsoft Entra MFA can be added with the NPS extension.
In both cases, the firewall should only allow RDP connections coming from the VPN pool or the gateway.
3. Require Network Level Authentication (NLA)
NLA requires authentication before the sign-in screen opens, making it harder for unauthenticated connections to consume server resources and for pre-authentication vulnerabilities to be exploited. Group Policy: Computer Configuration › Administrative Templates › Windows Components › Remote Desktop Services › Remote Desktop Session Host › Security › “Require user authentication for remote connections by using Network Level Authentication”.
# Check NLA status (1 = on)
(Get-CimInstance -Namespace root\cimv2\TerminalServices -ClassName Win32_TSGeneralSetting `
-Filter "TerminalName='RDP-tcp'").UserAuthenticationRequired
4. Limit who can connect
Grant the “Allow log on through Remote Desktop Services” right only to a security group created for this purpose; “Everyone” or the whole “Domain Users” group shouldn’t have this right.
# Members of local groups with RDP rights on a machine
Get-LocalGroupMember -Group "Remote Desktop Users"
Get-LocalGroupMember -Group "Administrators"
Block domain admin accounts from connecting to user computers over RDP; if those accounts’ credentials are left behind on a compromised computer, the whole domain is at risk. Details: Active Directory hardening.
5. Account lockout and password policy
Define an account lockout policy against brute-force attacks, for example a 15-minute lockout after 10 failed attempts. Although Windows 11 22H2 and later ship with a default lockout policy for local accounts, set your own policy explicitly in a domain environment. Long passwords and MFA are more effective protection than lockout.
6. Protect credentials on admin connections
In a standard RDP session, your credentials are passed to the remote machine; if that machine is compromised, your credentials can be stolen too. In a domain environment there are two options:
- Remote Credential Guard: redirects Kerberos requests back to the device that started the connection; credentials aren’t sent to the remote machine.
- Restricted Admin mode: signs in to the remote machine as a local administrator without leaving credentials behind.
# Connect with Remote Credential Guard from the client
mstsc.exe /remoteGuard /v:server01.company.local
7. Session and redirection settings
- Set time limits for idle and disconnected sessions
- Turn off drive, clipboard and printer redirection for server connections where it isn’t needed
- Enforce TLS as the RDP security layer and use a valid certificate
- Keep the service switched off entirely on computers that don’t need RDP
- Use Windows Defender Firewall to allow RDP only from the management network or specific IPs
8. Keep it updated and monitor it
Serious vulnerabilities affecting the RDP service have been seen before; for example, BlueKeep (CVE-2019-0708), published in 2019, allowed remote code execution without authentication. Updates should be applied without delay, and end-of-support systems shouldn’t be left reachable over RDP. For monitoring:
# Failed remote desktop / network sign-ins in the last 24 hours
Get-WinEvent -FilterHashtable @{LogName='Security'; Id=4625; StartTime=(Get-Date).AddDays(-1)} |
Where-Object { $_.Properties[10].Value -in 3,10 } |
Measure-Object
# Successful RDP authentications (including source IP)
Get-WinEvent -LogName 'Microsoft-Windows-TerminalServices-RemoteConnectionManager/Operational' |
Where-Object Id -eq 1149 | Select-Object -First 20 TimeCreated, Message
The index numbers of event properties can vary by Windows version; check the queries in your own environment. For other events worth monitoring, see our article on detecting attacks with event logs.
Conclusion
The first rule of RDP security is simple: don’t expose it to the internet. Add NLA, limited sign-in rights, account lockout, credential protection and regular monitoring on top, and remote desktop remains a secure management tool. At SistemON, as part of our cyber security service, we scan your externally exposed services, move RDP access behind a VPN or RD Gateway and configure the necessary group policies.
Frequently Asked Questions
Is moving RDP from port 3389 to another port enough?
No. Changing the port cuts some automated scanning but doesn’t provide security; scanners cover every port in a short time. RDP should never be exposed to the internet; it should sit behind a VPN or RD Gateway.
Is it safe for home workers to connect to their office computer over RDP?
It is an acceptable risk when done through an MFA-protected VPN or RD Gateway, with NLA on and access limited to authorised users. RDP exposed directly to the internet is not acceptable.
How can we tell whether our server is being attacked over RDP?
Large numbers of 4625 events with logon type 10 (RemoteInteractive) or 3 in the Security log, along with connection records in the TerminalServices-RemoteConnectionManager log, indicate brute-force attempts.
Need help with this?
Let us review your infrastructure free for the first month and share a clear list of risks and priorities.