Sniffing & Spoofingdhcpexhaustionattackscapyarpnetwork

DHCPig

DHCPig is a DHCP exhaustion script that consumes all available IP addresses on a LAN, preventing new users from obtaining IPs. It also releases IPs in use, sends gratuitous ARP, and knocks Windows hosts offline.

Description

DHCPig initiates an advanced DHCP exhaustion attack using the scapy network library. It exhausts all DHCP addresses on the network, stops new users from getting IPs, releases existing leases, and disrupts the network further with gratuitous ARP to knock Windows hosts offline. The tool requires admin privileges and has been tested on multiple Linux distributions and DHCP servers like ISC and Windows 2k3/2k8.

Use cases include network penetration testing to demonstrate DHCP vulnerabilities, simulating denial-of-service attacks on DHCP services, and educational purposes to understand DHCP protocol weaknesses. It is particularly useful in red team exercises targeting LAN environments where DHCP is the primary IP assignment method.

The script is invoked via pig.py and provides various options for customization, such as verbosity levels, IPv6 support, and detection of ARP/ICMP traffic.

How It Works

DHCPig uses the scapy library to send DHCPDISCOVER packets on the specified interface, flooding the DHCP server to exhaust the IP address pool. It detects responses from DHCP servers, releases any leases it obtains, and optionally sends gratuitous ARP packets to poison ARP caches and disrupt connected hosts, especially Windows machines. Additional features include monitoring ARP, ICMP, and DHCP replies, with support for DHCPv6 and multi-threading for amplified attacks.

Installation

bash
sudo apt install dhcpig

Flags

-h, --helpShow help message
-v, --verbositySet verbosity level (0=no, 1=minimal, 10=default, 99=debug)
-6, --ipv6Enable DHCPv6 (off by default, DHCPv4)
-1, --v6-rapid-commitEnable RapidCommit for DHCPv6 (2-way IP assignment)
-t, --threadsNumber of sending threads (default 1)
-a, --show-arpDetect and print ARP who_has requests
-i, --show-icmpDetect and print ICMP requests
-o, --show-optionsPrint lease information options
-l, --show-lease-confirmDetect and print DHCP replies
-g, --neighbors-attack-garpKnock off network segment using gratuitous ARPs

Examples

Exhaust all available DHCP addresses using the eth0 interface
pig.py eth0
Display the help message and usage options
dhcpig -h
Run with default verbosity level 10 on eth0
pig.py -v 10 eth0
Perform DHCPv6 exhaustion attack on eth0
pig.py -6 eth0
Use 5 sending threads for exhaustion on eth0
pig.py -t 5 eth0
Enable gratuitous ARP attack to knock off hosts on eth0
pig.py -g eth0
Show ARP and ICMP detections during attack on eth0
pig.py -a -i eth0
Updated 2026-04-16kali.org ↗