ARP poisoning

Educational use only. This post was written in 2012–2013 for learning about security weaknesses. Use these techniques only on systems and networks you own or have explicit written permission to test. Unauthorised access is illegal under India's IT Act and similar laws worldwide. Some tools and methods here are now outdated.
Well talking about Network Security- "You can't afford to know less than the Hacker." This means that in order to protect ourselves effectively, we need to understand the same tools and techniques that are used against us.this is a short introduction to EtterCap 0.6a, is is often said to be a multipurpose sniffer / interceptor / logger for switched LANs. 

Ettercap heaviliy relies on ARP spoofing, and if this concept is new to you, you should read more about it before attempting this tutorial. 

NOTE: ARP spoofing could cause damage to your network!

Be sure to try this in a separate lab environment! Ettercap can be found at http://ettercap.sourceforge.net. 

(README file reads): 
EtterCap is a multipurpose sniffer / interceptor / logger for a switched LAN. It supports active and passive dissection of many protocols (even ciphered ones) and includes many features for network and host analysis. These features include 

  1. Characters injection in an established connection: You can inject character to server (emulating commands) or to client (emulating replies) maintaining the connection alive!


  2. SSH1 support: you can sniff User and Pass, and even the data of an SSH1 connection.


  3. HTTPS support: you can sniff http SSL secured data... and even if the connection is made through a PROXY


  4. Remote traffic through GRE tunnel: you can sniff remote traffic through a GRE tunnel from a remote Cisco router and make mitm attack on it


  5. PPTP broker: you can perform man in the middle attack against PPTP tunnels


  6. Password collector for: TELNET, FTP, POP, RLOGIN, SSH1, ICQ, SMB, MySQL, HTTP, NNTP, X11, NAPSTER, IRC, RIP, BGP, SOCKS 5, IMAP 4, VNC, LDAP, NFS, SNMP, HALF LIFE, QUAKE 3, MSN, YMSG.


  7. Packet filtering/dropping: You can set up a filter that search for a particular string (even hex) in the TCP or UDP payload and replace it with yours or drop the entire packet.


  8. OS fingerprint: you can fingerprint the OS of the victim host and even its network adapter


  9. Kill a connection: from the connections list you can kill all the connections you want


  10. Passive scanning of the LAN: you can retrieve info about: hosts in the LAN, open ports, services version, type of the host (gateway, router or simple host) and estimated distance in hop.


  11. Check for other poisoners: EtterCap has the ability to actively or passively find other poisoners on the LAN.

We will examine only a few of EtterCap's features - the rest is up to you. 
  1. The lab network consists of the following computers. 192.168.1.138 is the default Gateway. I'm using a Cisco Catalyst 2900XL Switch (switched environment).


  2.  

  3. A quick IPConfig on the 192.168.1.1 machine (our victim) to show the IP and ARP cache. Notice the MAC addresses listed in the ARP Cache - this is the "Before" shot.


  4.  

  5. I start EtterCap on my attacking machine (192.168.1.10) and choose my correct network adapter:


  6.  

  7. Once this is done, a quick ARP scan is performed in order to map out the network, and then the following screen is shown:



    This is the main screen. From here you can perform most of EtterCap's functions. You may press "H" on every screen to get a help menu, as shown in the next picture.


  8.  

  9. EtterCap knows how to "FingerPrint" machines. This is done by selecting a machine in the main screen, and pressing the "F" button.


  10.  

  11. Now for the hectic part… In order to start an ARP spoofing attack, we need to select a source and destination computer. I chose a client in my network (192.168.1.1) and my default gateway. This will effectively sniff all Internet traffic coming and going to 192.168.1.1. We now chose our source and destination as shown in the next picture, and press "A" in order to start the spoofing.


  12.  

  13. Once "A" is pressed, the attacked machine gets ARP poisoned, as we can see from the following picture. Notice that the ARP addresses for 192.168.1.10 (attacking machine) and 192.168.1.138 (Default Gateway) are the same!


  14.  

     

  15. We now will open an FTP session from the attacked computer (just as an example) and see what is logged.


  16.  

  17. We can see that the FTP session was captured and logged, including the cleartext username and password.



    If we chose the specific session and enter it, we will see the actual data that passed on the network (see next picture).



    We have successfully managed to sniff a machine on a switched network. However, EtterCap can go beyond sniffing, and even intervene in existing sessions. It's definitely one of those tools worth investigating.


  18. Don't forget that by pressing "H" on each screen you'll get a "Help" menu, to guide you as you go along.


  19.  

    So we've ARP spoofed a few connections…weeeha. Where's the "Beyond" you promised? 

    Well, the beyond bit lies in the fact the EtterCap can intervene in the traffic stream, and modify strings at our will! The implications of this are endless, but I'll give a short demonstration of this capability. 
    Say you wanted to replace a TCP stream of a WWW session, so that every time the address www.google.com would redirect you to www.h4ckups.blogspot.com. 

    1. Chose the Spoofed source and destination computers, as shown before, and start the spoofing process.


    2.  

    3. Press "F" to edit your filters:


    4.  

    5. We want to edit the "Filters on source" to replace www.google.com to www.h4ckups.blogspot.com.
    6.  on destination port 80. To do this, we press "W" to enter the Source filters. We then press "A" to add a filter. Choose the specified filter (in case we have a few) and press enter to edit it. Add the required input to create your filter.


    7.  

    8. Pressinq "Q" will exit this screen and ask us if we want to save our filter. Choose "yes".
    9. We are now back at the filter screen. Notice that we just made the filter; we still have not ACTIVATED it (both filters are "OFF").


    10.  

    11. To activate the filter we need to press "S", and then we should see the filter status turn to "ON".


    12. We now try to surf to www.google.com on the attacked machine:

    13. Please note - this is not a Web server defacement - it's manipulation of the data stream that reaches a specific host in our network, in conjunction with ARP spoofing. 

      Conclusion 

      So how do we protect our Organization from this evil, evil type of network activity? Well, you're not going to like the answer - There's no simple way. We could use Arpwatch, which is a small daemon that runs on Linux. Arpwatch monitors Ethernet activity and keeps a database of Ethernet / IP address pairings, and can alert on any unexpected changes. Or, we could occasionally use Ettercap to check for the presence of other poisoners. 

       

      TEAM HACKUP'S


— Ankur Mehta, Hackup's

Comments

Popular posts from this blog

How to Check if Your Email or Password Was Leaked (and What to Do Next)

Types of Hash & Encryption

Burp Suite Tutorial for Beginners: A QA Tester's First Web App Security Test