SSL Sniffing

Some History:

This tool was originally written to demonstrate and exploit IE’s vulnerability to a specific “basicConstraints” man-in-the-middle attack. While Microsoft has since fixed the vulnerability that allowed leaf certificates to act as signing certificates, this tool is still occasionally useful for other purposes.

It is designed to Man-In-The-Middle (MITM) all SSL connections on a LAN and dynamically generates certs for the domains that are being accessed on the fly. The new certificates are constructed in a certificate chain that is signed by any certificate that you provide.

The New Scoop:

Version 0.6 has been significantly updated to additionally support  the null-prefix attacks. These allow for completely silent MITM attacks against SSL/TLS in the NSS, Microsoft CryptoAPI, and GnuTLS stacks — ultimately allowing for SSL communication in Firefox, Internet Explorer, Chrome, Thunderbird, Outlook, Evolution, Pidgin, AIM, irssi, and every other client that uses the Microsoft CryptoAPI to be intercepted.

sslsniff is useful for deploying other vulnerabilities as well. This is the tool that the people who pulled the recent MD5 hash collision publicity stunt used to demonstrate MITM attacks with their rogue CA-certificate. Also, anyone who is capable of obtaining a forged certificate by any means can easily deploy it through sslsniff with the targeted mode designed for null-prefix attacks.

The three steps to get this running are:

Installing sslsniff

  • Install the sslsniff dependencies (openssl, libboost1.35-dev, libboost-filesystem1.35-dev, libboost-thread1.35-dev, liblog4cpp5-dev)
  • Unpack sslsniff-0.7.tar.gz, run ‘./configure’, run ‘make’

sslsniff requires Linux 2.4/2.6, although it can easily be ported to other platforms.

Running sslsniff

  • sslsniff can now be run in the old “authority” mode or the new “targeted” mode. You can specify a single cert to sign new certificates with, or you can specify a directory full of certificates to use for targeted attacks.
  • sslsniff can now also defeat OCSP, fingerprint clients to attack, and hijack auto-updates.
  • See the README for more information on how to run sslsniff

Setting up iptables

  • Flip your machine into ip_forward mode: echo 1 > /proc/sys/net/ipv4/ip_forward
  • Add a rule to intercept SSL traffic: iptables -t nat -A PREROUTING -p tcp –destination-port 443 -j REDIRECT –to-ports <$listenPort>
  • If you wish to fingerprint clients and only intercept some traffic based on client type, add a rule to intercept HTTP traffic: iptables -t nat -A PREROUTING -p tcp –destination-port 80 -j REDIRECT –to-ports <$httpListenPort>

Running arpspoof

Assuming we want to intercept SSL traffic from 172.17.10.36, we need to trick that host into thinking that we’re the router. Using arpspoof, we can convince the target that the router’s MAC address is our MAC address.

  • arpspoof -i eth0 -t 172.17.10.36 172.17.8.1

At this point, any SSL traffic should get proxied by sslsniff and logged to the file you specify.

Development

The current sslsniff development branch can be found on github.

Thanks to thoughtcrime and palisafe

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: