Search This Blog

Tuesday, May 14, 2013

ARP POISIONING + MITM ATTACK


Today i would like to share a simple / old / educational method of sniffing passwords on a LAN ( Local Area Network).
There are quite a few ways and tools out there designed to do this but to keep things simple and basic, we will be using ettercap from Backtrack 5.
Below i will show you a basic method to use ettercap and perform an arp poisoning/Mitm attack on a LAN. This will allow you to sniff HTTP, FTP, TELNET, POP usernames and passwords.

Updating Ettercap :
1) Open terminal and type “sudo apt-get update” and wait for it to finish loading.
2) Next type “apt-get install ettercap”
3) Lastly, type “apt-get install ettercap-gtk

Preparation :
1) On a terminal and type “locate etter.conf” and you will be presented with a similar screen as shown below.
http://zyphyto1.host56.com/ettercap/1.png

2) Next type, “nano /etc/etter.conf”.
http://zyphyto1.host56.com/ettercap/snapshotnanoetterconf.png

3) Ok so now to give ettercap root privileges we will have to change the ec_uid & ec_gid to a value of 0. So the final outcome would be :
http://zyphyto1.host56.com/ettercap/2.png
ec_uid = 0 # nobody is the default
ec_gid = 0 # nobody is the default

4) Scroll right down to the Linux column. And unhash the two lines shown below.
http://zyphyto1.host56.com/ettercap/3.png
#---------------
#     Linux Before Mdofication
#---------------

# if you use ipchains:
   #redir_command_on = "ipchains -A input -i %iface -p tcp -s 0/0 -d 0/0 %port -j REDIRECT %rport"
   #redir_command_off = "ipchains -D input -i %iface -p tcp -s 0/0 -d 0/0 %port -j REDIRECT %rport"

# if you use iptables:
   #redir_command_on = "iptables -t nat -A PREROUTING -i %iface -p tcp --dport %port -j REDIRECT --to-port %rport"
   #redir_command_off = "iptables -t nat -D PREROUTING -i %iface -p tcp --dport %port -j REDIRECT --to-port %rport"


#---------------
#     Linux after Modification
#---------------

# if you use ipchains:
   #redir_command_on = "ipchains -A input -i %iface -p tcp -s 0/0 -d 0/0 %port -j REDIRECT %rport"
   #redir_command_off = "ipchains -D input -i %iface -p tcp -s 0/0 -d 0/0 %port -j REDIRECT %rport"

# if you use iptables:
   redir_command_on = "iptables -t nat -A PREROUTING -i %iface -p tcp --dport %port -j REDIRECT --to-port %rport"
   redir_command_off = "iptables -t nat -D PREROUTING -i %iface -p tcp --dport %port -j REDIRECT --to-port %rport"
5) Once you have completed and checked your modifications. CLick Ctrl-X (to exit), then press Y (Yes to save) and lastly press the Enter key.
6) Type in “Clear” to clear up your messy terminal. Cleanliness is next to Godliness. Congratulations, we are done with the boring stuff.

Lets Begin :
1) Open up a terminal and type ettercap -G.
http://zyphyto1.host56.com/ettercap/ETtercap-g.png

2) On the new GUI that appears, click Sniff –> Unified Sniffing.
http://zyphyto1.host56.com/ettercap/choosesniff.png

3) Now go to “Hosts” and click on “Scan for hosts”.
http://zyphyto1.host56.com/ettercap/choosehost.png

4) Next you will be prompted for your Network Interface. Choose your interface and press the Enter key.
http://zyphyto1.host56.com/ettercap/networkinterface.png

5) You will ettercap scans the whole netmask for 255 hosts and present you with a little message like this :
Randomizing 255 hosts for scanning…
Scanning the whole netmask for 255 hosts…
1 hosts added to the hosts list…

6) Now on the ettercap GUI click on Start –> Start Sniffing.
http://zyphyto1.host56.com/ettercap/startsniffing.png

7) Click on MitM –> Arp Poisoning.
http://zyphyto1.host56.com/ettercap/mitm.png

8) When the prompt screen appears, tick on Sniff Remote Connections and click OK.
http://zyphyto1.host56.com/ettercap/sniffremoteconnections.png

9) Now lets sit back and wait for activity in the server!
2.5 mins later…………..Voila! It shows we have username and password of hotmail.com, twoo.com, eurospot.com.
http://zyphyto1.host56.com/ettercap/snapshot5.png

10) When you are done, click Start –>Stop Sniffing & stop MITM attack. You will notice the command ‘Re-Arping’on the bottom of your GUI. This means it is fixing up the network to make it like it was before.

Authors Note :
1) Ettercap takes a little tweaking on different systems to get it going smoothly, so if this method does not work for you. Just mess around with it, through mistakes you will learn more :P
2) This tutorial was intended to explain mass network sniffing as i had no victims at hand.
3) This is for educational purposes, please do not harm the innocent.

Add To Google BookmarksStumble ThisFav This With TechnoratiAdd To Del.icio.usDigg ThisAdd To RedditTwit ThisAdd To FacebookAdd To Yahoo

0 comments:

Post a Comment