Skip to main content

Introduction

Impacket’s DCE/RPC (Distributed Computing Environment / Remote Procedure Call) implementation provides comprehensive support for Microsoft’s RPC protocol suite. This enables interaction with Windows remote services over various transport protocols.

Architecture

The DCE/RPC implementation is organized into several layers:

Transport Layer

Provides protocol-independent RPC communication over multiple transports:
  • Named Pipes (SMB) - ncacn_np
  • TCP/IP - ncacn_ip_tcp
  • HTTP - ncacn_http
  • UDP - ncadg_ip_udp
  • Local pipes - ncalocal

RPC Runtime

Core protocol implementation (rpcrt.py):
  • PDU (Protocol Data Unit) handling
  • BIND/BIND_ACK negotiation
  • Authentication (NTLM, Kerberos, SCHANNEL)
  • Fragmentation and reassembly
  • Context management

Interface Layer

Protocol-specific implementations in dcerpc/v5/:
  • Service Control Manager (SCMR)
  • Security Account Manager (SAMR)
  • Local Security Authority (LSAD)
  • Directory Replication Service (DRSUAPI)
  • Windows Management Instrumentation (WMI/DCOM)
  • Many more…

Basic Usage

Creating a Connection

String Binding Format

RPC endpoints are specified using DCE string bindings:
Examples:

Authentication

NTLM Authentication

Kerberos Authentication

Authentication Levels

From rpcrt.py:112-118:

Error Handling

Common Status Codes

From rpcrt.py:149-200:

PDU Types

From rpcrt.py:40-60:

Best Practices

Connection Management

Reusing Connections

See Also