Sniffing in a Switched Network -With A Recipe To Hack A Switch Using Ettercap and Ethereal -Manu GargManu Garg manugarg at gmail.

Slides:



Advertisements
Similar presentations
DNS Attack Dalia Solomon. CONFIGURATION KNOPPIX SDT STD stands for security tools distribution A bootable CD with Linux OS, Linux kernel STD focuses.
Advertisements

Everything.
Security Lab 2 MAN IN THE MIDDLE ATTACK
Man in the Middle Attack
ARP Spoofing.
1 ICS 156: Lecture 2 (part 2) Data link layer protocols Address resolution protocol Notes on lab 2.
Cs/ee 143 Communication Networks Chapter 6 Internetworking Text: Walrand & Parekh, 2010 Steven Low CMS, EE, Caltech.
1 Address Resolution Protocol (ARP) Relates to Lab 2. This module is about the address resolution protocol.
CISCO NETWORKING ACADEMY Chabot College ELEC Address Resolution Protocol.
Media Access Control (MAC) addresses in the network access layer ▫ Associated w/ network interface card (NIC) ▫ 48 bits or 64 bits IP addresses for the.
Precept 3 Host Configuration 1 Peng Sun. What TCP conn. running? Commands netstat [-n] [-p] [-c] (Linux) lsof -i -P (Mac) ss (newer version of netstat)
Sniffing, Spoofing, Hijacking This presentation is an amalgam of presentations by Mark Michael, Randy Marchany and Ed Skoudis. I have edited and added.
SYSTEM ADMINISTRATION Chapter 19
Suneeta Chawla Web Security Presentation Topic : IP Spoofing Date : 03/24/04.
Network Attacks Mark Shtern.
CSEE W4140 Networking Laboratory Lecture 3: IP Forwarding and ICMP Jong Yul Kim
Oct 21, 2004CS573: Network Protocols and Standards1 IP: Addressing, ARP, Routing Network Protocols and Standards Autumn
Sanjay Goel, School of Business/Center for Information Forensics and Assurance University at Albany Proprietary Information 1 Unit Outline Information.
Adrian Crenshaw.  I run Irongeek.com  I have an interest in InfoSec education  I don’t know everything - I’m.
IP Routing: an Introduction. Quiz
1 Reminding - ARP Two machines on a given network can communicate only if they know each other’s physical network address ARP (Address Resolution Protocol)
Detection of Promiscuous nodes Using Arp Packets By Engin Arslan.
COEN 252: Computer Forensics Router Investigation.
Click to edit Master subtitle style Chapter 17: Troubleshooting Tools Instructor:
Introduction to InfoSec – Recitation 12 Nir Krakowski (nirkrako at post.tau.ac.il) Itamar Gilad (itamargi at post.tau.ac.il)
Everything. MACIP End-host IP: MAC: 11:11:11:11:11 gateway IP: MAC: 22:22:22:22:22 Google server IP: MACIP MACInterfaceMACInterface.
Advanced Networking for DVRs
Network Redundancy Multiple paths may exist between systems. Redundancy is not a requirement of a packet switching network. Redundancy was part of the.
ARP Scenarios CIS 81 and CST 311 Rick Graziani Fall 2005.
JMU GenCyber Boot Camp Summer, Network Sniffing Sometimes it is possible observe/record traffic traveling on a network Network traffic may contain.
COEN 252 Computer Forensics
Karlstad University Introduction to Vulnerability Assessment Labs Ge Zhang Dvg-C03.
Common Devices Used In Computer Networks
1 IP Forwarding Relates to Lab 3. Covers the principles of end-to-end datagram delivery in IP networks.
CNAP: Semester 2 ver. 2.1 Introduction to Router Configurations Or, “What The Heck Does That Line Do?” Bob Meyers, CCNA, CCAI Youngstown State University.
Network Security1 – Chapter 5 – Secure LAN Switching Layer 2 security –Port security –IP permit lists –Protocol filtering –Controlling LAN floods (using.
Release 16/07/2009Jetking Infotrain Ltd. Assembling and Cabling Cisco Devices Chapter 3.
CMPT 471 Networking II Address Resolution IPv4 ARP RARP 1© Janice Regan, 2012.
Introduction to InfoSec – Recitation 11 Nir Krakowski (nirkrako at post.tau.ac.il) Itamar Gilad (itamargi at post.tau.ac.il)
Mr. Mark Welton.  A computer network, or simply a network, is a collection of computers and other hardware interconnected by communication channels.
Connecting The Network Layer to Data Link Layer. ARP in the IP Layer The Address Resolution Protocol (ARP) The Address Resolution Protocol (ARP) Part.
CHAPTER 9 Sniffing.
ARP The Process and the Protocol. Note to reader The information explained in this section is a simplification and extrapolation of the actual ARP determination.
Sniffer, tcpdump, Ethereal, ntop
Networks Part 3: Packet Paths + Wireshark NYU-Poly: HSWP Instructor: Mandy Galante.
Internet Protocols. ICMP ICMP – Internet Control Message Protocol Each ICMP message is encapsulated in an IP packet – Treated like any other datagram,
Attacking on IPv6 W.lilakiatsakun Ref: ipv6-attack-defense-33904http://
Ethernet switch Hosts Can talk using Ethernet addresses only.
Cisco Confidential © 2013 Cisco and/or its affiliates. All rights reserved. 1 Cisco Networking Training (CCENT/CCT/CCNA R&S) Rick Rowe Ron Giannetti.
Networking Components William Isakson LTEC 4550 October 7, 2012 Module 3.
Address Resolution Protocol Yasir Jan 20 th March 2008 Future Internet.
End-host IP: MAC: 11:11:11:11:11 gateway IP: MAC: 22:22:22:22:22 Google server IP: interne t interface DNS server IP:
Cisco Routers Routers collectively provide the main feature of the network layer—the capability to forward packets end-to-end through a network. routers.
Introduction to Vulnerability Assessment Labs Ge Zhang Dvg-C03.
An Introduction To ARP Spoofing & Other Attacks
Introduction to Information Security
IP: Addressing, ARP, Routing
Networks Fall 2009.
Click to edit Master subtitle style
MAC Address Tables on Connected Switches
Lab 2: Packet Capture & Traffic Analysis with Wireshark
The Linux Operating System
MAC Addresses and ARP 32-bit IP address:
LAN Vulnerabilities.
Packet Sniffers Lecture 10 - NETW4006 NETW4006-Lecture09.
Chapter 6 – Routing.
ARP: Address Resolution Protocol
Chapter 2: Basic Switching Concepts and Configuration
2 - IP Routing.
Networking Essentials For Firewall-1 Administrators
Presentation transcript:

Sniffing in a Switched Network -With A Recipe To Hack A Switch Using Ettercap and Ethereal -Manu GargManu Garg manugarg at gmail dot com

Problem Statement- To gain access to main switch of your company using a machine in the same LAN. Tools used- Ettercap, Ethereal Techniques Used- Arp spoofing and Sniffing

How can we achieve our goal? Most of the network administrators use telnet to login to a cisco machine. Telnet is a clear-text protocol – so, if you can sniff the packets you can get to know what is other person talking to the machine. Easy then, I will just sniff the packets from the wire and get into my switch. Hey, I don’t see any traffic on the wire. What could be the reason? You are in switched network and switches don’t do any favor to the hackers. They transmit data only between the talking machines. But this is not fair. They said I am on ethernet. Are they not supposed to use CSMA/CD then? Ethernet has grown up buddy. It’s ‘switched ethernet’ now.

Hey wait! Don’t get disappointed too soon. We hackers are not supposed to get defeated by a switch. Right? Right. Our elite masters who designed TCP/IP protocols didn’t forget us. They left an otherwise invisible path which can only be seen by their enlightened students. So what is that path? It’s the path of arp spoofing. By using this technique you can fool your target machines to send data through your attacking machine and then you can sniff it on your attacking machine.

ARP SPOOFING!! How does it work? Target 1 IP: Hw: 00:00:00:00:00:01 Target 2 IP: Hw: 00:00:00:00:00:02 AM (Attacking Machine) IP: Hw: 00:00:00:00:00:03 Switch Switch forwarding traffic based on MAC address Before Attack……..

:00:00:00:00: :00:00:00:00:14 T1( ): T2( ): :00:00:00:00: :00:00:00:00:14 Before attack, T1 and T2 are talking to each other only. Below is the arp table of the machines. The switch understands only MAC addresses and forwards the packets to the right machines based on this MAC address. What if we manipulate the arp tables (this is called arp poisoning) on T1 and T2 so that the target MAC address in all the packets being exchanged between them, becomes the MAC address of our attacking machine. You got it right. Then switch will forward the packet to the attacking machine. So after attack arp table should look like something below: :00:00:00:00: :00:00:00:00:14 T1: :00:00:00:00: :00:00:00:00:14 T2: Where 00:00:00:00:00:03 is the MAC address of attacking machine.

ARP SPOOFING!! How does it work? Target 1 IP: Hw: 00:00:00:00:00:01 Target 2 IP: Hw: 00:00:00:00:00:02 AM (Attacking Machine) IP: Hw: 00:00:00:00:00:03 Switch Switch forwarding traffic based on MAC address After Attack…….. Note: Don’t forget to enable ip_forwarding on your attacking machine otherwise you’ll break down traffic between 2 machines.

OK. I guess, now you know what ARP spoofing is. Now the bigger question - How do we poison ARP table on T1 and T2? Explanation starts from another question. How do the hosts build this arp table? This table is built using arp protocol. ARP protocol has 2 kinds of packets – ARP request and ARP reply. When a machine (say, A) wants to know MAC address of another machine (say, B), it sends an ARP request asking “who has IP address B”. This is a broadcast, i.e. sent to FF:FF:FF:FF:FF:FF. It is picked up by all the machines in the LAN and only the machine possessing IP address B sends an ARP reply. It is sent to machine A only. Machine A stores this MAC address in it’s ARP table. Now you must be getting some clue. Yes, we are going to poison ARP table of T1 and T2 by sending them ARP replies. Most of the machines are generous enough and respect the ARP reply packet even when there was no request for particular IP address. There are some machines, for example SunOS, which make an ARP entry only if there is a request for the one or if that ip is already in the ARP table. We can make them request for particular IP address by sending them an ICMP Echo packet from that IP address.

Ok. So you want me to create these ARP replies myself and manage all this. No dude. We have blessings of our fellow hackers. Alberto Ornaghi (a.k.a. ALoR) and Marco Valleri (a.k.a. NaGA) from Milan have created a nice tool called Ettercap based on equally cool library ‘libnet’ from Mike. Ettercap is pretty versatile and tool of choice for MITM attacks including ARP spoofing. Ettercap also has sniffing capabilities, but I prefer to use it only for spoofing. For sniffing, I prefer using Ethereal. Main reason for this is the use of pcap format for storing packets by ethereal. Pcap is a pretty old format and there are many tools available to analyze pcap files. So, use ettercap for arp spoofing. Enable ip forwarding in kernel to maintain the connection between victim machines. And start sniffing using tethereal (text interface to ethereal). That’s all you need to do.

Recipe Let’s try to do everything said till now. Let’s look at our problem once again We want to get into the main switch of our company. This will allow us to configure the switch ports the way we want. First task, find out ip address of the switch. In my case it is You can use Nmap’s OS detection feature to guess it.Nmap Now find out how network admin communicates with the switch. In my case network admin sits offsite. So, he connects to the switch through WAN and the requests come through the gateway. I use another machine in the same subset to observe the traffic for sometime and find out that all incoming traffic to the subnet comes through the router and all outgoing traffic goes through the router So, when a network guy from logs into the switch console, packets are routed through the routers and

Routers (R) Hw Addr. 00:00:00:00:00:01 Attacked Switch (S) Cisco Catalyst 5000 series Hw. Addr. 00:00:00:00:00:02 Attacking Machine (M) RHEL AS Hw Addr : 00:00:00:00:00:03 Same subnet Rest of the network Routers (R) Hw Addr. 00:00:00:00:00:04

As you can guess, I need to put attacking machine in the path between to tap outgoing packets and – to tap incoming packets. So, I need to tell the router that is at 00:00:00:00:00:03 which is the MAC address of attacking machine. At the same time also tell switch i.e that is at 00:00:00:00:00:03. Before inviting packets to your machine, make sure you have path for them to reach their destination i.e. don’t forget to enable ip forwarding. In linux you can enable ip forwarding using following command: echo 1 >/proc/sys/net/ipv4/ip_forward Recipe …

To start arp spoofing using ettercap: ettercap -o -T -P repoison_arp -M arp:remote / / / / -o : only spoofing no sniffing. -T : text mode -P repoison_arp Tells it to load plugin repoison_arp. This plugin re-poisons arp table at some intervals -M arp:remote / / / / Tells it to start MITM attack with in first target group and , in second target group. I’ll suggest you to run ettercap in screen terminal, so that you can detach from screen and forget about it for some time. I used “ettercap NG-0.7.2”. You can download it from Start spoofing….

Start Sniffing … Now you are all set to start sniffing. Use following command to start sniffing and write packets to a file: # tethereal -afilesize: w /tmp/cisco.pcap -f "host and not arp and not icmp” -afilesize: limits the file size to 100MB. -w /tmp/cisco.pcap writes packets to /tmp/cisco.pcap -f “host and not arp and not icmp” is the filter string. It tells to collect the packets either coming from or going to and not to collect any arp or icmp packets.

Use some social engineering. Find out when network team is going to work on the switch or any other host which you want to break into. Leave your tools running while they do it. Later on you can analyze the capture file by opening it in ethereal and you can just follow the telnet stream to find out the password. That’s all it takes. A person is smart. People are dumb, panicky, dangerous animals and you know it. --Ed Solomon