SSLstrip Stepan Shykerynets
! Attention
Private / Public key Public key Private key SERVERCLIENT
Private / Public key Public key Private key SERVERCLIENT Public keyCA
Private / Public key Public key Private key SERVERCLIENT Public key CA
Private / Public key MessagePublic key Encrypted message Private keyMessage
SSL And Certificate Chaining
Certificate X509 Certificate version serial number issuer validity subject public key Signature algorithm Signature
Certificate Chaining CA Certificate Embedded in browser. All powerful. Certifies that a site certificate is authentic. Site Certificate Identifies a particular URL. Is known to be authentic based on CA Certificate's signature
Certificate Chaining CA Certificate Embedded in browser. All powerful. Certifies that a site certificate is authentic. Site Certificate Identifies a particular URL. Is known to be authentic based on CA Certificate's signature. Intermediate CA Not embedded in browser. Still sort of all-powerful. Certifies that a site certificate is authentic
Certificate Chaining VeriSign Facebook.com Intermediate CA
Certificate Chains Can Be > 3 VeriSign Facebook.com Intermediate CA
How do we validate these things? Verify that the leaf node has the name of the site you're connecting to. Verify that the leaf node hasn't expired. Check the signature. If the signing certificate is in our list of root CA's, stop. Otherwise, move one up the chain and repeat
Very tempting to use a simple recursive function. Everyone focuses on the signature validation. The result of a naive attempt at validation is a chain that is complete, but nothing more
What if … VeriSign hack.org Intermediate CA
What if … VeriSign hack.org Intermediate CA Facebook.com
What they say : Verify that the leaf node has the name of the site you're connecting to. Verify that the leaf node hasn't expired. Check the signature. If the signing certificate is in our list of root CA's, stop. Otherwise, move one up the chain and repeat
But … All the signatures are valid Nothing has expired The chain is in fact The root CA is embedded in the browser and trusted
The missing piece
The missing piece !
The missing piece
Most CA's didn't explicitly set basic Constraints: CA=FALSE A lot of web browsers and other SSL implementations didn't bother to check it, whether the field was there or not Any one with a valid leaf node certificate could create and sign a leaf node certificate for any other domain
But we have one problem
Smart browsers
People are …
People are … LAZY
SSLsniff
SSLsniff Intercept a connection from the client side. Generate a certificate for the site it is connecting to. Sign in with any random valid leaf node certificate. Pass that certificate chain to the client. Make normal SSL connection to the server. Pass data between client and server, decrypting and encrypting on each end
Web browsing SSL is almost never encountered directly. It is either encountered as a result of: A 302 redirect from HTTP URL to an HTTPS URL. An HTTPS link that a user click on from an HTTP page
SSLstrip Watch HTTP traffic go by. Switch to and keep a map of what you've changed. Switch Location: to Location: and keep a map of what you've changed
SSLstrip Watch HTTP traffic go by. When we seen an HTTP request for URL that we've stripped, proxy that out as HTTPS to the server. Watch the HTTPS traffic go by, log everything that we want, and keep a map of all relative, CSS and JS links that go by
SSLstrip The server never knows the difference. Everything looks secure on their end. The client doesn't display any of the disastrous warnings that we want to avoid. We see all the traffic
Let's simplify it…
Time to action
BackTrack : Giving Machine Guns to Monkeys since
Tools SSLstrip ARPspoof Ettercap
Commands #bt echo "1" > /proc/sys/net/ipv4/ip_forward # bt iptables -t nat -A PREROUTING -p tcp -- destination-port 80 -j REDIRECT --to-port #bt sslstrip -a -l w log.txt –f # arpspoof -i -t # ettercap -T –q –i
Protection Google services High protection network equipment Checking site certificates
Stepan Shykerynets