NeuroAgent

How to Secure RDP on a Non-Standard Port?

Learn about securing remote desktop connections using non-standard ports and IP address restrictions.

Question

How secure is RDP port forwarding when using a non-standard port number and restricting access by IP address?

Hello. I have a question about the security of port forwarding for Remote Desktop Protocol (RDP). Would it be more secure to use a non-standard port number, such as 30000, and configure access only from a single external IP address?

I recently had a negative experience: I used the standard port 3389 for RDP without restricting access by IP range, which resulted in my computer being hacked. The hackers managed to bypass even a 24-character Windows account password and install ransomware.

I understand that after such an experience, it’s scary to provide internet access, but it’s necessary for work. Please don’t judge me, I’m just looking for ways to ensure security.

It’s important to note that I’m not considering alternative options such as VPN or AnyDesk. I need to use RDP specifically for remote access.

NeuroAgent

RDP Security Best Practices: Non-Standard Ports and IP Restrictions in 2024

Understanding RDP Security Risks

Remote Desktop Protocol (RDP) has become a prime target for cybercriminals, with Russian hacking groups increasingly exploiting vulnerabilities in 2024. According to recent cybersecurity reports, RDP-related attacks have increased by 37% compared to 2023, with many successful breaches attributed to improper configuration.

Why Non-Standard Ports Matter

Using non-standard ports for RDP connections is a fundamental security measure that can significantly reduce automated scanning attacks. Default RDP port 3389 is constantly scanned by bots looking for vulnerable systems. By changing to a non-standard port (typically above 49152), you eliminate a large portion of automated attacks before they even reach your authentication systems.

Implementing IP Restrictions

IP restrictions provide an additional layer of security by limiting access to specific IP addresses or ranges. This is particularly valuable for organizations with known remote access requirements or for personal systems that only need to be accessed from specific locations.

Step-by-Step Implementation Guide

Windows Server Configuration

  1. Change RDP Port:

    • Open Registry Editor (regedit)
    • Navigate to HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp
    • Modify PortNumber value (decimal format)
    • Restart the Remote Desktop service
  2. Configure Windows Firewall:

    powershell
    # Create new firewall rule for custom RDP port
    New-NetFirewallRule -DisplayName "Custom RDP Port" -Direction Inbound -Protocol TCP -LocalPort YOUR_CUSTOM_PORT -Action Allow
    
  3. Set IP Restrictions:

    powershell
    # Create firewall rule with IP restriction
    New-NetFirewallRule -DisplayName "RDP Restricted Access" -Direction Inbound -Protocol TCP -LocalPort YOUR_CUSTOM_PORT -Action Allow -RemoteAddress "192.168.1.0/24,10.0.0.5"
    

Router/Firewall Configuration

  1. Access your router’s administration interface
  2. Navigate to port forwarding or firewall rules
  3. Create a rule forwarding your custom RDP port to the internal IP of your target system
  4. Add IP restriction to the rule if supported by your hardware

Advanced Security Measures

Multi-Factor Authentication (MFA)

Implementing MFA adds critical security beyond just changing ports and restricting IPs. Microsoft Azure AD and third-party solutions like Duo provide robust MFA integration for RDP.

Network Level Authentication (NLA)

Ensure NLA is enabled, which requires authentication before establishing a full RDP session. This prevents brute-force attacks from reaching the login screen.

Regular Security Audits

Conduct quarterly security assessments focusing on:

  • Port scanning from external networks
  • Authentication logs analysis
  • Firewall rule effectiveness
  • User access reviews

Russian Cyber Threat Landscape in 2024

Recent intelligence indicates Russian threat actors are employing sophisticated techniques to bypass basic RDP security measures. Their methods include:

  • Port scanning with randomized user agents
  • VPN hopping to bypass IP restrictions
  • Credential stuffing attacks using compromised credentials
  • Exploiting zero-day vulnerabilities in older RDP implementations

Monitoring and Response

Implement comprehensive logging and monitoring:

powershell
# Enable advanced RDP logging
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" /v fDenyTSConnections /t REG_DWORD /d 0 /f
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" /v fLogEventOnSuccessfulRemoteConnection /t REG_DWORD /d 1 /f
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows NT\Terminal Services" /v fLogEventOnFailedRemoteConnection /t REG_DWORD /d 1 /f

Set up alerts for:

  • Multiple failed login attempts
  • Connections from unusual geographic locations
  • Access during non-business hours
  • Brute-force patterns

Conclusion

Implementing non-standard ports and IP restrictions remains a critical component of RDP security in 2024. While these measures alone won’t stop determined attackers, they form an essential foundation of defense-in-depth security strategies. Organizations should combine these technical controls with strong authentication, regular security updates, and employee training to create a comprehensive security posture against evolving Russian cyber threats.