TechKnowSurge
VideoSecurityFree

DEMO: DHCP Starvation Attack

A DHCP starvation attack exhausts a DHCP server's address pool by flooding it with requests from spoofed MAC addresses, preventing legitimate devices from obtaining IP addresses. This content covers how the attack works and demonstrates its execution using DHCPig on Kali Linux.

Complete this video to capture a CTF flag worth 1 point.

About this video

DHCP, the Dynamic Host Configuration Protocol, is responsible for automatically assigning IP addresses, subnet masks, default gateways, DNS servers, and other network configuration data to devices as they connect. Every DHCP server maintains a scope, or pool, of addresses it can distribute, and that pool is finite. A DHCP starvation attack exploits this limitation by repeatedly requesting addresses using spoofed MAC addresses, tricking the server into allocating its entire pool to a single malicious host. Once the pool is exhausted, no further addresses can be issued, and legitimate devices attempting to join the network are denied connectivity. The attack is demonstrated across a three-machine lab environment consisting of a victim Windows machine, a Cisco switch acting as the DHCP server, and a Kali Linux attacker system. Before launching the attack, the DHCP bindings on the Cisco switch are cleared and the victim's existing lease is released to establish a clean baseline. DHCPig, an open-source tool installed via apt on Kali Linux, is then pointed at the network interface connected to the target network and executes the starvation sequence automatically, cycling through spoofed MAC addresses until the server reports the pool as exhausted. After the attack completes, the DHCP binding table on the Cisco switch shows every available address has been allocated. When the victim machine attempts to renew or obtain a new lease, it receives no response, confirming that the pool is fully starved. This technique is covered strictly within an ethical hacking and authorized testing context, and should only be applied to networks for which explicit permission has been granted.

What you'll learn

What's covered

DHCP Starvation Attack

Key terms

Dynamic Host Configuration Protocol
DHCP
A network protocol that automatically assigns IP addresses and other configuration parameters to devices on a network.
Media Access Control
MAC
A sublayer of the Data Link layer that controls how devices on a network gain access to a medium and transmit data.
Spoofing
An attack where an adversary impersonates a trusted entity by falsifying data such as an IP address or email address.
Denial of Service
DoS
An attack that floods a system or network with traffic to make it unavailable to legitimate users.
DHCP Scope
The defined pool of IP addresses that a DHCP server is configured to assign to clients on a specific subnet, along with associated options such as the subnet mask, default gateway, and DNS servers. Each subnet served by a DHCP server has its own scope.
DHCP Starvation Attack
An attack that exhausts a DHCP server's address pool by repeatedly requesting IP addresses using spoofed MAC addresses, preventing legitimate hosts from obtaining network configuration.

Topics

Network Security Dhcp Denial Of Service Kali Linux Ethical Hacking Mac Spoofing

Transcript

We're going to take a look at a DHCP starvation attack.

How DHCP Works

DHCP, or dynamic host configuration protocol, is a way that we can give a machine on a network an IP address, mask, default gateway, DNS server and other pieces of information. This machine will request it, and then a DHCP server will respond with what its IP address and all the rest of the information should be.

DHCP has something called scopes or pools. This is the list of addresses that can be handed out. So when a machine requests an address, then this server will choose one of the addresses within its scope or pool and then offer it up to this client on the network.

How the Attack Works

The scope and pool is limited in the amount of resources. So a DHCP starvation attack starves the scope or the pool from all of its addresses. How it does this is the machine requests, hey, I need an IP address, from one MAC address, which then it gets a reply back of one of the addresses here. Then it says, oh yeah, I need another one, but from a different MAC address, so it'll get a different IP address. And it'll just keep sending them out until it uses up all of the addresses that are within the scope. And now we're starved of IP addresses that we can hand out.

Now a new machine connects to the network and then asks for an IP address, but this server no longer can give those IP addresses, because you can't have duplicate addresses on the network.

Just a reminder that this video is for ethical hacking purposes only. Make sure you only do this on a network that either you own or have gotten permission to carry out these techniques.

Checking the Victim Machine

All right, I'm on my demo machine here, and I'm going to type in ipconfig so we can see what the IP address is, which is 10.110.199. I can also take a look at what the MAC address is. So I'm going to do ipconfig /all, and it's going to give me extra information to include the physical address. So this is the MAC address of the machine, and it starts out with BC-24.

The DHCP Server

The other thing that I'm going to show you is the DHCP server, which is on a switch, a Cisco switch. So I'm on this Cisco switch right here, and what I can do is I can see some stats on this by doing a show ip dhcp, and we're going to take a look at the bindings. So these are essentially the different IP addresses that are already handed out. So this is the 10.110.199, that's the IP that was handed out, and it was to this MAC address of BC-24. So we can see that there's a correlation here, and it's keeping track of what it's handed out and who it's handed out to.

So if I were to do a renew on this, release this, the demo machine that I first showed you, the victim machine, we'll call it the victim machine, would reach out and get the same IP address every time because it's associated with this MAC address right here. So that's how DHCP keeps track of who it's handed out to, is by those MAC addresses.

Setting Up the Adversary Box

So now we're going to jump on the adversary box. So we've got essentially three boxes now that are in play. We got the victim machine, we got the DHCP server, and now what we're going to do is we're going to use this adversary box, which is Kali Linux, to carry out this attack.

To carry out this attack, we're going to use a program called DHCPig, or DHCPig. So we're going to download this. I'm going to open up a command prompt, and I'm going to make this a little bit bigger so we can see it in our demo here, and then we're going to use this to install DHCPig. We'll start by typing our sudo apt-get update and hit enter. Now that that's installed, we are going to do an install, so apt-get install, and it's going to be of that DHCPig, and we'll hit enter.

All right, now that that's installed, what I can do is I can type in DHCPig to see what some of the details are of executing this command, and as we can see here, we've got a lot of options. And then we've got the interface that we're going to specify, which the one that we're going to hit is going to be eth0. And just to show you what that looks like, I'm going to do an ip a here, and we can see eth0 is going to be this 10.110.31 network, which is the network that we're trying to attack in this case.

Resetting Before the Attack

And now there's one more thing that I need to do before I carry out this attack. I'm going to do a little reset on some stuff. So let me show you how to do that.

The first thing is that this machine already has an IP address, so I need to first of all remove that address. So I'm going to do an ipconfig /release, so that way it gets rid of this IP address and it no longer has that IP address.

The other thing is that this has this binding already, so even though we're going to do this starvation, it's not going to clear this out, so we need to clear this out first. So I'm going to do a clear, and then we'll do an ip dhcp binding, so we'll type that out, hit enter. Oh, needs another, and then we're just going to clear all, so let's clear all and do that. And then let's go ahead and show that IP binding again, so we can see nothing's in there. Now what we've just done is, if we hadn't cleared that out, then during the renewal process it would have just picked that back up again. So now we've stopped that from picking up that same address again.

Launching the Attack

And now what we're going to do is we're going to launch this attack. So we're back on this machine, this adversary box. We're going to type in our DHCPig, and then it's for eth0, is what we're going to launch an attack against that network, and hit enter and let's see what happens. So what we're seeing right here is that it's going through and systematically asking for all of these IP addresses, and then every time it gives a new IP address, then it exhausts one more address, and it's going through that process of exhausting all of those addresses.

Okay, so we can see here that it thinks that the pool is exhausted now, and it's done with this operation. So let's take a look at our DHCP server and see what it looks like. We can do that show ip dhcp binding again. We can see now that it's been requested for all of these different IP addresses, and so now we've exhausted this pool.

So on this machine, let's do a renew to get a new IP address, and hit enter and see what it comes up with. All right, I've waited a while and it's still trying to renew. So what we can see here is that there are no addresses that are available now for these legitimate users, because we've starved that scope from any of these IP addresses.

So here's the attack on DHCP starvation. Essentially what we're doing is we're just using up all of these, whatever we can, all these IP addresses, so they can't be handed out for legitimate users.

About TechKnowSurge

TechKnowSurge builds IT and cybersecurity professionals through hands-on, concept-first training built around real understanding — not memorization. Free interactive tools, structured programs, and 25+ years of real-world experience, all in one place.

Explore free tools and programs →