Man in the middle attacks Demos

Slides:



Advertisements
Similar presentations
IIT Kanpur Hackers Workshop , 24 Feb A current analysis of man in the middle (mitm) attacks Sachin Deodhar.
Advertisements

Blackhats Italia Man in the middle attacks What they are What they are How to achieve them How to achieve them How to use them How to use them How.
Security Lab 2 MAN IN THE MIDDLE ATTACK
Workshop 5: IPSec Security Ricky Mok 4 Apr Preparation Group yourself into groups of 2 people. – You will take turn to be “client” and “server”.
Hands-On Ethical Hacking and Network Defense Lecture 15 Man in the Middle Attack to get Passwords from HTTPS Sessions.
Sniffing, Spoofing, Hijacking This presentation is an amalgam of presentations by Mark Michael, Randy Marchany and Ed Skoudis. I have edited and added.
Man in the Middle Paul Box Beatrice Wilds Will Lefevers.
Sanjay Goel, School of Business/Center for Information Forensics and Assurance University at Albany Proprietary Information 1 Unit Outline Information.
ITIS 6167/8167: Network and Information Security Weichao Wang.
COEN 252: Computer Forensics Router Investigation.
What is in Presentation What is IPsec Why is IPsec Important IPsec Protocols IPsec Architecture How to Implement IPsec in linux.
1 Chapter 6 Network Security Threats. 2 Objectives In this chapter, you will: Learn how to defend against packet sniffers Understand the TCP, UDP, and.
Session Hijacking & ARP Poisoning Why web security depends on communications security and how TLS everywhere is the only solution.
1/28/2010 Network Plus Security Review Identify and Describe Security Risks People –Phishing –Passwords Transmissions –Man in middle –Packet sniffing.
SYSTEM ADMINISTRATION Chapter 13 Security Protocols.
JMU GenCyber Boot Camp Summer, Network Sniffing Sometimes it is possible observe/record traffic traveling on a network Network traffic may contain.
Karlstad University Introduction to Vulnerability Assessment Labs Ge Zhang Dvg-C03.
每时每刻 可信安全 1The two most common implementations of Intrusion Detection are which of the following? A Netware-based and Host-based. B Network-based and Guest-based.
1 IP Forwarding Relates to Lab 3. Covers the principles of end-to-end datagram delivery in IP networks.
1 Chapter 8 Panko, Corporate Computer and Network Security Copyright 2004 Prentice-Hall Cryptographic Systems: SSL/TLS, VPNs, and Kerberos.
ECE Internetwork Security 1 Password Cracking, Sniffing and Man-in-the Middle Agenda  Storing Passwords on the system  Password Cracking on Windows.
Address Resolution Protocol(ARP) By:Protogenius. Overview Introduction When ARP is used? Types of ARP message ARP Message Format Example use of ARP ARP.
1 Chapter 8 Copyright 2003 Prentice-Hall Cryptographic Systems: SSL/TLS, VPNs, and Kerberos.
Module 4: Configuring ISA Server as a Firewall. Overview Using ISA Server as a Firewall Examining Perimeter Networks and Templates Configuring System.
CHAPTER 10 Session Hijacking. INTRODUCTION The act of taking over a connection of some sort, for examples, network connection, a modem connection or other.
Tunneling and Securing TCP Services Nathan Green.
SESSION HIJACKING It is a method of taking over a secure/unsecure Web user session by secretly obtaining the session ID and masquerading as an authorized.
1/22 ARP Problems and Solutions Yasir Jan Future Internet 15 th May 2008.
Introduction to Vulnerability Assessment Labs Ge Zhang Dvg-C03.
1 Lecture A.2: Security Problems in TCP/IP r Reference: Security Problems in the TCP/IP Protocol Suite : by Steve Bellovin r R-services r Source-routing.
TCP Sliding Windows For each TCP connection each hosts keep two Sliding Windows, send sliding window, and receive sliding window to make sure the correct.
Network security Presentation AFZAAL AHMAD ABDUL RAZAQ AHMAD SHAKIR MUHAMMD ADNAN WEB SECURITY, THREADS & SSL.
Security fundamentals
Computer and Network Security
An Introduction To ARP Spoofing & Other Attacks
Introduction to Information Security
IPSec Detailed Description and VPN
Password Cracking, Sniffing and Man-in-the Middle
Chapter 5 Network Security Protocols in Practice Part I
UNIT 7- IP Security 1.IP SEC 2.IP Security Architecture
IPSecurity.
IT443 – Network Security Administration Instructor: Bo Sheng
SECURING NETWORK TRAFFIC WITH IPSEC
IT443 – Network Security Administration Instructor: Bo Sheng
Secure Sockets Layer (SSL)
Configuring and Troubleshooting Routing and Remote Access
LAN Vulnerabilities.
Packet Sniffers Lecture 10 - NETW4006 NETW4006-Lecture09.
Man in the middle attacks
BINF 711 Amr El Mougy Sherif Ismail
Understand Networking Services
Configuring TMG as a Firewall
Chapter 2: Basic Switching Concepts and Configuration
Originally by Yu Yang and Lilly Wang Modified by T. A. Yang
Remote Connectivity and VoIP Hacking
– Chapter 3 – Device Security (B)
Network Security (contd.)
Virtual Private Networks (VPNs)
– Chapter 3 – Device Security (B)
ARP Spoofing.
Introduction to Network Security
Active Man in the Middle Attacks
Advanced Computer Networks
(DNS – Domain Name System)
Unit 32 Every class minute counts! 2 assignments 3 tasks/assignment
Computer Networks ARP and RARP
Virtual Private Network zswu
Transport Layer Security
Lecture 36.
Lecture 36.
Presentation transcript:

Man in the middle attacks Demos Alberto Ornaghi <alor@antifork.org> Marco Valleri <naga@antifork.org> Man in the middle attacks Demos Blackhat Conference - USA 2003

Blackhat Conference - USA 2003 The scenario Server Attacker Client Blackhat Conference - USA 2003

Blackhat Conference - USA 2003 Once in the middle… Injection Key Manipulation Downgrade attack Filtering Blackhat Conference - USA 2003

Blackhat Conference - USA 2003 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 - USA 2003

Injecting 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 - USA 2003

Command Injection DEMO Blackhat Conference - USA 2003

Blackhat Conference - USA 2003 Key Manipulation SSH v1 IPSEC HTTPS Blackhat Conference - USA 2003

Blackhat Conference - USA 2003 Key Manipulation SSH v1 Modification of the public key exchanged by server and client. start Server Client KEY(rsa) KEY(rsa) MITM Ekey[S-Key] Ekey[S-Key] S-KEY S-KEY S-KEY Eskey(M) D(E(M)) M Blackhat Conference - USA 2003

Blackhat Conference - USA 2003 SSH v1 Attack DEMO Blackhat Conference - USA 2003

Key Manipulation IPSEC If two or more clients share the same “secret”, each of them can impersonate the server with another client. Diffie-Hellman exchange 1 – Authenticated by pre-shared secret Diffie-Hellman exchange 2 – Authenticated by pre-shared secret Client MiM Server De-Crypt Packet Re-Crypt Packet Blackhat Conference - USA 2003

Key Manipulation HTTPS We can create a fake certificate (eg: issued by VerySign) relying on browser misconfiguration or user dumbness. Client Real Connection to the server Fake cert. MiM Server Blackhat Conference - USA 2003

Blackhat Conference - USA 2003 HTTPS Attack DEMO Blackhat Conference - USA 2003

Blackhat Conference - USA 2003 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 - USA 2003

Filtering Code Filtering / Injection Insertion of malicious code into web pages or mail (javascript, trojans, virus, ecc) Modification on the fly of binary files during the download phase (virus, backdoor, ecc) Blackhat Conference - USA 2003

Binary Modification DEMO Blackhat Conference - USA 2003

Filtering HTTPS redirection Let’s see an example Change form destination to http://attacker Http main page with https login form Http post (login\password) MiM Server Client login password Auto-submitting hidden form with right authentication data Real https authentication post Authenticated connection Blackhat Conference - USA 2003

HTTPS Redirection Attack DEMO Blackhat Conference - USA 2003

Blackhat Conference - USA 2003 Downgrade Attacks SSH v2 IPSEC PPTP Blackhat Conference - USA 2003

Downgrade Attacks SSH v2  v1 Parameters exchanged by server and client can be substituted in the beginning of a connection. (algorithms to be used later) 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 - USA 2003

Blackhat Conference - USA 2003 SSH v2 Downgrade DEMO Blackhat Conference - USA 2003

Downgrade Attacks 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 - USA 2003

Downgrade Attacks PPTP attack (1) 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) 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 - USA 2003

Downgrade Attacks PPTP attack (2) Force PAP from CHAP start Server Client MITM req | auth | chap 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 - USA 2003

Downgrade Attacks 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 - USA 2003

Blackhat Conference - USA 2003 PPTP Attack DEMO Blackhat Conference - USA 2003

Blackhat Conference - USA 2003 MITM attacks Different attacks in different scenarios: LOCAL AREA NETWORK: - ARP poisoning - DNS spoofing - STP mangling - Port stealing 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 WIRELESS: - Access Point Reassociation Blackhat Conference - USA 2003

MITM attacks 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 Usefull on switched lan (the switch will not notice the attack) Blackhat Conference - USA 2003

MITM attacks ARP poisoning - 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 - USA 2003

ARP Poisoning DEMO (all we have done until now…) Blackhat Conference - USA 2003

ARP Poisoning Antidote Kernel Patch http://www.securityfocus.com/archive/1/299929 “Kernel will send ARP request to test if there is a host at old MAC address. If such response is received it lets us know than one IP pretends to have several MAC addresses at one moment, that probably caused by ARP spoof attack.” We can fake this protection if the ARP entry is not in the cache and the real mac address will be banned Blackhat Conference - USA 2003

Blackhat Conference - USA 2003 Antidote Attack DEMO Blackhat Conference - USA 2003

MITM attack 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 IP address. When the attacker receives the ARP reply from the victim, the victim’s port has been restored to the original binding state The attacker can now forward the packet and restart the stealing process Possibility to circumvent static-mapped arp entries Blackhat Conference - USA 2003

MITM attack Port stealing - countermeasures YES - port security on the switch NO - static ARP Blackhat Conference - USA 2003

Blackhat Conference - USA 2003 Port Stealing DEMO Blackhat Conference - USA 2003

Blackhat Conference - USA 2003 Q & A Alberto Ornaghi <alor@antifork.org> Marco Valleri <naga@antifork.org> Blackhat Conference - USA 2003