Skip to main content

MS-RPC Protocol

Impacket’s DCERPC (Distributed Computing Environment / Remote Procedure Call) implementation provides comprehensive support for Microsoft RPC protocols, enabling remote administration and exploitation of Windows services.

Overview

The DCERPC implementation is located in impacket/dcerpc/v5/ and includes:
  • Transport layers - SMB named pipes, TCP/IP, HTTP
  • 40+ protocol interfaces - Service control, registry, SAM, Active Directory, and more
  • Authentication - NTLM, Kerberos, anonymous
  • Data marshalling - NDR (Network Data Representation)

Protocol Stack

DCERPC sits on top of various transports (SMB, TCP, HTTP) and provides a framework for calling remote procedures on Windows systems. Each service exposes specific interfaces identified by UUIDs.

Transport Layers

DCERPC supports multiple transport protocols, configured via string bindings.

String Bindings

From transport.py:36-94, string bindings follow this format:

SMB Named Pipes (ncacn_np)

TCP/IP Transport (ncacn_ip_tcp)

HTTP Transport (ncacn_http)

Common RPC Interfaces

Service Control Manager (SCMR)

Manage Windows services remotely.

Remote Registry (RRP)

Access and modify Windows registry remotely.

SAM Remote (SAMR)

Manage users and groups.

Server Service (SRVS)

Enumerate shares and sessions.

Advanced Interfaces

Active Directory (DRSUAPI)

Domain replication and DCSync.

Task Scheduler (TSCH)

Schedule tasks remotely.

Authentication

Endpoint Mapper

The Endpoint Mapper (EPM) helps resolve RPC interfaces to network addresses.

NDR Data Types

DCERPC uses NDR (Network Data Representation) for data marshalling.

Error Handling

RPC calls can fail for various reasons: access denied, invalid parameters, service unavailable. Always handle DCERPCException.

Complete Example: Service Manager

Available Interfaces

Impacket includes 40+ RPC interfaces in impacket/dcerpc/v5/:

Common Interfaces

  • scmr - Service Control Manager
  • rrp - Remote Registry Protocol
  • samr - Security Account Manager
  • srvs - Server Service
  • lsad/lsat - Local Security Authority
  • drsuapi - Directory Replication Service
  • tsch - Task Scheduler
  • epm - Endpoint Mapper
  • even/even6 - Event Log
  • wkst - Workstation Service

References

  • Source: impacket/dcerpc/v5/
  • [MS-RPCE]: Remote Procedure Call Protocol Extensions
  • [MS-DTYP]: Windows Data Types
  • [C706]: DCE 1.1: RPC Specification