Top Banner
30

Man-in-the-Middle Attack on Mobility and E-commerce Oleg Kolesnikov Georgia Institute of Technology.

Dec 17, 2015

Download

Documents

Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Man-in-the-Middle Attack on Mobility and E-commerce Oleg Kolesnikov Georgia Institute of Technology.
Page 2: Man-in-the-Middle Attack on Mobility and E-commerce Oleg Kolesnikov Georgia Institute of Technology.

Man-in-the-Middle Attack on Mobility and E-commerce

Oleg Kolesnikov

Georgia Institute of Technology

Page 3: Man-in-the-Middle Attack on Mobility and E-commerce Oleg Kolesnikov Georgia Institute of Technology.

Summary

Background and LingoMan-in-the-Middle (MITM) ConceptE-commerce and MobilityAttacker’s ToolboxReal-time DemonstrationRecommendations

Page 4: Man-in-the-Middle Attack on Mobility and E-commerce Oleg Kolesnikov Georgia Institute of Technology.

RSA Asymmetry

• Asymmetry:

Public to Private = NP-time Problem

Private to Public = P-time Problem

• Thus, Public Keys can be openly published to be used by Opponents

Page 5: Man-in-the-Middle Attack on Mobility and E-commerce Oleg Kolesnikov Georgia Institute of Technology.

X.509 PKI

• Problem: How to distribute Public Keys ?

• Public Key Infrastructure (PKI):

Managing Public/Private Key pairs (CSRs, CRLs)

Publishing Public Keys as "certificates” in open

directories (e.g. X.500 Directory Services)

Page 6: Man-in-the-Middle Attack on Mobility and E-commerce Oleg Kolesnikov Georgia Institute of Technology.

Secure Connections

• Use Public-Key Algorithm only to Exchange a Shared/Session Key or verify a Digital Signature

• Use Symmetric Key Block Cipher (3DES, DESX, Rijndael) to encrypt data

• Save Public Key or Certificate for use in subsequent sessions

Page 7: Man-in-the-Middle Attack on Mobility and E-commerce Oleg Kolesnikov Georgia Institute of Technology.

Man-in-the-Middle (MITM) Attack Concept

Alice wants to send secure messages to Bob.

Charlie intercepts Alice’s messages.

Charlie talks to Alice and pretends to be Bob.

Charlie talks to Bob and pretends to be Alice.

AliceAlice BobBobCharlieCharlieEa Ec

Ec Eb

E{a,b,c} = Alice’s, Bob’s, and Charlie’s public keys, respectively

Page 8: Man-in-the-Middle Attack on Mobility and E-commerce Oleg Kolesnikov Georgia Institute of Technology.

MITM Attack Concept

• Alice uses the public key she thinks she received from Bob (Charlie’s)

• Bob uses the key he thinks is Alice’s (also Charlie’s)

• As a result, Charlie not only gains access to secure information but also can modify it (e.g. transfer money to a different account etc.)

Page 9: Man-in-the-Middle Attack on Mobility and E-commerce Oleg Kolesnikov Georgia Institute of Technology.

Mobility

• Internet Cafes, Conference Terminals

• Hostile Environment

• SSHv1 vs SSHv2 deployment

• PKCS#12 hassle

Page 10: Man-in-the-Middle Attack on Mobility and E-commerce Oleg Kolesnikov Georgia Institute of Technology.

Mobile Users under Attack: Secure Shell (SSH) v1

• No Certificates; Public Keys are used

• Although SSHv2 is more secure, many clients and servers still use v1, e.g.

telnet ns1.securityportal.com 22

• SSHv1 saves public keys and warns you if a public key has been changed:@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY!

Someone could be eavesdropping on you right now (man-in-the-middle attack)!

It is also possible that the RSA host key has just been changed

Add correct host key in ~/.ssh/known_hosts to get rid of this message.

Are you sure you want to continue connecting (yes/no)? no

Page 11: Man-in-the-Middle Attack on Mobility and E-commerce Oleg Kolesnikov Georgia Institute of Technology.

Mobile Users under Attack: SSH v1 using Kerberos S/KEYs

• S/KEY is a challenge-response one-time password system.

• Does it help to solve MITM problem for SSH ?• It makes MITM Attack harder to execute but

does not eliminate the threat.

• See kdcspoof (Kerberos spoofer).

Page 12: Man-in-the-Middle Attack on Mobility and E-commerce Oleg Kolesnikov Georgia Institute of Technology.

Why E-Commerce

• E-Commerce heavily relies on Public-key-based protocols

• Examples:

- HTTPS (HTTP over SSL/TLS)

- Secure Electronic Transactions (SET)

developed by Visa/MasterCard specifically for

electronic/on-line transactions

Page 13: Man-in-the-Middle Attack on Mobility and E-commerce Oleg Kolesnikov Georgia Institute of Technology.

MITM Attack on E-Commerce

• Trust in HTTPS/SSL/TLS

• Until IPSEC/DNSSEC are widely deployed,

E-Commerce security is questionable

• User aspect

Page 14: Man-in-the-Middle Attack on Mobility and E-commerce Oleg Kolesnikov Georgia Institute of Technology.

Users under Attack: Secure Browsers

• User is typically presented with a menu asking whether to accept new [root] certificate

• Usually, users click on “Yes” and accept new certificate without even thinking about the consequences

• ~ 60 Root Certificates in my IE5.5. Did I verify each one of them thoroughly ?

Page 15: Man-in-the-Middle Attack on Mobility and E-commerce Oleg Kolesnikov Georgia Institute of Technology.

STS

• Public Key distribution is probably the most serious problem for Public Key algorithms

• Diffie, Oorschot, Wiener proposed a way to deal with the problem back in 1992 called Station to Station protocol (STS)

• Ideas from STS are used as a part of Digital Certificates concept

Page 16: Man-in-the-Middle Attack on Mobility and E-commerce Oleg Kolesnikov Georgia Institute of Technology.

MITM and Certificates

• Digital Certificates designed to solve the problem but do they always help ?

• Third party CA signs Alice’s and Bob’s public keys so they exchange signed keys (certificates) instead

• Good so far ?

Page 17: Man-in-the-Middle Attack on Mobility and E-commerce Oleg Kolesnikov Georgia Institute of Technology.

Trusting Certificates

• Problem: Alice and Bob must trust CA

• CA’s information must be delivered to Alice and Bob via Secure Channel

• But how CA’s information usually gets to Alice and Bob ? Via Unprotected Public Network :)

Page 18: Man-in-the-Middle Attack on Mobility and E-commerce Oleg Kolesnikov Georgia Institute of Technology.

Typical Attack Description

This is where attackers come into play, they:

Obtain access to traffic by:

Breaking into a gateway

Spoofing routing tables (RIP/IGP) |

DHCP entries (default gateway)

DNS

ARP caches

Page 19: Man-in-the-Middle Attack on Mobility and E-commerce Oleg Kolesnikov Georgia Institute of Technology.

Typical Attack Description

Intercept traffic at connection establishment phase and generate self-signed PKI certificates to replace originals

Start forwarding data and gain full access to sensitive information

Page 20: Man-in-the-Middle Attack on Mobility and E-commerce Oleg Kolesnikov Georgia Institute of Technology.

MITM Attacker’s Toolbox

• dsniff

• Contains several ready-to-use utilities to do MITM attacks, namely:

sshmitm, webmitm, dnsspoof, and arpspoof.

• Allows attackers to hijack / sniff / analyze HTTPS and SSHv1 traffic

Page 21: Man-in-the-Middle Attack on Mobility and E-commerce Oleg Kolesnikov Georgia Institute of Technology.

MITM Attacker’s Toolbox II

• Libnet: Packet construction and handling

• libpcap: Packet capturing library

• libnids: tcp stream assembly, defragmentation

• sw-mitm: Redirects Layer 2 traffic

Page 22: Man-in-the-Middle Attack on Mobility and E-commerce Oleg Kolesnikov Georgia Institute of Technology.

MITM Attacker’s Toolbox III

• OpenSSL: Open Source implementation of SSLv2/3 and TLSv1

‘openssl’

Command line tool, creates RSA/DH/DSA key parameters, CSRs, CRLs, X.509 Certificates, MDs, Encrypts/Decrypts using various ciphers etc.

Page 23: Man-in-the-Middle Attack on Mobility and E-commerce Oleg Kolesnikov Georgia Institute of Technology.

Notes on Setting up MITM host (dsniff)

• dsniff exec’s openssl directly using system() library call, so openssl must be in $path

• regexes for capturing passwords can be adjusted (see decode_http.c)

• Kernel IP forwarding must be on, e.g.sysctl -w net.inet.ip.forwarding=1(BSD)

Page 24: Man-in-the-Middle Attack on Mobility and E-commerce Oleg Kolesnikov Georgia Institute of Technology.

Demonstration

Page 25: Man-in-the-Middle Attack on Mobility and E-commerce Oleg Kolesnikov Georgia Institute of Technology.

Implications

• Attackers breaking into core routers/servers, adding ‘transparent forwarding’, and then using dsniff to capture and decrypt HTTPS/SSH1 data

• Government installing their machines at large ISPs and using MITM to decrypt HTTPS/SSL, Privacy Enhanced Mail (PEM) and other data.

Page 26: Man-in-the-Middle Attack on Mobility and E-commerce Oleg Kolesnikov Georgia Institute of Technology.

Relevant Work

• Internet Key Exchange Protocol (IKE)

• Hybrid protocol which implements Oakley and Skeme Key Exchange Protocols

• IKE also implements Internet Security Association and Key Management Protocol (ISAKMP) framework

Page 27: Man-in-the-Middle Attack on Mobility and E-commerce Oleg Kolesnikov Georgia Institute of Technology.

Recommendations

• Data Link Layer:– Enable port security on a switch; use static

arp entries• Network Layer:

– DNSSEC and IPSEC to prevent DNS spoofing and sniffing

• Transport Layer:– Verify root CAs and public keys before adding

them; expire your public keys; pay attention to key/certificate change notifications

Page 28: Man-in-the-Middle Attack on Mobility and E-commerce Oleg Kolesnikov Georgia Institute of Technology.

Weakest Link

• User almost always is the weakest link

• Be aware of what those SSHv1 and SSL messages about adding certificates / key change mean before typing ‘y’

• Be careful with your public keys and make sure your party has access to *your* public key

Page 29: Man-in-the-Middle Attack on Mobility and E-commerce Oleg Kolesnikov Georgia Institute of Technology.

Questions ?

Page 30: Man-in-the-Middle Attack on Mobility and E-commerce Oleg Kolesnikov Georgia Institute of Technology.

Thank you !