keepcalculator

06 Numbers and Powers

Measuring RDP Exposure: What Defenders Need to Know

Card No. 06·16085 · Updated · Standard formula, shown below

Measuring the internet-exposed Remote Desktop Protocol (RDP) surface—the number of hosts with port 3389 (or other RDP ports) reachable from the internet—tells defenders how large their attack surface is and where to focus hardening efforts. You measure it by scanning your own public IP ranges for open RDP ports and comparing that against known threat intelligence and Shodan-like search engines. This article explains what the RDP surface is, why it matters, how to measure it accurately, and how to interpret the results for your defense strategy.

What Is the RDP Surface?

RDP is Microsoft’s proprietary protocol for remote graphical control of Windows machines. It listens by default on TCP port 3389. The “internet-exposed RDP surface” refers to any Windows host that has this port open to the public internet, either directly or via port forwarding. This includes:

  • Workstations with RDP enabled and a public IP
  • Servers with RDP exposed for remote administration
  • Jump boxes or bastion hosts that are intentionally reachable
  • IoT devices or embedded systems that run Windows Embedded with RDP

Each exposed host is a potential entry point for attackers. The RDP protocol has had critical vulnerabilities (e.g., BlueKeep, CVE-2019-0708) and is frequently targeted for brute-force credential attacks and ransomware deployment.

Why the Size of the Surface Matters

The raw count of exposed RDP hosts is a direct measure of your attack surface. A larger surface means more IPs to monitor, more potential entry points, and more places where a misconfiguration or unpatched vulnerability could be exploited. For defenders, knowing this number is the first step in risk assessment:

  • Prioritization: You can’t patch or monitor what you don’t know about. A complete inventory of exposed RDP endpoints lets you prioritize remediation.
  • Baseline for improvement: If you measure quarterly, you can track whether your exposure is growing or shrinking.
  • Incident response: During an attack, knowing which hosts are exposed helps you isolate compromised systems faster.
  • Compliance: Many security frameworks (NIST, CIS, ISO 27001) require reducing attack surface and controlling remote access.

How to Measure Your RDP Surface

There are three primary methods, each with different accuracy and effort levels.

1. Internal Asset Inventory

Start with your own configuration management database (CMDB) or endpoint detection and response (EDR) tools. Query for all Windows hosts that have the RDP service enabled (service name: TermService) and check if they have a public IP or are reachable from the internet. This is the most accurate for known assets but misses shadow IT and forgotten test servers.

2. External Port Scanning

Scan your public IP ranges for open TCP 3389. Tools like Nmap, Masscan, or Zmap can do this. For a small range, Nmap is fine; for large ranges, Masscan is faster. Example Nmap command:

nmap -p 3389 --open -oG rdp_scan.gnmap 203.0.113.0/24

This will list all IPs in that subnet with port 3389 open. You must have authorization to scan your own IPs. Scanning others is illegal in many jurisdictions.

3. Internet-Wide Search Engines

Shodan, Censys, and ZoomEye continuously scan the whole internet and index banners. You can query them for your IP ranges:

  • Shodan: port:3389 net:203.0.113.0/24
  • Censys: services.port:3389 and ip:203.0.113.0/24

These give you a snapshot of what the internet sees, which is exactly what an attacker sees. They also provide metadata like the RDP banner, which may reveal the Windows version and whether NLA (Network Level Authentication) is enabled.

Interpreting the Results

Once you have a list of exposed hosts, you need to analyze what you found:

  • Is it expected? Some hosts may be intentionally exposed (e.g., a public jump server). Mark those as “known and approved.”
  • Is it patched? Check the Windows version and patch level against known RDP vulnerabilities. Unpatched systems are critical.
  • Is NLA enabled? Network Level Authentication requires the user to authenticate before the full RDP session starts. It blocks many pre-auth attacks. If NLA is off, the host is more exposed.
  • Is it using default credentials? Try a few common usernames (Administrator, admin) with weak passwords? No, you shouldn’t attempt logins without authorization. Instead, check if the host is in your asset inventory and whether the password policy is strong.

For each exposed host, classify it as:

  1. Critical: Unpatched, no NLA, or unknown ownership.
  2. High: Patched but NLA disabled, or known but not managed.
  3. Medium: Patched, NLA enabled, but still exposed unnecessarily.
  4. Low: Intentionally exposed with strong access controls (e.g., VPN required, IP allowlist).

Common Mistakes in Measuring

Several pitfalls lead to inaccurate measurements:

  • Forgetting non-standard ports: RDP can be configured to listen on other ports. If you only scan 3389, you’ll miss hosts that have changed the port. Use a full port scan or check your firewall logs for common RDP alternate ports (e.g., 3390, 3388).
  • Ignoring IPv6: Many organizations have IPv6 enabled but don’t monitor it. Shodan and Censys cover IPv6, but your internal scans may not. Include IPv6 in your scanning.
  • Not accounting for NAT: If you have a public IP that forwards 3389 to an internal host, the external scan sees the public IP, but your internal inventory may not flag it as exposed. Cross-reference your NAT rules.
  • Using only one method: Internal inventory may miss shadow IT; external scanning may miss hosts behind a firewall that blocks your scan source. Use at least two methods and reconcile.

Reducing the Surface

Once you know your exposure, take steps to shrink it:

  • Disable RDP where not needed: The simplest fix. Turn off RDP on workstations and servers that don’t require remote administration.
  • Use a VPN or jump host: Instead of exposing RDP directly, require users to connect to a VPN or a hardened jump server that then connects to internal hosts.
  • Enable NLA: This is a Windows setting (Allow connections only from computers running Remote Desktop with Network Level Authentication).
  • Use strong authentication: Require complex passwords, consider smart cards or Windows Hello for Business, and enforce account lockout policies.
  • Apply patches promptly: RDP vulnerabilities have been exploited in the wild. Keep systems updated.
  • Restrict source IPs: If you must expose RDP, use firewall rules to allow only specific IP addresses or ranges.
  • Monitor and alert: Set up alerts for failed RDP logins and unusual RDP traffic.

Comparing Your Surface to Others

It’s natural to wonder how your exposure compares to other organizations. Public data from Shodan and Censys shows that millions of RDP hosts are exposed worldwide. However, this is not a benchmark you should aim to match. The only good number is zero, or as close to zero as business needs allow. Every exposed host is a risk. Instead of comparing to others, track your own trend over time and set a goal to reduce it.

Frequently Asked Questions

Is it legal to scan my own IPs for RDP?

Yes, scanning your own IP addresses or IPs you have explicit authorization to test is legal in most jurisdictions. However, scanning other people’s IPs without permission is illegal and unethical. Always get written authorization before scanning any network you don’t own.

What is the difference between RDP exposure and RDP attack surface?

Exposure is the fact that a port is reachable. Attack surface includes that plus the vulnerabilities, weak credentials, and missing security controls on that host. A host can be exposed but have a small attack surface if it’s fully patched, has NLA, and strong passwords. Conversely, a host can be behind a firewall but still have a large attack surface if it’s vulnerable.

Can I use Shodan to find all my exposed RDP hosts?

Shodan is a good starting point, but it doesn’t scan the entire internet continuously. It may miss hosts that are only intermittently online or that have changed IPs. Use Shodan as a complement to your own scans, not as the sole source.

How often should I measure my RDP surface?

At least quarterly, and after any major network change (new subnets, new servers, firewall rule changes). If you have a large or dynamic environment, monthly is better. Continuous monitoring is ideal but may be overkill for small networks.

Does enabling NLA completely protect RDP?

No. NLA prevents pre-authentication exploits (like BlueKeep) and reduces brute-force attempts because the attacker must authenticate first. However, it doesn’t stop credential stuffing or pass-the-hash attacks if credentials are compromised. NLA is one layer, not a complete solution.

What should I do if I find an exposed RDP host that I didn’t know about?

Immediately isolate it from the network if possible, then determine who owns it and why it’s exposed. If it’s not needed, disable RDP and remove the firewall rule. If it is needed, apply the hardening steps above (patch, NLA, strong auth) and document it as a known asset.

Related

Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.

More cards in this drawer

The whole Numbers and Powers drawer →