SlideShare une entreprise Scribd logo
1  sur  15
Sniffing in a Switched Network -With A Recipe To Hack A Switch Using Ettercap and Ethereal ,[object Object],[object Object],[object Object]
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: 192.168.1.1 Hw: 00:00:00:00:00:01 Target 2 IP: 192.168.1.100 Hw: 00:00:00:00:00:02 AM (Attacking Machine) IP: 192.168.1.121 Hw: 00:00:00:00:00:03 Switch Switch forwarding traffic based on MAC address Before Attack……..
T1(192.168.1.1): T2(192.168.1.100): 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: T1: T2: Where 00:00:00:00:00:03 is the MAC address of attacking machine . 00:00:00:00:00:14 192.168.1.123 00:00:00:00:00:02 192.168.1.100 00:00:00:00:00:14 192.168.1.123 00:00:00:00:00:01 192.168.1.1 00:00:00:00:00:14 192.168.1.123 00:00:00:00:00:03 192.168.1.100 00:00:00:00:00:14 192.168.1.123 00:00:00:00:00:03 192.168.1.1
ARP SPOOFING!! How does it work? Target 1 IP: 192.168.1.1 Hw: 00:00:00:00:00:01 Target 2 IP: 192.168.1.100 Hw: 00:00:00:00:00:02 AM (Attacking Machine) IP: 192.168.1.121 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 192.168.1.100. You can use  Nmap ’s OS detection feature to guess it. 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 192.168.1.2 and all outgoing traffic goes through the router 192.168.1.1.  So, when a network guy from 192.168.101.34 logs into the switch console, packets are routed through the routers 192.168.1.1 and 192.168.1.2.
Routers (R) 192.168.1.1 Hw Addr. 00:00:00:00:00:01  Attacked Switch (S) Cisco Catalyst 5000 series 192.168.1.100 Hw. Addr. 00:00:00:00:00:02 Attacking Machine (M) RHEL AS 4.0 192.168.1.121 Hw Addr : 00:00:00:00:00:03 Same subnet Rest of the network Routers (R) 192.168.1.2 Hw Addr. 00:00:00:00:00:04
As you can guess, I need to put attacking machine in the path between 192.168.1.1 - 192.168.1.100 to tap outgoing packets and 192.168.1.2 – 192.168.1.100 to tap incoming packets.  So, I need to tell the router 192.168.1.2 that 192.168.1.100 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. 192.168.1.100 that 192.168.1.1 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 /192.168.1.100/ /192.168.1.1-2/ -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 /192.168.1.100/ /192.168.1.1-2/ Tells it to start MITM attack with 192.168.1.100 in first target group and  192.168.1.1, 192.168.1.2 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  http://ettercap.sourceforge.com . 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:100000 -w /tmp/cisco.pcap -f "host 192.168.1.100 and not arp and not icmp” -afilesize:100000  limits the file size to 100MB. -w /tmp/cisco.pcap writes packets to /tmp/cisco.pcap -f “host 192.168.1.100 and not arp and not icmp ” is the filter string. It tells to collect the packets either coming from or  going to  192.168.1.100 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

Contenu connexe

Tendances (20)

Dynamic Port Scanning
Dynamic Port ScanningDynamic Port Scanning
Dynamic Port Scanning
 
Understanding NMAP
Understanding NMAPUnderstanding NMAP
Understanding NMAP
 
Nmap
NmapNmap
Nmap
 
Basics of firewall, ebtables, arptables and iptables
Basics of firewall, ebtables, arptables and iptablesBasics of firewall, ebtables, arptables and iptables
Basics of firewall, ebtables, arptables and iptables
 
NMAP - The Network Scanner
NMAP - The Network ScannerNMAP - The Network Scanner
NMAP - The Network Scanner
 
Nmap and metasploitable
Nmap and metasploitableNmap and metasploitable
Nmap and metasploitable
 
NMap
NMapNMap
NMap
 
Ch 5: Port Scanning
Ch 5: Port ScanningCh 5: Port Scanning
Ch 5: Port Scanning
 
NMAP
NMAPNMAP
NMAP
 
Best!
Best!Best!
Best!
 
Nmap Basics
Nmap BasicsNmap Basics
Nmap Basics
 
Nmap
NmapNmap
Nmap
 
Recon with Nmap
Recon with Nmap Recon with Nmap
Recon with Nmap
 
Nmap(network mapping)
Nmap(network mapping)Nmap(network mapping)
Nmap(network mapping)
 
Nmap
NmapNmap
Nmap
 
Scanning with nmap
Scanning with nmapScanning with nmap
Scanning with nmap
 
IP tables
IP tablesIP tables
IP tables
 
Packet Filtering Using Iptables
Packet Filtering Using IptablesPacket Filtering Using Iptables
Packet Filtering Using Iptables
 
TCPdump-Wireshark
TCPdump-WiresharkTCPdump-Wireshark
TCPdump-Wireshark
 
Nmap
NmapNmap
Nmap
 

En vedette

Επιχειρηματικότητα και μοντέλα διαδικτυακής επιχειρηματικοτητας
Επιχειρηματικότητα και μοντέλα διαδικτυακής επιχειρηματικοτηταςΕπιχειρηματικότητα και μοντέλα διαδικτυακής επιχειρηματικοτητας
Επιχειρηματικότητα και μοντέλα διαδικτυακής επιχειρηματικοτηταςIosif Alvertis
 
Matemáticas II - ecuaciones lineales 3 incognitas
Matemáticas II - ecuaciones lineales 3 incognitasMatemáticas II - ecuaciones lineales 3 incognitas
Matemáticas II - ecuaciones lineales 3 incognitasanalaura_fdz
 
Matemáticas II - ecuaciones cuadráticas
Matemáticas II - ecuaciones cuadráticasMatemáticas II - ecuaciones cuadráticas
Matemáticas II - ecuaciones cuadráticasanalaura_fdz
 
Matemáticas II - bloque 3
Matemáticas II - bloque 3Matemáticas II - bloque 3
Matemáticas II - bloque 3analaura_fdz
 
Lecture3a symmetric encryption
Lecture3a symmetric encryptionLecture3a symmetric encryption
Lecture3a symmetric encryptionrajakhurram
 
Prensentation on packet sniffer and injection tool
Prensentation on packet sniffer and injection toolPrensentation on packet sniffer and injection tool
Prensentation on packet sniffer and injection toolIssar Kapadia
 
Effect of substituents and functions on drug structure activity relationships
Effect of substituents and functions on drug structure activity relationshipsEffect of substituents and functions on drug structure activity relationships
Effect of substituents and functions on drug structure activity relationshipsOmar Sokkar
 
Rotary Newsletter - 30 January 2017
Rotary Newsletter - 30 January 2017Rotary Newsletter - 30 January 2017
Rotary Newsletter - 30 January 2017rotaryeclubsa9400
 
Tata steel’s acquisition of corus
Tata  steel’s  acquisition  of  corusTata  steel’s  acquisition  of  corus
Tata steel’s acquisition of corusUdayan Sikdar
 
Tata Corus acquisition
Tata Corus acquisitionTata Corus acquisition
Tata Corus acquisitionSouptik Sarkar
 
Denial of service attack
Denial of service attackDenial of service attack
Denial of service attackKaustubh Padwad
 
Denial of service attack
Denial of service attackDenial of service attack
Denial of service attackAhmed Ghazey
 

En vedette (20)

Sniffing and spoofing
Sniffing and spoofingSniffing and spoofing
Sniffing and spoofing
 
832-7678-2-PB
832-7678-2-PB832-7678-2-PB
832-7678-2-PB
 
vicrael pineda
vicrael pinedavicrael pineda
vicrael pineda
 
днз №31
днз №31днз №31
днз №31
 
Επιχειρηματικότητα και μοντέλα διαδικτυακής επιχειρηματικοτητας
Επιχειρηματικότητα και μοντέλα διαδικτυακής επιχειρηματικοτηταςΕπιχειρηματικότητα και μοντέλα διαδικτυακής επιχειρηματικοτητας
Επιχειρηματικότητα και μοντέλα διαδικτυακής επιχειρηματικοτητας
 
Matemáticas II - ecuaciones lineales 3 incognitas
Matemáticas II - ecuaciones lineales 3 incognitasMatemáticas II - ecuaciones lineales 3 incognitas
Matemáticas II - ecuaciones lineales 3 incognitas
 
Matemáticas II - ecuaciones cuadráticas
Matemáticas II - ecuaciones cuadráticasMatemáticas II - ecuaciones cuadráticas
Matemáticas II - ecuaciones cuadráticas
 
Matemáticas II - bloque 3
Matemáticas II - bloque 3Matemáticas II - bloque 3
Matemáticas II - bloque 3
 
Class 4A OT425 2017
Class 4A OT425 2017Class 4A OT425 2017
Class 4A OT425 2017
 
Lecture3a symmetric encryption
Lecture3a symmetric encryptionLecture3a symmetric encryption
Lecture3a symmetric encryption
 
Prensentation on packet sniffer and injection tool
Prensentation on packet sniffer and injection toolPrensentation on packet sniffer and injection tool
Prensentation on packet sniffer and injection tool
 
Effect of substituents and functions on drug structure activity relationships
Effect of substituents and functions on drug structure activity relationshipsEffect of substituents and functions on drug structure activity relationships
Effect of substituents and functions on drug structure activity relationships
 
Rotary Newsletter - 30 January 2017
Rotary Newsletter - 30 January 2017Rotary Newsletter - 30 January 2017
Rotary Newsletter - 30 January 2017
 
Tata steel’s acquisition of corus
Tata  steel’s  acquisition  of  corusTata  steel’s  acquisition  of  corus
Tata steel’s acquisition of corus
 
Tata Corus acquisition
Tata Corus acquisitionTata Corus acquisition
Tata Corus acquisition
 
Denial of service attack
Denial of service attackDenial of service attack
Denial of service attack
 
LA VACA ( RESUMEN LIBRO)
LA VACA ( RESUMEN LIBRO)LA VACA ( RESUMEN LIBRO)
LA VACA ( RESUMEN LIBRO)
 
Top U.S. Imports: Apparel
Top U.S. Imports:  Apparel Top U.S. Imports:  Apparel
Top U.S. Imports: Apparel
 
Phishing ppt
Phishing pptPhishing ppt
Phishing ppt
 
Denial of service attack
Denial of service attackDenial of service attack
Denial of service attack
 

Similaire à Sniffing in a Switched Network

Commands used in Assessing Network layout & Security
Commands used in Assessing Network layout & SecurityCommands used in Assessing Network layout & Security
Commands used in Assessing Network layout & SecurityLearningwithRayYT
 
Figure 3 TCP Session Hijacking Attack victims to execute the mali.pdf
Figure 3 TCP Session Hijacking Attack victims to execute the mali.pdfFigure 3 TCP Session Hijacking Attack victims to execute the mali.pdf
Figure 3 TCP Session Hijacking Attack victims to execute the mali.pdforderfabfirki
 
Wireshark Lab IP v6.0Supplement to Computer Networking A Top-D.docx
Wireshark Lab IP v6.0Supplement to Computer Networking A Top-D.docxWireshark Lab IP v6.0Supplement to Computer Networking A Top-D.docx
Wireshark Lab IP v6.0Supplement to Computer Networking A Top-D.docxalanfhall8953
 
Intimacy with MSF - Metasploit Framework
Intimacy with MSF - Metasploit FrameworkIntimacy with MSF - Metasploit Framework
Intimacy with MSF - Metasploit FrameworkAnimesh Roy
 
Traceroute- A Networking Tool
Traceroute- A Networking ToolTraceroute- A Networking Tool
Traceroute- A Networking ToolAmit Kumar
 
Et4045-3-attacks-2
Et4045-3-attacks-2Et4045-3-attacks-2
Et4045-3-attacks-2Tutun Juhana
 
Pt using packettracer
Pt using packettracerPt using packettracer
Pt using packettracerssusera4b34f
 
Packet sniffing in LAN
Packet sniffing in LANPacket sniffing in LAN
Packet sniffing in LANArpit Suthar
 
HS1011 Data Communication and Networks 13 August 2015 HS101.docx
HS1011 Data Communication and Networks  13 August 2015 HS101.docxHS1011 Data Communication and Networks  13 August 2015 HS101.docx
HS1011 Data Communication and Networks 13 August 2015 HS101.docxadampcarr67227
 
Exploiting Network Protocols To Exhaust Bandwidth Links 2008 Final
Exploiting Network Protocols To Exhaust Bandwidth Links 2008 FinalExploiting Network Protocols To Exhaust Bandwidth Links 2008 Final
Exploiting Network Protocols To Exhaust Bandwidth Links 2008 Finalmasoodnt10
 
Telnet configuration
Telnet configurationTelnet configuration
Telnet configurationMdAlAmin187
 
04-post-connection-attacks.pdf
04-post-connection-attacks.pdf04-post-connection-attacks.pdf
04-post-connection-attacks.pdfxasako1838
 
119163798 icnd1-practice-questions-9tut
119163798 icnd1-practice-questions-9tut119163798 icnd1-practice-questions-9tut
119163798 icnd1-practice-questions-9tutnicolelemmimg
 

Similaire à Sniffing in a Switched Network (20)

Layer2&arp
Layer2&arpLayer2&arp
Layer2&arp
 
Arp spoofing
Arp spoofingArp spoofing
Arp spoofing
 
Commands used in Assessing Network layout & Security
Commands used in Assessing Network layout & SecurityCommands used in Assessing Network layout & Security
Commands used in Assessing Network layout & Security
 
Day2
Day2Day2
Day2
 
Packet sniffers
Packet sniffersPacket sniffers
Packet sniffers
 
Figure 3 TCP Session Hijacking Attack victims to execute the mali.pdf
Figure 3 TCP Session Hijacking Attack victims to execute the mali.pdfFigure 3 TCP Session Hijacking Attack victims to execute the mali.pdf
Figure 3 TCP Session Hijacking Attack victims to execute the mali.pdf
 
Wireshark Lab IP v6.0Supplement to Computer Networking A Top-D.docx
Wireshark Lab IP v6.0Supplement to Computer Networking A Top-D.docxWireshark Lab IP v6.0Supplement to Computer Networking A Top-D.docx
Wireshark Lab IP v6.0Supplement to Computer Networking A Top-D.docx
 
Intimacy with MSF - Metasploit Framework
Intimacy with MSF - Metasploit FrameworkIntimacy with MSF - Metasploit Framework
Intimacy with MSF - Metasploit Framework
 
Traceroute- A Networking Tool
Traceroute- A Networking ToolTraceroute- A Networking Tool
Traceroute- A Networking Tool
 
Et4045-3-attacks-2
Et4045-3-attacks-2Et4045-3-attacks-2
Et4045-3-attacks-2
 
Ceh v5 module 07 sniffers
Ceh v5 module 07 sniffersCeh v5 module 07 sniffers
Ceh v5 module 07 sniffers
 
Arpwatch
ArpwatchArpwatch
Arpwatch
 
Pt using packettracer
Pt using packettracerPt using packettracer
Pt using packettracer
 
Packet sniffing in LAN
Packet sniffing in LANPacket sniffing in LAN
Packet sniffing in LAN
 
HS1011 Data Communication and Networks 13 August 2015 HS101.docx
HS1011 Data Communication and Networks  13 August 2015 HS101.docxHS1011 Data Communication and Networks  13 August 2015 HS101.docx
HS1011 Data Communication and Networks 13 August 2015 HS101.docx
 
Exploiting Network Protocols To Exhaust Bandwidth Links 2008 Final
Exploiting Network Protocols To Exhaust Bandwidth Links 2008 FinalExploiting Network Protocols To Exhaust Bandwidth Links 2008 Final
Exploiting Network Protocols To Exhaust Bandwidth Links 2008 Final
 
Linux router
Linux routerLinux router
Linux router
 
Telnet configuration
Telnet configurationTelnet configuration
Telnet configuration
 
04-post-connection-attacks.pdf
04-post-connection-attacks.pdf04-post-connection-attacks.pdf
04-post-connection-attacks.pdf
 
119163798 icnd1-practice-questions-9tut
119163798 icnd1-practice-questions-9tut119163798 icnd1-practice-questions-9tut
119163798 icnd1-practice-questions-9tut
 

Plus de amiable_indian

Phishing As Tragedy of the Commons
Phishing As Tragedy of the CommonsPhishing As Tragedy of the Commons
Phishing As Tragedy of the Commonsamiable_indian
 
Cisco IOS Attack & Defense - The State of the Art
Cisco IOS Attack & Defense - The State of the Art Cisco IOS Attack & Defense - The State of the Art
Cisco IOS Attack & Defense - The State of the Art amiable_indian
 
Secrets of Top Pentesters
Secrets of Top PentestersSecrets of Top Pentesters
Secrets of Top Pentestersamiable_indian
 
Workshop on Wireless Security
Workshop on Wireless SecurityWorkshop on Wireless Security
Workshop on Wireless Securityamiable_indian
 
Insecure Implementation of Security Best Practices: of hashing, CAPTCHA's and...
Insecure Implementation of Security Best Practices: of hashing, CAPTCHA's and...Insecure Implementation of Security Best Practices: of hashing, CAPTCHA's and...
Insecure Implementation of Security Best Practices: of hashing, CAPTCHA's and...amiable_indian
 
Workshop on BackTrack live CD
Workshop on BackTrack live CDWorkshop on BackTrack live CD
Workshop on BackTrack live CDamiable_indian
 
Reverse Engineering for exploit writers
Reverse Engineering for exploit writersReverse Engineering for exploit writers
Reverse Engineering for exploit writersamiable_indian
 
State of Cyber Law in India
State of Cyber Law in IndiaState of Cyber Law in India
State of Cyber Law in Indiaamiable_indian
 
AntiSpam - Understanding the good, the bad and the ugly
AntiSpam - Understanding the good, the bad and the uglyAntiSpam - Understanding the good, the bad and the ugly
AntiSpam - Understanding the good, the bad and the uglyamiable_indian
 
Reverse Engineering v/s Secure Coding
Reverse Engineering v/s Secure CodingReverse Engineering v/s Secure Coding
Reverse Engineering v/s Secure Codingamiable_indian
 
Network Vulnerability Assessments: Lessons Learned
Network Vulnerability Assessments: Lessons LearnedNetwork Vulnerability Assessments: Lessons Learned
Network Vulnerability Assessments: Lessons Learnedamiable_indian
 
Economic offenses through Credit Card Frauds Dissected
Economic offenses through Credit Card Frauds DissectedEconomic offenses through Credit Card Frauds Dissected
Economic offenses through Credit Card Frauds Dissectedamiable_indian
 
Immune IT: Moving from Security to Immunity
Immune IT: Moving from Security to ImmunityImmune IT: Moving from Security to Immunity
Immune IT: Moving from Security to Immunityamiable_indian
 
Reverse Engineering for exploit writers
Reverse Engineering for exploit writersReverse Engineering for exploit writers
Reverse Engineering for exploit writersamiable_indian
 
Hacking Client Side Insecurities
Hacking Client Side InsecuritiesHacking Client Side Insecurities
Hacking Client Side Insecuritiesamiable_indian
 
Web Exploit Finder Presentation
Web Exploit Finder PresentationWeb Exploit Finder Presentation
Web Exploit Finder Presentationamiable_indian
 
Network Security Data Visualization
Network Security Data VisualizationNetwork Security Data Visualization
Network Security Data Visualizationamiable_indian
 
Enhancing Computer Security via End-to-End Communication Visualization
Enhancing Computer Security via End-to-End Communication Visualization Enhancing Computer Security via End-to-End Communication Visualization
Enhancing Computer Security via End-to-End Communication Visualization amiable_indian
 
Top Network Vulnerabilities Over Time
Top Network Vulnerabilities Over TimeTop Network Vulnerabilities Over Time
Top Network Vulnerabilities Over Timeamiable_indian
 
What are the Business Security Metrics?
What are the Business Security Metrics? What are the Business Security Metrics?
What are the Business Security Metrics? amiable_indian
 

Plus de amiable_indian (20)

Phishing As Tragedy of the Commons
Phishing As Tragedy of the CommonsPhishing As Tragedy of the Commons
Phishing As Tragedy of the Commons
 
Cisco IOS Attack & Defense - The State of the Art
Cisco IOS Attack & Defense - The State of the Art Cisco IOS Attack & Defense - The State of the Art
Cisco IOS Attack & Defense - The State of the Art
 
Secrets of Top Pentesters
Secrets of Top PentestersSecrets of Top Pentesters
Secrets of Top Pentesters
 
Workshop on Wireless Security
Workshop on Wireless SecurityWorkshop on Wireless Security
Workshop on Wireless Security
 
Insecure Implementation of Security Best Practices: of hashing, CAPTCHA's and...
Insecure Implementation of Security Best Practices: of hashing, CAPTCHA's and...Insecure Implementation of Security Best Practices: of hashing, CAPTCHA's and...
Insecure Implementation of Security Best Practices: of hashing, CAPTCHA's and...
 
Workshop on BackTrack live CD
Workshop on BackTrack live CDWorkshop on BackTrack live CD
Workshop on BackTrack live CD
 
Reverse Engineering for exploit writers
Reverse Engineering for exploit writersReverse Engineering for exploit writers
Reverse Engineering for exploit writers
 
State of Cyber Law in India
State of Cyber Law in IndiaState of Cyber Law in India
State of Cyber Law in India
 
AntiSpam - Understanding the good, the bad and the ugly
AntiSpam - Understanding the good, the bad and the uglyAntiSpam - Understanding the good, the bad and the ugly
AntiSpam - Understanding the good, the bad and the ugly
 
Reverse Engineering v/s Secure Coding
Reverse Engineering v/s Secure CodingReverse Engineering v/s Secure Coding
Reverse Engineering v/s Secure Coding
 
Network Vulnerability Assessments: Lessons Learned
Network Vulnerability Assessments: Lessons LearnedNetwork Vulnerability Assessments: Lessons Learned
Network Vulnerability Assessments: Lessons Learned
 
Economic offenses through Credit Card Frauds Dissected
Economic offenses through Credit Card Frauds DissectedEconomic offenses through Credit Card Frauds Dissected
Economic offenses through Credit Card Frauds Dissected
 
Immune IT: Moving from Security to Immunity
Immune IT: Moving from Security to ImmunityImmune IT: Moving from Security to Immunity
Immune IT: Moving from Security to Immunity
 
Reverse Engineering for exploit writers
Reverse Engineering for exploit writersReverse Engineering for exploit writers
Reverse Engineering for exploit writers
 
Hacking Client Side Insecurities
Hacking Client Side InsecuritiesHacking Client Side Insecurities
Hacking Client Side Insecurities
 
Web Exploit Finder Presentation
Web Exploit Finder PresentationWeb Exploit Finder Presentation
Web Exploit Finder Presentation
 
Network Security Data Visualization
Network Security Data VisualizationNetwork Security Data Visualization
Network Security Data Visualization
 
Enhancing Computer Security via End-to-End Communication Visualization
Enhancing Computer Security via End-to-End Communication Visualization Enhancing Computer Security via End-to-End Communication Visualization
Enhancing Computer Security via End-to-End Communication Visualization
 
Top Network Vulnerabilities Over Time
Top Network Vulnerabilities Over TimeTop Network Vulnerabilities Over Time
Top Network Vulnerabilities Over Time
 
What are the Business Security Metrics?
What are the Business Security Metrics? What are the Business Security Metrics?
What are the Business Security Metrics?
 

Dernier

A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxAna-Maria Mihalceanu
 
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Mark Simos
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
Kuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorialKuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorialJoão Esperancinha
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...
Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...
Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...itnewsafrica
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructureitnewsafrica
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integrationmarketing932765
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Nikki Chapple
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024TopCSSGallery
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesBernd Ruecker
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Jeffrey Haguewood
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 

Dernier (20)

A Glance At The Java Performance Toolbox
A Glance At The Java Performance ToolboxA Glance At The Java Performance Toolbox
A Glance At The Java Performance Toolbox
 
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
Tampa BSides - The No BS SOC (slides from April 6, 2024 talk)
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
Kuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorialKuma Meshes Part I - The basics - A tutorial
Kuma Meshes Part I - The basics - A tutorial
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...
Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...
Irene Moetsana-Moeng: Stakeholders in Cybersecurity: Collaborative Defence fo...
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
 
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS:  6 Ways to Automate Your Data IntegrationBridging Between CAD & GIS:  6 Ways to Automate Your Data Integration
Bridging Between CAD & GIS: 6 Ways to Automate Your Data Integration
 
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
Microsoft 365 Copilot: How to boost your productivity with AI – Part two: Dat...
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024Top 10 Hubspot Development Companies in 2024
Top 10 Hubspot Development Companies in 2024
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architectures
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
Email Marketing Automation for Bonterra Impact Management (fka Social Solutio...
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 

Sniffing in a Switched Network

  • 1.
  • 2. 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
  • 3. 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.
  • 4. 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.
  • 5. ARP SPOOFING!! How does it work? Target 1 IP: 192.168.1.1 Hw: 00:00:00:00:00:01 Target 2 IP: 192.168.1.100 Hw: 00:00:00:00:00:02 AM (Attacking Machine) IP: 192.168.1.121 Hw: 00:00:00:00:00:03 Switch Switch forwarding traffic based on MAC address Before Attack……..
  • 6. T1(192.168.1.1): T2(192.168.1.100): 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: T1: T2: Where 00:00:00:00:00:03 is the MAC address of attacking machine . 00:00:00:00:00:14 192.168.1.123 00:00:00:00:00:02 192.168.1.100 00:00:00:00:00:14 192.168.1.123 00:00:00:00:00:01 192.168.1.1 00:00:00:00:00:14 192.168.1.123 00:00:00:00:00:03 192.168.1.100 00:00:00:00:00:14 192.168.1.123 00:00:00:00:00:03 192.168.1.1
  • 7. ARP SPOOFING!! How does it work? Target 1 IP: 192.168.1.1 Hw: 00:00:00:00:00:01 Target 2 IP: 192.168.1.100 Hw: 00:00:00:00:00:02 AM (Attacking Machine) IP: 192.168.1.121 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.
  • 8. 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.
  • 9. 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.
  • 10. 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 192.168.1.100. You can use Nmap ’s OS detection feature to guess it. 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 192.168.1.2 and all outgoing traffic goes through the router 192.168.1.1. So, when a network guy from 192.168.101.34 logs into the switch console, packets are routed through the routers 192.168.1.1 and 192.168.1.2.
  • 11. Routers (R) 192.168.1.1 Hw Addr. 00:00:00:00:00:01 Attacked Switch (S) Cisco Catalyst 5000 series 192.168.1.100 Hw. Addr. 00:00:00:00:00:02 Attacking Machine (M) RHEL AS 4.0 192.168.1.121 Hw Addr : 00:00:00:00:00:03 Same subnet Rest of the network Routers (R) 192.168.1.2 Hw Addr. 00:00:00:00:00:04
  • 12. As you can guess, I need to put attacking machine in the path between 192.168.1.1 - 192.168.1.100 to tap outgoing packets and 192.168.1.2 – 192.168.1.100 to tap incoming packets. So, I need to tell the router 192.168.1.2 that 192.168.1.100 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. 192.168.1.100 that 192.168.1.1 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 …
  • 13. To start arp spoofing using ettercap: ettercap -o -T -P repoison_arp -M arp:remote /192.168.1.100/ /192.168.1.1-2/ -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 /192.168.1.100/ /192.168.1.1-2/ Tells it to start MITM attack with 192.168.1.100 in first target group and 192.168.1.1, 192.168.1.2 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 http://ettercap.sourceforge.com . Start spoofing….
  • 14. Start Sniffing … Now you are all set to start sniffing. Use following command to start sniffing and write packets to a file: # tethereal -afilesize:100000 -w /tmp/cisco.pcap -f "host 192.168.1.100 and not arp and not icmp” -afilesize:100000 limits the file size to 100MB. -w /tmp/cisco.pcap writes packets to /tmp/cisco.pcap -f “host 192.168.1.100 and not arp and not icmp ” is the filter string. It tells to collect the packets either coming from or going to 192.168.1.100 and not to collect any arp or icmp packets.
  • 15. 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