Impacket provides low-level Python APIs and example tools to craft, parse, and implement network protocols including SMB, MSRPC, and common Microsoft stacks.
Overview
Impacket is a collection of Python classes focused on network protocols. It emphasizes programmatic access to packet structures and, for some protocols such as SMB and MSRPC, includes protocol implementations usable directly from Python code.
Packets can be built from scratch or parsed from raw bytes through an object-oriented hierarchy. The project ships example tools that illustrate typical automation and research tasks built on the library.
Protocol coverage listed in the documentation spans Ethernet and Linux cooked capture, IPv4 and IPv6, TCP, UDP, ICMP, IGMP, ARP, NetBIOS, SMB1 through SMB3, MSRPC over several transports, multiple authentication mechanisms, partial implementations of many RPC interfaces, and portions of TDS and LDAP. Maintainers position the code for security research and education rather than production deployments.
Installation is available via pipx, local package install, or a Docker image build. A disclaimer notes the code is intended for research and educational use, not commercial production environments without proper security practices.
Key features
- Packet construction and parsing APIs
- SMB and MSRPC protocol implementations
- IPv4 and IPv6 protocol support
- NTLM and Kerberos authentication helpers
- Example command-line utilities
- MSRPC interface coverage subset
- Docker image build support
- pipx installation path
Use cases
- Security research on Windows protocols
- Teaching network protocol internals
- Building custom SMB or RPC clients
- Parsing captured network traffic
- Automating protocol-level experiments