Join our Newsletter — 33% off our NHI Course
Home› Guides› Windows RPC Security: Attack surface, filters and monitoring…
Guide Endpoint Security

Windows RPC Security: Attack surface, filters and monitoring for defenders

PDF for newsletter subscribers · free to read online

← All guides
By NHI Mgmt Group, under the editorial direction of Lalit Choda Updated 27 November 2026 12 min read
On this page

Remote procedure call (RPC) carries most Windows administration, which is exactly why intruders use it for remote execution, credential theft and authentication coercion. Services, scheduled tasks, the registry, the directory and WMI are all managed over RPC interfaces, so it cannot simply be blocked. This guide explains the RPC attack surface defensively: how endpoints and interfaces are reached, which abuse classes matter, how to reduce exposure with the firewall, RPC filters and protocol settings, and what to monitor. It is written for Windows security engineers and detection engineers. Coercion of domain controllers is covered in depth in the Authentication Coercion Defence guide, and directory-wide hardening in the Active Directory and Entra ID Hardening Guide; this page covers RPC as a whole. It contains no attack tooling or procedures.

Key takeaways

  • RPC cannot be switched off, only shaped. CISA's eviction guidance states that RPC cannot be completely blocked but can be filtered and monitored; the goal is to limit who can call which interface from where.
  • Two transports, two control points. RPC reaches a host over TCP (endpoint mapper on port 135 plus a dynamic port) or over SMB named pipes, so firewall rules alone miss half of it.
  • RPC filters work at interface level. Windows Filtering Platform RPC filters can permit or block calls by interface UUID, operation number, authentication level and caller, which no port rule can do.
  • Authentication settings close the anonymous gap. "Restrict Unauthenticated RPC clients" and packet privacy for sensitive interfaces raise the bar, but need testing because older software breaks.
  • Detection rests on what RPC creates. Service installs, scheduled tasks, named pipe access and unusual server-to-server connections are more reliable signals than RPC traffic alone.

How Windows RPC works

An RPC server registers one or more interfaces, each identified by a UUID and version, and each exposing numbered operations (opnums). A client binds to an interface over a protocol sequence and calls operations on it. The protocol sequences that matter are:

Protocol sequenceTransportHow a client finds the serverFirewall view
ncacn_ip_tcpTCPAsks the endpoint mapper (RpcSs) on TCP 135, which returns a dynamic portTCP 135 then a port in the dynamic range (49152 to 65535 by default since Windows Vista and Server 2008)
ncacn_npSMB named pipeOpens a named pipe on the IPC$ shareTCP 445 only; the interface is invisible to port rules
ncacn_httpRPC over HTTPThrough an RPC proxyHTTP or HTTPS
ncalrpcLocal onlyLocal procedure call on the same hostNot reachable remotely

Authentication levels: RPC calls carry an authentication level, from RPC_C_AUTHN_LEVEL_NONE through CONNECT, CALL, PKT and PKT_INTEGRITY to PKT_PRIVACY. Microsoft documents that PKT_INTEGRITY verifies data has not been modified and PKT_PRIVACY additionally encrypts the arguments of each remote call; CALL is mapped up to PKT on connection-based (ncacn) protocol sequences, and ncalrpc always uses PKT_PRIVACY. Interfaces that accept low authentication levels are the ones most exposed to relay and tampering.

DCOM and WMI ride on RPC too: DCOM activation uses the endpoint mapper, and remote WMI uses DCOM unless WinRM is configured. Hardening RPC therefore also affects remote WMI and DCOM management tools.

Attack surface: interfaces, endpoints and named pipes

Every role and feature adds interfaces. A domain controller exposes directory replication, Netlogon, SAM and LSA interfaces; a print server exposes the spooler; most servers expose service control, task scheduling and remote registry. The attack surface of a host is the set of interfaces it registers, multiplied by the network paths that can reach them and the identities allowed to call them.

  • Endpoint mapper enumeration: by default the endpoint mapper answers queries about which interfaces are registered on which ports, which helps administrators and attackers alike. Restricting unauthenticated clients makes the endpoint mapper unavailable to anonymous callers.
  • Named pipes: interfaces reachable over ncacn_np are exposed wherever SMB is reachable. Microsoft notes that named pipe calls are exempt from the "Restrict Unauthenticated RPC clients" setting for backward compatibility, so SMB exposure and RPC filters must cover them.
  • Selective binding: netsh rpc can limit which subnets RPC listens on, useful for multi-homed servers with a management network.
  • Roles and services: removing an unneeded role (print spooler on a domain controller, for example) removes its interfaces entirely, which is stronger than any filter.

Known abuse classes (coercion, remote service and task creation)

The table maps the main abuse classes to MITRE ATT&CK and to the first defensive control. It describes what happens, not how; techniques are named only as context.

Abuse classRPC interface familyATT&CKFirst defence
Remote service creation and executionService Control Manager Remote Protocol (MS-SCMR)T1569.002 Service Execution; T1543.003 Windows ServiceRestrict admin rights per tier; RPC filter limiting service creation to admin hosts
Remote scheduled task creationTask Scheduler Service Remoting Protocol (MS-TSCH)T1053.005 Scheduled TaskRPC filter limiting remote task creation; alert on task creation from the network
Remote WMI and DCOM executionDCOM and WMI interfacesT1047 Windows Management Instrumentation; T1021.003 Distributed Component Object ModelRestrict remote WMI and DCOM to management hosts; firewall dynamic ports by source
Remote registry modificationWindows Remote Registry Protocol (MS-RRP)T1021 Remote ServicesDisable Remote Registry where unused; RPC filter by caller host
Directory replication abuseDirectory Replication Service Remote Protocol (MS-DRSR)T1003.006 DCSyncLimit replication rights; filter replication calls to domain controller sources
Authentication coercionPrint spooler (MS-RPRN), EFSRPC (MS-EFSR), DFS namespace management (MS-DFSNM) and othersT1187 Forced AuthenticationDisable unneeded services; RPC filters; relay protections. See the Authentication Coercion Defence guide

Most of these require valid credentials with administrative rights on the target, which is why RPC hardening and tiered administration go together. See the Lateral Movement Guide and the Tiered Administration and Enterprise Access Model Guide.

Where identity fits

Service accounts used by deployment, backup and monitoring tools often hold local administrator rights across hundreds of servers and use exactly these RPC interfaces. A stolen service account password becomes remote execution everywhere it is admin. Scope these accounts to the hosts they manage, prefer group managed service accounts, and include them in RPC filter allow conditions by identity rather than granting broad network reach. See the Non-Human Identity (NHI) Guide.

Hardening: firewall, RPC filters and protocol settings

Host firewall

  • Scope by source: allow TCP 135, the dynamic RPC range and TCP 445 into servers only from management hosts, other servers that genuinely need them and domain controllers. Workstation-to-workstation RPC and SMB is rarely needed. See the Host-Based Firewall Guide.
  • Dynamic ports: Microsoft recommends either allowing ports 49152 to 65535 between servers across internal firewalls or narrowing the dynamic range per server with netsh int ipv4 set dynamicport (minimum 255 ports, start no lower than 1025). Narrowing the range makes network firewall rules practical but must be sized for the host's outbound connection load.
  • Windows Defender Firewall RPC options: inbound rules can target the RPC endpoint mapper and RPC dynamic ports as local port types rather than fixed numbers, so rules follow the service.

RPC filters

RPC filters are Windows Filtering Platform rules evaluated by the RPC runtime, configured with netsh rpc filter or the WFP API. Microsoft's documentation describes three building blocks: conditions (what to match), rules (layer and action) and filters (rules combined with conditions). Key concepts:

  • Layers: user mode (um), endpoint mapper (epmap), endpoint address (ep_add), proxy connection (proxy_conn) and proxy interface (proxy_if).
  • Actions: permit, block or continue to the next filter.
  • Conditions: interface UUID (if_uuid), operation number (opnum, user mode only), authentication type and level (auth_type, auth_level), the caller's token (remote_user_token), named pipe, protocol and addresses. Conditions in one filter must all match.
  • Audit: audit is supported only on permit filters and not at the ep_add layer; parameter buffer auditing is available at the user mode layer.
  • Persistence and backup: filters persist across reboots by default. Microsoft cautions that filters can block traffic Windows services depend on, and recommends testing and backing up configuration with dump first.

CISA's eviction guidance suggests, at a minimum, filtering remote service creation to specific privileged users, remote registry modification to specific hosts, remote scheduled task creation, access to sensitive endpoints to Kerberos authentication only, and connections over specific named pipes. A practical pattern is "permit with audit for the expected callers, block for everyone else" on each sensitive interface.

Protocol settings

Setting (Group Policy)ValuesEffect and caveats
Restrictions for Unauthenticated RPC Clients (Computer Configuration, Administrative Templates, System, Remote Procedure Call)Disabled (default on server SKUs), Authenticated, Authenticated without exceptionsAuthenticated rejects anonymous calls except interfaces registered to allow them; without exceptions blocks all anonymous remote calls and needs significant testing. Named pipe calls are exempt; connectionless protocols fail. Reboot required
Enable RPC Endpoint Mapper Client AuthenticationDisabled (default), EnabledClients authenticate to the endpoint mapper using NTLM. Cannot be combined with Restrict NTLM policies set to deny all; Microsoft recommends restricting NTLM instead where you must choose
Interface authentication level (application or protocol setting)Up to RPC_C_AUTHN_LEVEL_PKT_PRIVACYRequire packet integrity or privacy for sensitive interfaces where the product supports it; follow vendor hardening updates that raise minimum levels

Pair these with NTLM reduction and relay protections, since many RPC abuse chains end in NTLM relay. See the NTLM Relay Guide and the NTLM Deprecation and Elimination Guide.

Rollout

  1. Baseline: enable RPC auditing and network logging on a pilot set of servers to learn which interfaces are called, by whom and from where.
  2. Remove: disable services and roles that expose interfaces nobody uses.
  3. Scope the firewall: restrict 135, dynamic ports and 445 by source, starting with Tier 0 and Tier 1 servers.
  4. Filter in audit-first mode: deploy permit-with-audit filters for expected callers, review for a full business cycle, then add block filters.
  5. Raise authentication: set Restrict Unauthenticated RPC clients to Authenticated on a pilot ring, then widen.
  6. Roll back: keep the netsh rpc filter dump and the previous Group Policy object so a failed change can be reverted quickly; remember that the protocol settings need a reboot.

Monitoring and detection

RPC auditing is controlled by the Audit RPC Events subcategory, which is off by default. Microsoft's event reference documents event 5712 (A Remote Procedure Call (RPC) was attempted) in that subcategory, with interface UUID, protocol sequence, authentication service and authentication level fields; the same page notes that the event appears never to occur in normal operation. Confirm in a lab that your audited RPC filters produce it before you build detections on it.

Data sourceWhat it showsUse
Security event 5712 (Audit RPC Events)Audited RPC calls with interface and authentication levelVerify RPC filter audit; find callers of sensitive interfaces
Security 4697 and System 7045A service was installedRemote service creation, especially from unexpected accounts
Security 4698A scheduled task was createdRemote task creation
Security 5145 (detailed file share)Access to IPC$ and named pipesWhich pipes are opened by which clients
Security 5156 (filtering platform connection)Allowed connections, including to 135 and dynamic portsUnusual server-to-server or workstation-to-server RPC
EDR and network sensorsProcess lineage, RPC interface parsing where supportedChild processes of services, coercion and replication calls

MITRE D3FEND catalogues this as RPC Traffic Analysis (D3-RTA); see the D3-RTA RPC Traffic Analysis page. For audit policy and forwarding, see the Windows Event Log Guide and the Sysmon Guide.

Metrics:

  • Percentage of Tier 0 and Tier 1 servers with RPC, dynamic port and SMB access restricted by source.
  • Number of sensitive interfaces covered by RPC filters, and blocked calls per week after rollout.
  • Percentage of servers with Restrict Unauthenticated RPC clients set to Authenticated.
  • Remote service and task creations from non-management hosts (target: zero, each investigated).
  • Time from an unexpected remote service creation to analyst triage.

Framework mapping

FrameworkReferenceRelevance
NIST SP 800-53 Rev. 5CM-7 Least FunctionalityRemove unused services and interfaces
NIST SP 800-53 Rev. 5SC-7 Boundary ProtectionHost and network firewall scoping of RPC
NIST SP 800-53 Rev. 5AU-12 Audit Record GenerationRPC, service and task auditing
CIS Controls v8.1Control 4 Secure Configuration of Enterprise Assets and SoftwareHost firewall and protocol settings
MITRE D3FENDD3-RTA RPC Traffic AnalysisMonitoring RPC calls

Common failure patterns

  • Port rules only: blocking 135 and the dynamic range while leaving 445 open, so the same interfaces stay reachable over named pipes.
  • Block before baseline: deploying block filters or "Authenticated without exceptions" without an audit period, breaking backup, monitoring or DCOM applications and leading to a full rollback.
  • Flat workstation networks: allowing RPC and SMB between workstations, so one compromised laptop can reach every other.
  • Over-privileged tool accounts: management service accounts with admin rights on every server, turning one credential into domain-wide remote execution.
  • Unverified auditing: assuming RPC audit events are being produced and forwarded without testing, leaving detections silent.
  • Unneeded roles left on Tier 0: print spooler and similar services running on domain controllers, exposing coercible interfaces.

Practitioner checklist

  • Inventory RPC exposure on Tier 0 and Tier 1 servers: listening ports, named pipes and registered interfaces.
  • Disable services and roles that expose unused interfaces, starting with domain controllers.
  • Restrict TCP 135, the dynamic RPC range and TCP 445 by source on servers and workstations.
  • Deploy RPC filters in permit-with-audit mode for service creation, task creation, remote registry and replication interfaces, then add blocks.
  • Set Restrict Unauthenticated RPC clients to Authenticated on a pilot ring, then widen.
  • Scope management service accounts to the hosts they manage.
  • Enable and test Audit RPC Events, service install, task creation and detailed file share auditing; forward to the SIEM.
  • Back up RPC filter configuration and Group Policy before each change and document the rollback.

Standards and references

Related NHI Mgmt Group resources: Authentication Coercion Defence · Active Directory and Entra ID Hardening Guide · SMB Protocol Security and Signing Guide · Kerberos Security Guide

PDF for subscribers

Take this guide with you

Every section, table and checklist in one PDF, with links to the sources and related guides. Subscribe to our weekly NHI & AI Identity Journal and we’ll email you a download link.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

PDF Downloads for Newsletter Subscribers

Get the guide

Enter your details and we’ll email you a download link.

The full guide is free to read online. The PDF is a thank you for subscribing.

Fill in all fields marked * and tick both boxes to continue.