What is Impacket?

Impacket is a collection of Python classes focused on providing access to network packets. Impacket allows Python developers to craft and decode network packets in simple and consistent manner. It includes support for low-level protocols such as IP, UDP and TCP, as well as higher-level protocols such as NMB and SMB. Impacket is highly effective when used in conjunction with a packet capture utility or package such as Pcapy. Packets can be constructed from scratch, as well as parsed from raw data. Furthermore, the object oriented API makes it simple to work with deep protocol hierarchies.

The following protocols are featured in Impacket

The following tools are featured in Impacket

RPCDump

An application that communicates with the Endpoint Mapper interface from the DCE/RPC suite. This can be used to list services that are remotely available through DCE/RPC, such as Windows Messenger.

SAMRDump

An application that communicates with the Security Account Manager Remote interface from the DCE/RPC suite. It lists system user accounts, available resource shares and other sensitive information exported through this service.</font>

Tracer

An application (written using Tkinter) that displays a parallel coordinates graph of captured traffic. With this type of graph it is easy to detect unexpected network usage patterns. Tracer currently supports TCP and UDP traffic, but can be easily extended to handle other protocols.

Split

A tool that can divide any pcap supported capture file into several smaller files. This application was developed to manage megabytes of captured traffic. Split currently supports TCP streams, but can be easily extended to handle other stream-oriented protocols.

smbclient.py

A generic SMB client (written using Impacket) that will let you list shares and files, rename, upload and download files and create and delete directories, all using either username and password or username and hashes combination. It's an excellent example to see how to use impacket.smb in action.</font></dd>

chain.py, oochain.py, loopchain.py and crapchain.py

Four different examples of how to chain SMB commands. The first one simply chains four commands. oochain will chain the same four commands, but send them out of order in the packet. loopchain will chain 2 commands in a loop, making the SMB server act like if receiving more than 200 commands. crapchain will chain the same four commands, but adding bogus data between them.

exploit.py and smb05-039-crash.py

exploit.py is the implementation of the class DCERPCExploit, which can be used as base to create DCERPC exploits. When doing an exploit based on this class, it will automatically have support to let the user tweak how the DCERPC traffic is sent. For example, you can configure the maximum fragment size, either for the transport (TCP/SMB/etc) or for DCERPC, it lets you select how you want the data to be read and writen, etc. ms05-039-crash.py is an example implementation of a crash (exploit only crashing the server) for the vulnerability described in Microsoft's advisory MS05-039.

Source code

Setup

Documentation

Most documentation is included in the source as Python's doc comments, but were are some examples upon which you can base your own programs:

Licensing

This software is provided under a slightly modified version of the Apache Software License. Feel free to review it here and compare it to the official Apache Software License.

Contact Us

Whether you want to report a bug, send a patch or give some suggestions on this package, drop us a few lines at oss- at -coresecurity.com.

Description

Title
Impacket
Release date
2003
License type
Apache

Attachments

-
ping.py - A simple ping implementation.
rpcdump.py - DCE/RPC endpoint dumper.
samrdump.py - User and shares lister.
sniffer.py - Sniffer implementation that uses raw sockets.
split.py - A pcap capture files splitter.
tracer.py - Pcap-based parallel coordinates graphic generator.