Man in the middle attacks



Similar documents
Session Hijacking Exploiting TCP, UDP and HTTP Sessions

Linux Network Security

Packet Sniffing on Layer 2 Switched Local Area Networks

APNIC elearning: Network Security Fundamentals. 20 March :30 pm Brisbane Time (GMT+10)

Network Security Fundamentals

Network Attacks. Common Network Attacks and Exploits

TCP/IP Security Problems. History that still teaches

Attack Lab: Attacks on TCP/IP Protocols

WLAN Attacks. Wireless LAN Attacks and Protection Tools. (Section 3 contd.) Traffic Analysis. Passive Attacks. War Driving. War Driving contd.

CS5008: Internet Computing

Tools for Attacking Layer 2 Network Infrastructure

Course Overview: Learn the essential skills needed to set up, configure, support, and troubleshoot your TCP/IP-based network.

Network Access Security. Lesson 10

Securing end devices

Virtual private network. Network security protocols VPN VPN. Instead of a dedicated data link Packets securely sent over a shared network Internet VPN

Interconnecting Cisco Networking Devices Part 2

Appendix A: Configuring Firewalls for a VPN Server Running Windows Server 2003

Sniffing in a Switched Network

Internet Protocol: IP packet headers. vendredi 18 octobre 13

Implementing Cisco IOS Network Security

Own your LAN with Arp Poison Routing

7 Network Security. 7.1 Introduction 7.2 Improving the Security 7.3 Internet Security Framework. 7.5 Absolute Security?

CYBER ATTACKS EXPLAINED: THE MAN IN THE MIDDLE

Chapter 8 Phase3: Gaining Access Using Network Attacks

BASIC ANALYSIS OF TCP/IP NETWORKS

Securing Cisco Network Devices (SND)

Local Area Networks. LAN Security and local attacks. TDC 363 Winter 2008 John Kristoff - DePaul University 1

7.1. Remote Access Connection

WIRELESS SECURITY. Information Security in Systems & Networks Public Development Program. Sanjay Goel University at Albany, SUNY Fall 2006

: Interconnecting Cisco Networking Devices Part 2 v1.1

This Lecture. The Internet and Sockets. The Start If everyone just sends a small packet of data, they can all use the line at the same.

Firewalls, Tunnels, and Network Intrusion Detection. Firewalls

IP Security. IPSec, PPTP, OpenVPN. Pawel Cieplinski, AkademiaWIFI.pl. MUM Wroclaw

Predictability of Windows DNS resolver. ing. Roberto Larcher robertolarcher@hotmail.com

Introduction on Low level Network tools

Outline. CSc 466/566. Computer Security. 18 : Network Security Introduction. Network Topology. Network Topology. Christian Collberg

A S B

Firewalls, Tunnels, and Network Intrusion Detection


Overview. Securing TCP/IP. Introduction to TCP/IP (cont d) Introduction to TCP/IP

1. LAB SNIFFING LAB ID: 10

IPv6 SECURITY. May The Government of the Hong Kong Special Administrative Region

Post-Class Quiz: Telecommunication & Network Security Domain

NETASQ MIGRATING FROM V8 TO V9

Firewalls. CEN 448 Security and Internet Protocols Chapter 20 Firewalls

Security in IPv6. Basic Security Requirements and Techniques. Confidentiality. Integrity

ACADEMIA LOCAL CISCO UCV-MARACAY CONTENIDO DE CURSO CURRICULUM CCNA. SEGURIDAD SEGURIDAD EN REDES. NIVEL I. VERSION 2.0

APNIC elearning: IPSec Basics. Contact: esec03_v1.0

I. What is VPN? II. Types of VPN connection. There are two types of VPN connection:

Wireless Security: Secure and Public Networks Kory Kirk

21.4 Network Address Translation (NAT) NAT concept

Topics in Network Security

Chapter 4: Security of the architecture, and lower layer security (network security) 1

Overview. Protocols. VPN and Firewalls

This chapter describes how to set up and manage VPN service in Mac OS X Server.

Networks: IP and TCP. Internet Protocol

Symantec Endpoint Protection 11.0 Network Threat Protection (Firewall) Overview and Best Practices White Paper

Security vulnerabilities in the Internet and possible solutions

SY system so that an unauthorized individual can take over an authorized session, or to disrupt service to authorized users.

How To Configure The Fortigate Cluster Protocol In A Cluster Of Three (Fcfc) On A Microsoft Ipo (For A Powerpoint) On An Ipo 2.5 (For An Ipos 2.2.5)

Network Protocol Configuration

SSL Inspection Step-by-Step Guide. June 6, 2016

How To Learn Cisco Cisco Ios And Cisco Vlan

Chapter 6 Configuring the SSL VPN Tunnel Client and Port Forwarding

The Trivial Cisco IP Phones Compromise

Introduction to Network Operating Systems

A Very Incomplete Diagram of Network Attacks

"Charting the Course...

A host-based firewall can be used in addition to a network-based firewall to provide multiple layers of protection.

IINS Implementing Cisco Network Security 3.0 (IINS)

ProCurve Networking. Hardening ProCurve Switches. Technical White Paper

CSCE 465 Computer & Network Security

Course Content: Session 1. Ethics & Hacking

Network Security. Tampere Seminar 23rd October Overview Switch Security Firewalls Conclusion

Security Protocols HTTPS/ DNSSEC TLS. Internet (IPSEC) Network (802.1x) Application (HTTP,DNS) Transport (TCP/UDP) Transport (TCP/UDP) Internet (IP)

Configuring Switch Ports and VLAN Interfaces for the Cisco ASA 5505 Adaptive Security Appliance

Information Security Training. Assignment 1 Networking

Model 2120 Single Port RS-232 Terminal Server Frequently Asked Questions

Exam Questions SY0-401

Chapter 10 Troubleshooting

ICTTEN8195B Evaluate and apply network security

Final exam review, Fall 2005 FSU (CIS-5357) Network Security

Chapter 12 Supporting Network Address Translation (NAT)

20-CS X Network Security Spring, An Introduction To. Network Security. Week 1. January 7

Application Note: Onsight Device VPN Configuration V1.1

Network Security - ISA 656 Application Firewalls

iscsi Security (Insecure SCSI) Presenter: Himanshu Dwivedi

Lecture 17 - Network Security

IP Security. Ola Flygt Växjö University, Sweden

Summary of the SEED Labs For Authors and Publishers

Chapter 8 Security Pt 2

Högskolan i Halmstad Sektionen för Informationsvetenskap, Data- Och Elektroteknik (IDÉ) Ola Lundh. Name (in block letters) :

Cisco Configuring Commonly Used IP ACLs

Introduction to Computer Security

Tim Bovles WILEY. Wiley Publishing, Inc.

Chapter 7. Firewalls

Innominate mguard Version 6

OLD VULNERABILITIES IN NEW PROTOCOLS? HEADACHES ABOUT IPV6 FRAGMENTS

Wireless Local Area Networks (WLANs)

Transcription:

Alberto Ornaghi <alor@antifork.org> Marco Valleri <naga@antifork.org> Man in the middle attacks What they are How to achieve them How to use them How to prevent them Blackhat Conference - Europe 2003 1

Table of contents Different attacks in different scenarios: LOCAL AREA NETWORK: - ARP poisoning - DNS spoofing - Port stealing - STP mangling FROM LOCAL TO REMOTE (through a gateway): - ARP poisoning - DNS spoofing - DHCP spoofing - ICMP redirection - IRDP spoofing - route mangling REMOTE: - DNS poisoning - traffic tunneling - route mangling Blackhat Conference - Europe 2003 2

Once in the middle... Blackhat Conference - Europe 2003 3

Sniffing It is the easiest attack to launch since all the packets transit through the attacker. All the Òplain textó protocols are compromised (the attacker can sniff user and password of many widely used protocol such as telnet, ftp, http) Blackhat Conference - Europe 2003 4

Hijacking Easy to launch It isnõt t blind (the attacker knows exactly the sequence numbers of the TCP connection) Blackhat Conference - Europe 2003 5

Injecting Possibility to add packets to an already established connection (only possible in full-duplex mitm) The attacker can modify the sequence numbers and keep the connection synchronized while injecting packets. If the mitm attack is a Òproxy attackó it is even easier to inject (there are two distinct connections) Blackhat Conference - Europe 2003 6

Filtering The attacker can modify the payload of the packets by recalculating the checksum He/she can create filters on the fly The length of the payload can also be changed but only in full-duplex (in this case the seq has to be adjusted) Blackhat Conference - Europe 2003 7

Attacks examples Blackhat Conference - Europe 2003 8

Attacks examples (1) Command injection Useful in scenarios where a one time authentication is used (e.g. RSA token). In such scenarios sniffing the password is useless, but hijacking an already authenticated session is critical Injection of commands to the server Emulation of fake replies to the client Blackhat Conference - Europe 2003 9

Attacks examples (2) Malicious code injection Insertion of malicious code into web pages or mail (javascript( javascript, trojans,, virus, ecc) Modification on the fly of binary files during the download phase (virus, backdoor, ecc) Blackhat Conference - Europe 2003 10

Attacks examples (3) Key exchanging Modification of the public key exchanged by server and client.. (eg( SSH1) start Server Client KEY(rsa) MITM KEY(rsa) S-KEY E key [S-Key] S-KEY E key [S-Key] S-KEY M E skey (M) D(E(M)) D(E(M)) Blackhat Conference - Europe 2003 11

Attacks examples (4) Parameters and banners substitution Parameters exchanged by server and client can be substituted in the beginning of a connection. (algorithms to be used later) Example: the attacker can force the client to initialize a SSH1 connection instead of SSH2. Ð The server replies in this way: SSH-1.99 -- the server supports ssh1 and ssh2 SSH-1.51 -- the server supports ONLY ssh1 Ð The attacker makes a filter to replace Ò1.99Ó with Ò1.51Ó Possibility to circumvent known_hosts Blackhat Conference - Europe 2003 12

Attacks examples (5) IPSEC Failure Block the keymaterial exchanged on the port 500 UDP End points think that the other cannot start an IPSEC connection If the client is configured in rollback mode, there is a good chance that the user will not notice that the connection is in clear text Blackhat Conference - Europe 2003 13

Attacks examples (6) PPTP (1) - description Uses GRE as transport layer (no encryption, no authentication) Uses the same negotiation scheme as PPP (req, ack, nak, rej) Negotiation phases are not authenticated MS-CHAPv2 mutual authentication canõt prevent this kind of mitm Blackhat Conference - Europe 2003 14

Attacks examples (6) PPTP (2) - attacks During negotiation phase Ð Force PAP authentication (almost fails) Ð Force MS-CHAPv1 from MS-CHAPv2 (easier to crack) Ð Force no encryption Force re-negotiation (clear text terminate-ack ack) Ð Retrieve passwords from existing tunnels Ð Perform previous attacks Force Òpassword changeó to obtain password hashes Ð Hashes can be used directly by a modified SMB or PPTP client Ð MS-CHAPv2 hashes are not usefull (you can force v1) Blackhat Conference - Europe 2003 15

Attacks examples (6) PPTP (3) - attack example Force PAP from CHAP Server req auth chap MITM start Client req auth fake nak auth pap nak auth chap req auth pap req auth pap ack auth pap ack auth pap We donõt have to mess with GRE sequences... Blackhat Conference - Europe 2003 16

Attacks examples (6) PPTP (4) - L2TP rollback L2TP can use IPSec ESP as transport layer (stronger than PPTP) By default L2TP is tried before PPTP Blocking ISAKMP packets results in an IPSec failure Client starts a request for a PPTP tunnel (rollback) Now you can perform PPTP previous attacks Blackhat Conference - Europe 2003 17

Attacks examples (6) PPTP (5) - tools Ettercap Ð Hydra plugins suite Anger (http://ettercap.sf.net) Anger (http:// http://packetstormsecurity.org/sniffers/anger.tar.gz) Blackhat Conference - Europe 2003 18

Attack techniques LOCAL SCENARIO Blackhat Conference - Europe 2003 19

Local Attacks (1) ARP poisoning ARP is stateless (we all knows how it works and what the problems are) Some operating systems do not update an entry if it is not already in the cache, others accept only the first received reply (e.g( solaris) The attacker can forge a spoofed ICMP packets to force the host to make an ARP request. Immediately after the ICMP it sends the fake ARP replay Request attack against linux (IDS evasion) Blackhat Conference - Europe 2003 20

Local Attacks (1) ARP poisoning Useful to sniff on switched LANs The switch works at layer 2 and it is not aware of the poisoning in the hostsõ ARP cache (unless some ARP inspection) Blackhat Conference - Europe 2003 21

Local Attacks (1) ARP poisoning - tools Ettercap (http://ettercap.sf.net) Ð Poisoning Ð Sniffing Ð Hijacking Ð Filtering Ð SSH sniffing (transparent( attack) Ettercap Dsniff (http://www.monkey.org/~dugsong/dsniff) Ð Poisoning Ð Sniffing Ð SSH sniffing (proxy( attack) Dsniff Blackhat Conference - Europe 2003 22

Local Attacks (1) ARP poison - countermeasures YES - passive monitoring (arpwatch) YES - active monitoring (ettercap) YES - IDS (detect but not avoid) YES - Static ARP entries (avoid it) YES - Secure-ARP (public key auth) NO - Port security on the switch NO - anticap,, antidote, middleware approach Blackhat Conference - Europe 2003 23

Local Attacks (2) DNS spoofing If the attacker is able to sniff the ID of the DNS request, he/she can reply before the real DNS server HOST MITM serverx.localdomain.it 10.1.1.1 10.1.1.50 DNS Blackhat Conference - Europe 2003 24

Local Attacks (2) DNS spoofing - tools Ettercap (http://ettercap.sf.net) Ettercap Ð Phantom plugin Dsniff (http://www.monkey.org/~dugsong/dsniff) Dsniff Ð Dnsspoof Zodiac (http://www.packetfactory.com/ http://www.packetfactory.com/projects/zodiac) Blackhat Conference - Europe 2003 25

Local Attacks (2) DNS spoofing - countermeasures YES - detect multiple replies (IDS) YES - use lmhost or host file for static resolution of critical hosts YES - DNSSEC Blackhat Conference - Europe 2003 26

Local Attacks (3) STP mangling It is not a real MITM attack since the attacker is able to receive only ÒunmanagedÓ traffic The attacker can forge BPDU with high priority pretending to be the new root of the spanning tree Blackhat Conference - Europe 2003 27

Local Attacks (3) STP mangling - tools Ettercap (http://ettercap.sf.net) Ð Lamia plugin Blackhat Conference - Europe 2003 28

Local Attacks (3) STP mangling - countermeasures YES - Disable STP on VLAN without loops YES - Root Guard, BPDU Guard. Blackhat Conference - Europe 2003 29

Local Attacks (4) Port stealing The attacker sends many layer 2 packets with: Ð Source address equal to victim hostsõ address Ð Destination address equal to its own mac address The attacker now has ÒstolenÓ victim hostsõ ports When the attacker receives a packet for one of the victims it generates a broadcast ARP request for the victimõs s IP address. When the attacker receives the ARP reply from the victim, the victimõs s port has been restored to the original binding state The attacker can now forward the packet and restart the stealing process Blackhat Conference - Europe 2003 30

Local Attacks (4) Port stealing - tools Ettercap (http://ettercap.sf.net) Ð Confusion plugin Blackhat Conference - Europe 2003 31

Local Attacks (4) Port stealing - countermeasures YES - port security on the switch NO - static ARP Blackhat Conference - Europe 2003 32

Attack techniques FROM LOCAL TO REMOTE Blackhat Conference - Europe 2003 33

Local to remote attacks (1) DHCP spoofing The DHCP request are made in broadcast. If the attacker replies before the real DHCP server it can manipulate: Ð IP address of the victim Ð GW address assigned to the victim Ð DNS address Blackhat Conference - Europe 2003 34

Local to remote attacks (1) DHCP spoofing - countermeasures YES - detection of multiple DHCP replies Blackhat Conference - Europe 2003 35

Local to remote attacks (2) ICMP redirect The attacker can forge ICMP redirect packet in order to Redirect traffic to himself T G1 ICMP redirect to AT AT H LAN Blackhat Conference - Europe 2003 36

Local to remote attacks (2) ICMP redirect - tools IRPAS icmp_redirect (Phenoelit) (http://www.phenoelit.de/ http://www.phenoelit.de/irpas/) icmp_redir (Yuri Volobuev) Blackhat Conference - Europe 2003 37

Local to remote attacks (2) ICMP redirect - countermeasures YES - Disable the ICMP REDIRECT NO - Linux has the Òsecure redirectó options but it seems to be ineffective against this attack Blackhat Conference - Europe 2003 38

Local to remote attacks (3) IRDP spoofing The attacker can forge some advertisement packet pretending to be the router for the LAN. He/she can set the Òpreference leveló and the ÒlifetimeÓ at high values to be sure the hosts will choose it as the preferred router. The attack can be improved by sending some spoofed ICMP Host Unreachable pretending to be the real router Blackhat Conference - Europe 2003 39

Local to remote attacks (3) IRDP spoofing - tools IRPAS by Phenoelit (http://www.phenoelit.de/ http://www.phenoelit.de/irpas/) Blackhat Conference - Europe 2003 40

Local to remote attacks (3) IRDP spoofing - countermeasures YES - Disable IRDP on hosts if the operating system permit it. Blackhat Conference - Europe 2003 41

Local to remote attacks (4) ROUTE mangling INTERNET GW AT H The attacker can forge packets for the gateway (GW) pretending to be a router with a good metric for a specified host on the internet The netmask should be big enough to win against other routes Blackhat Conference - Europe 2003 42

Local to remote attacks (4) ROUTE mangling Now the problem for the attacker is to send packets to the real destination. He/she cannot send it through GW since it is convinced that the best route is AT. Tunnel AT2 D INTERNET GW AT Blackhat Conference - Europe 2003 43 H

Local to remote attacks (4) ROUTE mangling - tools IRPAS (Phenoelit) (http://www.phenoelit.de/ http://www.phenoelit.de/irpas/) Nemesis (http://www.packetfactory.net/projects/ http://www.packetfactory.net/projects/nemesis/) Blackhat Conference - Europe 2003 44

Local to remote attacks (4) ROUTE mangling - countermeasures YES - Disable dynamic routing protocols on this type of scenarios YES - Enable some ACL to block unexpected update YES - Enable authentications on the protocols that support them Blackhat Conference - Europe 2003 45

Attacks techniques REMOTE SCENARIOS Blackhat Conference - Europe 2003 46

Remote attacks (1) DNS poisoning Type 1 attack Ð The attacker sends a request to the victim DNS asking for one host Ð The attacker spoofs the reply which is expected to come from the real DNS Ð The spoofed reply must contain the correct ID (brute force or semi-blind guessing) Blackhat Conference - Europe 2003 47

Remote attacks (1) DNS poisoning Type 2 attack Ð The attacker can send a Òdynamic updateó to the victim DNS Ð If the DNS processes it, it is even worst because it will be authoritative for those entries Blackhat Conference - Europe 2003 48

Remote attacks (1) DNS poisoning - tools ADMIdPack Zodiac (http://www.packetfactory.com/ http://www.packetfactory.com/projects/zodiac) Blackhat Conference - Europe 2003 49

(1) Remote attacks (1) DNS poisoning - countermeasures YES - Use DNS with random transaction ID (Bind v9) YES - DNSSec (Bind v9) allows the digital signature of the replies. NO - restrict the dynamic update to a range of IP (they can be spoofed) Blackhat Conference - Europe 2003 50

(2) Remote attacks (2) Traffic Tunneling Server Router 1 Tunnel GRE INTERNET Client Fake host Attacker Gateway Blackhat Conference - Europe 2003 51

(2) Remote attacks (2) Traffic Tunneling - tools Ettercap (http:// http://ettercap.sf.net) Ettercap Ð Zaratan plugin TunnelX (http://www.phrack.com) Blackhat Conference - Europe 2003 52

(2) Remote attacks (2) Traffic Tunneling - countermeasure YES - Strong passwords and community on routers Blackhat Conference - Europe 2003 53

(3) Remote attacks (3) ROUTE mangling The attacker aims to hijack the traffic between the two victims A and B The attack will collect sensitive information through: Ð traceroute Ð portscanning Ð protoscanning Quite impossible against link state protocols Blackhat Conference - Europe 2003 54

(3) Remote attacks (3) ROUTE mangling Scenario 1 a (IGRP inside the AS) A R1 B R2 The attacker pretends to be the GW Blackhat Conference - Europe 2003 55

(3) Remote attacks (3) ROUTE mangling Scenario 1 b (IGRP inside the AS) A R1 R3 B R2 Blackhat Conference - Europe 2003 56

(3) Remote attacks (3) ROUTE mangling Scenario 2 a (the traffic does not pass thru the AS) AS 1 AS 2 BGP BG 1 BG 2 BG 3 AS 3 RIP Blackhat Conference - Europe 2003 57

(3) Remote attacks (3) ROUTE mangling IRPAS di Phenoelit (http://www.phenoelit.de/ http://www.phenoelit.de/irpas/) Nemesis (http://www.packetfactory.net/projects/nemesis/ http://www.packetfactory.net/projects/nemesis/) Blackhat Conference - Europe 2003 58

(3) Remote attacks (3) ROUTE mangling - countermeasure YES - Use routing protocol authentications Blackhat Conference - Europe 2003 59

Conclusions The security of a connection relies on: Ð a proper configuration of the client (avoiding ICMP Redirect, ARP Poisoning etc.) Ð the other endpoint infrastructure (es( es.. DNS dynamic update), Ð the strongness of a third party appliances on which we donõt have access (es( es. Tunnelling and Route Mangling). The best to protect a communication is the correct and conscious use of criptographic suites Ð both client and server side Ð at the network layer (ie( ie. IPSec) Ð at transport layer (ie( ie.. SSLv3) Ð at application layer (ie( ie.. PGP). Blackhat Conference - Europe 2003 60

Ð Marco Valleri Ð Alberto Ornaghi <naga@antifork.org> <alor@antifork.org> Blackhat Conference - Europe 2003 61