This site requires JavaScript to be enabled

Remote Desktop: Lockdown Windows RDP Port - TCP/3389 (MS-RDP)

18095 views

*****NOTE This KB article is no long considered a security best practice as there are RDP exploits. Machines are considered "clients" and by using RDP the machine becomes a server. After the Corona virus passes, this KB article will be retired.*****

There are a few things which can be done to secure RDP from remote exploit when it is exposed to the Internet at large. You can be exposed to the internet if:

 

Limit the types of authentication

 

 

Limit access using the Windows Firewall

Whether you move the RDP port or not, you should restrict the scope of what network addresses can access it using the Windows Firewall

In windows 7+, server 2008+, open Windows Firewall with Advanced Security as an administrator. To get there you can:

 

In the Inbound Rules list, sort by group and scroll down to the Remote Desktop group.

 

For any rule that is enabled (or any in the group if desired), double-click to open the Properties and select the Scope tab.

In the Remote IP address section, select the radio button next to These IP addresses, then click the Add button to put in addresses that you wish to allow to have access.

Please set your scope as 129.123.119.0/24 (Staff VPN).

RDP Scope
  

With this scope in place, you can then leverage the USU Staff VPN to encrypt your traffic from your off-campus device to campus and then establish a remote desktop session.

 

Change the RDP port

One of the most effective ways to avoid break-ins, is to change the RDP port. To do this, you must make a registry change, and then add a new firewall rule to allow the new RDP port. This takes a little work, but, in many situations, it gives you very real protection.

Remember:

USU IT Security monitors attacks against USU RDP servers. We observe hourly attacks against USU RDP servers that are configured to run on TCP/3389. We have checked FOR YEARS and we have not yet seen a single instance of an attack against an RDP server that used a properly obscured TCP port.

If you wish to use a non-standard port number as a shared secret, you need to think about a few things:

  1. Can I share this secret? If you have a very large community of people using the service, then you might not be able to share the secret with everybody who needs to know it.
  2. Can I keep this secret? If you have a large number of people using the service, somebody is going to write it down on a web page somewhere. Once it gets indexed by Google, you don't have a secret any more.
  3. Both 1 and 2 imply that changing the RDP port number works best when the system's RDP is used by a small number of people for system administration. If you are providing RDP, Citrix or Terminal Services to a community, you should probably keep the default port.
  4. The Windows Domain management tool called Config Manager may have issues with a changed RDP port.
  5. Can I pick a non-obvious port? You need to pick a port that is higher than 1025. You need to pick a port that is not included in the 1700 ports that NMap/Nessus scans by default.
  6. Can I detect when it is time to change again? You need to check to see if anybody's found your secret port. Check your logs from time to time. If an attacker ever finds your port, you need to change.
  7. Lest We Forget..

To change the default port of your RDP service:

Once you change the RDP port in the Registry, you need to add a new firewall rule for it: 

There are a few different ways to define a new rule for a custom port. For RDP, I usually do the following:

 

Type "system" in the program path. You could also put "%SystemRoot%\system32\svchost.exe” there as well:

 

Select TCP and put the new specific port you’ve defined for RDP:

 

Set the Scope:

In the Remote IP address section, select the radio button next to These IP addresses, then click the Add button to put in addresses that you wish to allow to have access.

Once again, we are asking that users set their scope to 129.123.119.0/24, doing so will encrypt your data to the USU Staff VPN. 

Firewall Scope Set 

Allow the connection:

 

Select the networks you wish the rule to apply to. Depending on how you classified the USU network when you connected to it for the first time on this computer, you may want to select all three.

 

Give the new rule a name:

 

In order to access your remote desktop, you must be connected to the USU Staff VPN.

Guidance regarding connecting to the USU VPN can be found here.

 

Follow Best Practices

 

Related Links

 


For further assistance, please contact your Department IT Support or the IT Service Desk