What Is Port 135? The Windows RPC Endpoint Mapper Explained

Summarize this article with AI:

Table of Contents

Port 135 is the port of the Windows RPC Endpoint Mapper. A client asks it which dynamic port a Windows service is using, then connects there. Active Directory and remote management tools depend on it. Block it from the internet, and restrict it inside the network.

Definition: The RPC Endpoint Mapper is a Windows service that tells clients where a given RPC service is listening. It runs on port 135.

Below you will see how the lookup works and what relies on it. You will also see how to check or block the port.

What Is Port 135 Used for?

Port 135 is a lookup desk, not a data channel. A program asks the endpoint mapper where a service lives, and the mapper replies with a port number. The real work then happens on a different, dynamic port, so the lookup itself stays short.

Python socket lookup of the epmap service name for port 135

The service name for port 135 on a Linux test machine.

Then the registered service name is epmap, short for endpoint mapper. The IANA port registry lists it for both TCP and UDP, with the description DCE endpoint resolution.

How Does the Endpoint Mapper Find a Service?

The lookup takes three short steps. The client contacts port 135 first, and the mapper answers with the right port. The client then connects to that port directly. Modern Windows picks these dynamic ports from the range 49152 to 65535.

  1. The client connects to port 135 on the server and names the service it wants.
  2. The endpoint mapper replies with the dynamic port that service uses.
  3. The client connects to that dynamic port and starts the real session.

That is why a firewall that allows only port 135 still breaks remote tools. Also, the dynamic range must be reachable, or the second step fails.

Which Windows Features Rely on Port 135?

Several built-in Windows features use RPC, so they also use port 135 for the first lookup. The most common ones are management and directory tools. If you block the port, then these tools stop working across that boundary, even though the network is fine.

  • Active Directory, for domain replication and sign-in traffic between machines.
  • Windows Management Instrumentation (WMI), for remote monitoring and management.
  • DCOM, which lets programs call objects on another computer.
  • Task Scheduler and the Service Control Manager, for remote tasks and services.

How Do Ports 135, 139 and 445 Differ?

The three ports belong to different Windows services. Port 135 finds RPC services, port 139 carries SMB over NetBIOS, and port 445 carries SMB directly over TCP. Admins often see them together, because Windows networks use all three at once.

PortServiceUsed forOur guide
135RPC Endpoint MapperFinding the port of an RPC serviceThis page
139NetBIOS session serviceSMB over NetBIOS, mainly legacyPort 139 guide
445SMB over TCPFile and printer sharingPort 445 guide

Is Port 135 a Security Risk?

Port 135 is risky when it faces the internet or an untrusted network. An exposed mapper lets outsiders list the services on a machine. Attackers can then probe those services for flaws. Inside a network, the same port can help them move between machines.

  • Service discovery: an attacker learns which RPC services and ports are active.
  • Remote code execution: flaws in an RPC service can let outsiders run code.
  • Denial of service: malformed requests can crash an unpatched service.
  • Lateral movement: an attacker with a foothold can use RPC to reach other machines.

Password guessing against exposed Windows services is a related threat, so see our guide to the brute force attack.

Where Should Port 135 Be Blocked or Open?

Block it at the internet edge, because no public service needs it. Close it on workstations that nobody manages remotely. Open it only between machines that need RPC, such as domain controllers and management servers, and only from trusted subnets.

LocationActionReason
Internet to your networkBlock inboundPublic RPC exposure gives attackers a starting point
Standalone or home PCClose itNothing needs remote RPC on a lone machine
Workstations in a domainAllow only from admin and domain serversManagement and policy tools need it
Domain controllers and serversAllow from trusted subnets onlyActive Directory and WMI rely on it

How can You Check or Block Port 135?

Test the port first, then add a firewall rule only if nothing needs it. A refused result means nothing listens on the port. On Windows, the PowerShell Test-NetConnection command runs the same kind of test and prints a clear pass or fail.

nc connection refused on port 135 in terminal

A closed port refuses the connection. Test run on a Linux test machine.

  1. Run Test-NetConnection -ComputerName server01 -Port 135 in PowerShell to test a Windows server.
  2. Run netstat -ano | findstr :135 on that server to see whether it is listening.
  3. Open Windows Defender Firewall with Advanced Security and choose Inbound Rules, then New Rule.
  4. Pick Port, enter TCP 135, choose Block the connection, and apply it to the profiles you need.
  5. Repeat for UDP if your policy blocks both, then test again.

We ran the nc test ourselves, but we did not run the Windows commands. Try them on a non-production machine first.

What Breaks If You Block Port 135?

Blocking port 135 stops remote RPC lookups across that boundary. Tools that depend on them fail, usually with an RPC server unavailable message. Read our guide to the RPC server is unavailable error before you decide to reopen the port.

  • Remote management with WMI or DCOM stops working.
  • Some Active Directory tools fail between blocked subnets.
  • Remote Task Scheduler and service control calls time out.

Frequently Asked Questions

What is the name of the service listening on port 135?

It is the RPC Endpoint Mapper, registered with the short name epmap. Windows also calls it the DCE endpoint resolution service.

Is port 135 TCP or UDP?

The IANA registry lists port 135 for both TCP and UDP. In practice, most Windows RPC traffic to it uses TCP.

Is port 135 used for Active Directory?

Yes, Active Directory traffic between domain members and controllers uses RPC, so it needs port 135 and the dynamic range. Restrict it to trusted subnets.

Is port 135 safe to leave open?

It is safe only on a patched internal network with firewall limits. It is not safe on the open internet.

Can I disable RPC to close port 135?

No, Windows depends on RPC for core services, and disabling it is not supported. Close the port with a firewall rule instead.