How fortra/impacket works
Impacket is a Python networking-protocol library: callers construct protocol objects or parse raw packets, then use protocol implementations and transports to communicate with network peers. Its main branches cover packet-level protocols, SMB, MSRPC, and authentication/security, with LDAP and TDS as additional protocol implementations. The README documents the capabilities; source-index references support several internal dependencies. Unsampled implementations are represented at their exact file or enclosing-directory paths, so their internal call flows are not inferred.
Main entry points: rpcrt.py RPC runtime · smbconnection.py SMB connection API · spnego.py SPNEGO negotiation · smb.py SMB1–3 protocol
Components 21
Packets and protocols
- Packet encode and decode
impacket/ImpactPacket.py - Packet decoder
impacket/ImpactDecoder.py - IP and network protocols
impacket/IP6.py - Other protocol modules
impacket/dns.py - Structure serialization
impacket/structure.py
SMB networking
- SMB1–3 protocol
impacket/smb.py - SMB2–3 implementation
impacket/smb3.py - SMB connection API
impacket/smbconnection.py - NetBIOS session transport
impacket/nmb.py
MSRPC
- RPC transports
impacket/dcerpc/v5/transport.py - RPC runtime
impacket/dcerpc/v5/rpcrt.py - NDR serialization
impacket/dcerpc/v5/ndr.py - RPC interface modules
impacket/dcerpc/v5 - DCOM runtime
impacket/dcerpc/v5/dcomrt.py
Authentication and security
- NTLM authentication
impacket/ntlm.py - Kerberos authentication
impacket/krb5/kerberosv5.py - SPNEGO negotiation
impacket/spnego.py
Directory and database protocols
- LDAP protocol
impacket/ldap/ldap.py - TDS protocol
impacket/tds.py
Other components
- Library caller
- Network peer
Connections 27
- Library caller → Packet encode and decode: constructs packets
README.md - Library caller → Packet decoder: parses packets
README.md - Packet decoder → Packet encode and decode: decodes packet objects
- Packet encode and decode → Structure serialization: uses serialization
- Library caller → SMB connection API: uses SMB API
README.md - SMB connection API → SMB1–3 protocol: uses SMB
- SMB connection API → SMB2–3 implementation: uses SMB3
- SMB1–3 protocol → NetBIOS session transport: uses sessions
impacket/smb.py - SMB1–3 protocol → NTLM authentication: uses authentication
impacket/smb.py - Library caller → RPC transports: selects transport
README.md - RPC transports → RPC runtime: creates RPC client
impacket/dcerpc/v5/transport.py - RPC runtime → NDR serialization: serializes calls
impacket/dcerpc/v5/rpcrt.py - RPC runtime → NTLM authentication: supports authentication
impacket/dcerpc/v5/rpcrt.py - RPC runtime → Kerberos authentication: supports authentication
impacket/dcerpc/v5/rpcrt.py - Library caller → RPC interface modules: invokes interfaces
README.md - RPC interface modules → RPC runtime: uses RPC runtime
impacket/dcerpc/v5/tsts.py - DCOM runtime → RPC runtime: uses RPC runtime
impacket/dcerpc/v5/dcomrt.py - Library caller → LDAP protocol: uses LDAP
README.md - LDAP protocol → SPNEGO negotiation: uses negotiation
impacket/ldap/ldap.py - Library caller → TDS protocol: uses TDS
README.md - TDS protocol → SPNEGO negotiation: uses negotiation
impacket/tds.py - SPNEGO negotiation → NTLM authentication: supports NTLM
impacket/spnego.py - SPNEGO negotiation → Kerberos authentication: supports Kerberos
impacket/krb5/kerberosv5.py - SMB connection API → Network peer: communicates with
- RPC transports → Network peer: communicates with
README.md - LDAP protocol → Network peer: communicates with
- TDS protocol → Network peer: communicates with