Network security

What Is Port 3389? RDP Explained, Risks and How to Secure It

Port 3389 is where Windows listens for Remote Desktop connections — full graphical control of a machine from anywhere. It is also one of the most attacked ports on the internet.

Cysoro Security TeamPublished · 8 min read
Remote DesktopUsernamePassword •••••••• PORT 3389 NETWORK SECURITY Port 3389explained RDP's front door — and how to lock it.
Quick answer

Port 3389 is the default port for Microsoft's Remote Desktop Protocol (RDP), which lets you see and control a Windows desktop remotely. It uses TCP 3389 for the connection and UDP 3389 for the display stream. IANA registers it under the service name ms-wbt-server. Never expose port 3389 to the internet: it is a target for password attacks and ransomware, and the BlueKeep flaw (CVE-2019-0708) showed it can be exploited without any login at all.

Key takeaways

  • Port 3389 is the default RDP port: TCP 3389 carries the session, UDP 3389 carries the display stream on Windows 8 and later.
  • Exposed RDP is one of the most common ransomware entry points, so port 3389 should never face the internet directly.
  • The safe options are a VPN, an RD Gateway on port 443, or zero trust access — plus Network Level Authentication, MFA and patching.

If you have ever seen a firewall log, you have seen port 3389. It is the port Windows uses for Remote Desktop, and it is also one of the most scanned and attacked ports on the internet. Understanding what it does — and why it should never face the public internet — is one of the highest-value lessons in network security.

What is port 3389?

Port 3389 is the default port for Remote Desktop Protocol (RDP), Microsoft's protocol for controlling a Windows computer from somewhere else. When you open the Remote Desktop app and connect to another machine, your computer talks to TCP port 3389 on that machine.

RDP gives you the actual screen of a Windows machine, not just a command line. You see the desktop, open programs, move files and type as if you were sitting in front of it. The protocol is specified by Microsoft in the MS-RDPBCGR open specification, and IANA registers port 3389 for both TCP and UDP under the service name ms-wbt-server — which is why tools like Nmap print "ms-wbt-server" instead of "RDP".

Port 3389 is listening wherever a Windows machine has Remote Desktop enabled: office desktops, servers, virtual machines and home PCs used for remote work. Microsoft's own documentation confirms that TCP and UDP 3389 are the standard RDP ports, and that the port can be changed on the host and client.

Is port 3389 TCP or UDP?

Both, in a fixed order. The client always opens TCP 3389 first. Over that connection the server offers a second transport over UDP, and once the UDP handshake succeeds, the bulk of the traffic — screen updates above all — moves to UDP while the TCP connection stays open.

PortProtocolJobCan you block it?
3389TCPConnection setup, authentication, reliable channelNo — without it there is no session
3389UDPDisplay stream (RDP 8.0 and later)Yes — RDP falls back to TCP, just slower
443TCPRD Gateway (RDP wrapped in HTTPS)Only on a gateway server
3391UDPRD Gateway UDP transportOnly on a gateway server

The UDP transport arrived with RDP 8.0 in Windows 8 and Windows Server 2012. It exists because display traffic is time-sensitive: a lost packet should be skipped rather than resent, which is exactly what UDP does. If UDP 3389 is blocked, RDP simply stays on TCP and still works.

How does RDP work on port 3389?

An RDP session has four stages. Knowing them helps you see where an attacker can interfere — and where your defenses should sit.

An RDP connection on port 3389, stage by stage 1. ConnectClient opensTCP 3389X.224 request 2. NegotiateEncryption andcapabilities areagreed (TLS) 3. AuthenticateUser logs in;NLA checksbefore the session 4. SessionDesktop streamsback; keyboardand mouse go in Drives, printers, clipboard, audio and smart cards travel as virtual channels inside the same connection. UDP 3389 joins after stage 2 to carry the display stream; the TCP connection stays open throughout. With NLA off, an attacker reaches the logon screen — and any flaw in it — before authenticating.
The four stages of an RDP session, and why Network Level Authentication matters. Illustration by Cysoro.
  1. Connect: the client opens TCP 3389 and sends an X.224 connection request, often carrying a routing cookie with the username.
  2. Negotiate: client and server agree on encryption (TLS on modern Windows) and capabilities such as screen size and color depth.
  3. Authenticate: the user logs in. With Network Level Authentication (NLA) on, authentication happens before the desktop session is created; without it, anyone can reach the logon screen.
  4. Session: the server sends drawing instructions and cached bitmap updates, the client renders them, and keyboard and mouse input travels back. Drives, printers, clipboard, audio and smart cards travel as virtual channels inside the same connection.

What uses port 3389?

Anything that needs graphical remote access to Windows. IT teams use it to administer servers, remote workers use it to reach their office desktop, support staff use it to fix a user's machine, and managed service providers use it to look after client systems.

Remote Desktop Services (RDS) deployments use 3389 more heavily: session hosts, virtual desktop pools and connection brokers all talk RDP on 3389, while the supporting traffic — LDAP on 389, DNS, and licensing — runs on other ports between the servers. Microsoft's RDS ports documentation lists TCP 3389 for connections to RD Session Hosts and for clients not using an RD Gateway.

On a home network, port 3389 matters when you enable Remote Desktop on a PC and then forward the port on your router so you can reach it from outside. That port forward is exactly the moment a safe local tool becomes an internet-facing risk, which is why our guide to securing your Wi-Fi covers router settings as part of home network hygiene.

Why is port 3389 dangerous?

Exposed RDP is one of the most common ways ransomware gets in. Attackers scan the whole internet for port 3389, then try weak or stolen passwords, buy credentials from earlier breaches, or exploit unpatched flaws in the RDP service itself. A successful login gives them a full Windows desktop inside your network.

The worst example is BlueKeep. Disclosed in May 2019, CVE-2019-0708 was a pre-authentication remote code execution flaw in Remote Desktop Services on older Windows versions — Windows 7, Server 2008 and earlier. CISA's alert AA19-168A warned that an attacker could take control of an affected system without any user interaction, and that the flaw was wormable: malware exploiting it could spread from vulnerable computer to vulnerable computer, the way WannaCry did in 2017.

Microsoft shipped patches even for Windows XP and Vista, which were already out of support — a measure of how seriously it was taken. CISA added BlueKeep to its Known Exploited Vulnerabilities catalog, and its mitigations are still the right checklist today: install patches, upgrade end-of-life systems, disable unnecessary services, enable NLA, and block TCP port 3389 at the enterprise perimeter firewall.

Even without a flaw like BlueKeep, exposed RDP faces constant brute-force attacks. Automated botnets try thousands of username and password combinations against every open 3389 they find, day and night. A short or reused password is all it takes.

Port 3389 vs other remote access ports

Port 3389 is not the only way to reach a machine remotely, and the alternatives have very different risk profiles. Here is how it compares.

PortProtocolWhat you getTypical risk
3389RDPFull graphical Windows desktopVery high if exposed — top ransomware entry point
22SSHEncrypted command line, mostly LinuxHigh if password-only; low with key-only auth
5900VNCGraphical desktop, cross-platformHigh — often weak or no encryption by default
443HTTPS / RD GatewayRDP wrapped in TLS via a gatewayLower — one hardened entry point, MFA enforced

RDP's risk comes from what it offers: a complete graphical logon, exposed on a well-known port, on the world's most common desktop operating system. SSH on port 22 is a smaller target and supports key-only authentication, while VNC on 5900 is usually worse than RDP because many VNC servers have weak encryption by default. The lesson is not that remote access is bad — it is that the access should go through one hardened, authenticated gateway instead of a raw port.

How to check if port 3389 is open

Check both ends: what the machine is listening on, and what the internet can reach. They are different questions, and both matter.

On the Windows machine itself, open PowerShell as Administrator and run Get-NetTCPConnection -LocalPort 3389 -State Listen. If it returns a result, RDP is listening. You can also read the configured port from the registry with Get-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -Name 'PortNumber'.

Then check the outside. Look at your router or firewall for a port-forwarding rule pointing at 3389, and check your public IP with an external port scan — the free what is my IP tool shows the address to test. If 3389 answers from the internet, close the forward and move to one of the safe options below.

How to change the RDP port from 3389

You can move RDP to a different port, and Microsoft documents the steps. Change the PortNumber value in the registry key HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp, restart the Remote Desktop Services service, and update your firewall rules so the new port is allowed. Clients then connect with the new port, for example server.example.com:3390.

Be honest about what this buys you: almost nothing against a determined attacker. Changing the port only hides RDP from casual scans that look for 3389 specifically; a full port scan finds it in seconds. Treat a changed port as a minor extra, never as your security. The real fix is to stop exposing RDP at all.

How to secure RDP properly

Secure RDP in layers, in this order. Each layer catches what the one above misses.

Five layers that make RDP safe 1Never expose 3389Close it at the perimeter firewall — no port forward, no exceptions 2Use a gateway or VPNRD Gateway on 443, a VPN, or zero trust access — one hardened entry point 3Require MFA + NLANetwork Level Authentication plus a second factor on every login 4Limit who can connectnamed users only, strong unique passwords, account lockout after failures 5Patch and monitorkeep Windows patched, log RDP logons, alert on failed attempts
Defense in depth for Remote Desktop — each layer catches what the one above misses. Illustration by Cysoro.
  • Close 3389 at the perimeter. Block TCP port 3389 at your firewall, as CISA recommends, and remove any router port forward. This one step removes the largest risk.
  • Use an RD Gateway, VPN or zero trust service. An RD Gateway takes TCP 443 and UDP 3391, so clients connect over HTTPS and 3389 stays internal. A VPN or a zero trust solution such as the ones in our zero trust guide for small business does the same job with stronger checks.
  • Enable Network Level Authentication. NLA forces authentication before the session is created, so an attacker never reaches the logon screen or any flaw behind it.
  • Require MFA. A password alone is not enough for remote access. Add a second factor, ideally a passkey or security key.
  • Limit who can connect. Allow only named users, use strong unique passwords, and set account lockout after repeated failures.
  • Patch and monitor. Keep Windows updated — BlueKeep was patched in May 2019, but only for systems that installed the update — and log RDP logons so failed attempts get noticed.

Should you close port 3389?

Yes, at the internet-facing firewall, unless you have a specific, documented reason not to — and even then, put a gateway in front of it. Inside your local network, RDP on 3389 is normal and useful: it is how IT teams administer servers and how staff reach their office desktops.

The distinction is the boundary. A port that is open on your LAN is a tool; the same port open on the internet is an invitation. If you are not sure whether 3389 is exposed, check now: it takes five minutes, and it is one of the highest-value checks in our small business cybersecurity checklist.

The bottom line

Port 3389 is the default RDP port: TCP 3389 carries the session and UDP 3389 carries the display stream. It is a useful, legitimate protocol — and one of the most attacked ports on the internet, because a successful RDP login hands an attacker a full Windows desktop.

Do not expose it. Put RDP behind an RD Gateway, a VPN or zero trust access, turn on NLA and MFA, and keep Windows patched. You can check what your network looks like from the outside with the free what is my IP tool.

Review your site's exposure with the SSL checker, which flags certificate and configuration problems in seconds.

Frequently asked questions

What is port 3389 used for?

Port 3389 is the default port for Remote Desktop Protocol (RDP). It lets a user connect to a Windows desktop or server from another computer and control it as if sitting in front of it, for remote work, administration and support.

Is port 3389 TCP or UDP?

Both. TCP 3389 carries the connection setup, authentication and the reliable channel, and it is the one you cannot do without. UDP 3389, added with RDP 8.0 in Windows 8 and Server 2012, carries the time-sensitive display traffic. IANA registers 3389 for both protocols under the name ms-wbt-server.

Is it safe to open port 3389?

No. Opening port 3389 to the internet exposes a full Windows logon to anyone who finds it, and attackers constantly scan for it. Use a VPN, an RD Gateway on port 443, or a zero trust access service instead, and keep the port closed at the perimeter firewall.

What is BlueKeep?

BlueKeep (CVE-2019-0708) is a critical remote code execution flaw in Remote Desktop Services on older Windows versions, disclosed in May 2019. An attacker could exploit it without logging in, and CISA warned it was wormable, meaning malware could spread from machine to machine like WannaCry did.

How do I change the RDP port from 3389?

Change the PortNumber value in the registry at HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp, then restart the Remote Desktop Services service and update your firewall rules. Changing the port only hides RDP from casual scans, so it is not a substitute for a VPN or gateway.

How do I check if port 3389 is open?

On the Windows machine, run Get-NetTCPConnection -LocalPort 3389 -State Listen in PowerShell to see if RDP is listening. From outside, check your firewall's port-forwarding rules, or use an external port scan of your public IP. If 3389 answers from the internet, close it.

What port does Remote Desktop Gateway use?

An RD Gateway takes TCP 443 and UDP 3391 instead of 3389. Clients connect to the gateway over HTTPS, and the gateway forwards the RDP session internally, so port 3389 never faces the internet.

Sources

  1. Microsoft Learn — Ports That Are Used by RDS
  2. CIS MS-ISAC — Security Primer: Remote Desktop Protocol
  3. CISA — AA19-168A: Microsoft Operating Systems BlueKeep Vulnerability
  4. Group-IB — Understanding Port 3389: Uses, Risks and Protections
Written & fact-checked byCysoro Security Team

The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.

  • Email authentication
  • Phishing & BEC
  • Domain & DNS security
  • Small-business security

Checked against Microsoft Learn's RDS ports documentation, the CIS MS-ISAC RDP security primer and CISA's BlueKeep alert AA19-168A.

How we write and fact-check →

Free tools for this topic

No account needed.

See where your domain stands

Free for up to 3 domains. No card, no installs.

Start free