Low-Level TLS Hacking



Similar documents
Web Security Considerations

Security Engineering Part III Network Security. Security Protocols (I): SSL/TLS

Practical Invalid Curve Attacks on TLS-ECDH

CSC Network Security

CSC 474 Information Systems Security

Network Security Web Security and SSL/TLS. Angelos Keromytis Columbia University

Revisiting SSL/TLS Implementations: New Bleichenbacher Side Channels and Attacks

Communication Systems SSL

Communication Systems 16 th lecture. Chair of Communication Systems Department of Applied Sciences University of Freiburg 2009

Information Security

Secure Socket Layer (SSL) and Trnasport Layer Security (TLS)

Announcement. Final exam: Wed, June 9, 9:30-11:18 Scope: materials after RSA (but you need to know RSA) Open books, open notes. Calculators allowed.

Secure Socket Layer (SSL) and Transport Layer Security (TLS)

Software Engineering 4C03 Research Project. An Overview of Secure Transmission on the World Wide Web. Sean MacDonald

TLS/SSL in distributed systems. Eugen Babinciuc

Lecture 7: Transport Level Security SSL/TLS. Course Admin

Real-Time Communication Security: SSL/TLS. Guevara Noubir CSU610

Outline. Transport Layer Security (TLS) Security Protocols (bmevihim132)

SECURE SOCKETS LAYER (SSL)

Secure Socket Layer/ Transport Layer Security (SSL/TLS)

Overview of CSS SSL. SSL Cryptography Overview CHAPTER

Lecture 31 SSL. SSL: Secure Socket Layer. History SSL SSL. Security April 13, 2005

Lab 7. Answer. Figure 1

How To Understand And Understand The Ssl Protocol ( And Its Security Features (Protocol)

Authenticity of Public Keys

Protocol Rollback and Network Security

The Secure Sockets Layer (SSL)

Secure Socket Layer. Security Threat Classifications

Communication Security for Applications

3.2: Transport Layer: SSL/TLS Secure Socket Layer (SSL) Transport Layer Security (TLS) Protocol

Managing and Securing Computer Networks. Guy Leduc. Chapter 4: Securing TCP. connections. connections. Chapter goals: security in practice:

CS 356 Lecture 27 Internet Security Protocols. Spring 2013

SSL: Secure Socket Layer

Secure Sockets Layer

Crypto at Scale. Brian Sniffen

Overview. SSL Cryptography Overview CHAPTER 1

SSL Report: ebfl.srpskabanka.rs ( )

The Beautiful Features of SSL And Why You Want to Use Them?

SSL implementieren aber sicher!

MatrixSSL Developer s Guide

Programming with cryptography

Three attacks in SSL protocol and their solutions

Lab Exercise SSL/TLS. Objective. Step 1: Open a Trace. Step 2: Inspect the Trace

Einführung in SSL mit Wireshark

Transport Layer Security Protocols

INF3510 Information Security University of Oslo Spring Lecture 9 Communication Security. Audun Jøsang

Secure Sockets Layer (SSL ) / Transport Layer Security (TLS) Network Security Products S31213

Overview SSL/TLS HTTPS SSH. TLS Protocol Architecture TLS Handshake Protocol TLS Record Protocol. SSH Protocol Architecture SSH Transport Protocol

Secure Sockets Layer (SSL) / Transport Layer Security (TLS)

Revisiting SSL/TLS Implementations: New Bleichenbacher Side Channels and Attacks

TLS-RSA-PSK. Channel Binding using Transport Layer Security with Pre Shared Keys

SSL Secure Socket Layer

Binding Security Tokens to TLS Channels. A. Langley, Google Inc. D. Balfanz, Google Inc. A. Popov, Microsoft Corp.

Cryptography and Network Security Sicurezza delle reti e dei sistemi informatici SSL/TSL

Chapter 17. Transport-Level Security

Learning Network Security with SSL The OpenSSL Way

Chapter 7 Transport-Level Security

Implementation Vulnerabilities in SSL/TLS

Secure Socket Layer. Carlo U. Nicola, SGI FHNW With extracts from publications of : William Stallings.

SSL Secure Socket Layer

Security Protocols and Infrastructures. h_da, Winter Term 2011/2012

Name-based SSL virtual hosts: how to tackle the problem

ISA 562 Information System Security

Network Fundamentals Carnegie Mellon University

Network Security Essentials Chapter 5

Lab Exercise SSL/TLS. Objective. Requirements. Step 1: Capture a Trace

Web Security. Mahalingam Ramkumar

SECURE SOCKETS LAYER (SSL) SECURE SOCKETS LAYER (SSL) SSL ARCHITECTURE SSL/TLS DIFFERENCES SSL ARCHITECTURE. INFS 766 Internet Security Protocols

HTTPS: Transport-Layer Security (TLS), aka Secure Sockets Layer (SSL)

Secure Socket Layer (TLS) Carlo U. Nicola, SGI FHNW With extracts from publications of : William Stallings.

SBClient SSL. Ehab AbuShmais

Certificates and network security

Lecture 4: Transport Layer Security (secure Socket Layer)

Network Security Part II: Standards

GNUTLS. a Transport Layer Security Library This is a Draft document Applies to GnuTLS by Nikos Mavroyanopoulos

Enhancing Web Application Security

2014 IBM Corporation

SSL Interception Proxies. Jeff Jarmoc Sr. Security Researcher Dell SecureWorks. and Transitive Trust

SSL/TLS. What Layer? History. SSL vs. IPsec. SSL Architecture. SSL Architecture. IT443 Network Security Administration Instructor: Bo Sheng

Transport Layer Security (TLS)

Secure Managed File Transfer with Connect:Direct

SSL BEST PRACTICES OVERVIEW

Cryptography and Network Security IPSEC

MatrixSSL Developer's Guide Version 3.7

Smart Card support Embedded Within OpenSSL to Secure Virtual Machines

How the Great Firewall discovers hidden circumvention servers. Roya Ensafi David Fifield Philipp Winter Nick Weaver Nick Feamster Vern Paxson

Secure network protocols: how SSL/TLS, SSH, SFTP and FTPS work

Computer and Network Security

Security Protocols/Standards

Cleaning Encrypted Traffic

Cisco SSL Encryption Utility

ms-help://ms.technet.2005mar.1033/winnetsv/tnoffline/prodtechnol/winnetsv/plan/ssl...

Web Security: Encryption & Authentication

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

Vulnerabilità dei protocolli SSL/TLS

Virtual Private Networks

Maximizing Performance with SPDY & SSL. Billy Hoffman

Transcription:

Low-Level TLS Hacking Presented by Richard J. Moore E: rich@westpoint.ltd.uk

Presentation Outline An introduction to SSL/TLS Using pytls to create and decode TLS messages Fingerprinting TLS servers Fingerprinting the wider TLS landscape

Brief intro to SSL/TLS TLS is a layered protocol Lowest layer is the record layer The same record format is used in SSL3, TLS 1.0 1.2 Binary protocol Symmetrical the same record format is used in both directions

TLS Record Structure Content Type Version Length Message MAC (optional) Padding (optional)

Content Types Handshake message ChangeCipherSpec Error reporting Application Activates the crypto Alert Messages used to setup the crypto parameters The actual data Heartbeat Probably the most famous

TLS handshake messages The initial messages of a TLS session use the handshake protocol The ClientHello and ServerHello are the ones you ve probably heard of Certificate messages containing the server certificate Handshake messages provide all the information needed to establish a secure connection

ClientHello Preferred TLS version of the client Ciphersuites the client supports Client random data Extensions the client supports Server Name Indication Secure Renegotiation Many more Also other information such as the session id if we re reusing a session

ServerHello Selected TLS version Selected ciphersuite Server random data Similar to ClientHello but the server has decided on the cipher and version Extensions the server supports Empty extensions indicating support Extensions containing data (e.g. for EC cipher suites)

Saying hello ClientHello ServerHello Certificate ServerHelloDone ClientKeyExchange ChangeCipherSpec Finished ChangeCipherSpec Finished

TLS is not easy on the eye

Heartbleed with pytls

pytls A python library for creating TLS messages Easily create TLS records, handshake messages etc. Easily decode messages from the binary format Lets us deal with TLS as objects, no need to worry about the actual format Low-level tool Create valid and invalid messages Send messages in the wrong order

Creating handshake messages

Creating records with pytls Just create the object, it's that simple Supplying the length is optional Default is to use the correct length Can override to generate invalid records The message field is the actual content Records are normally populated with messages created by pytls, but it is happy to put anything you want in the record

Write new tests quickly

DH prime check in minutes

Low-level facilities Most cipher testing scripts try to connect with each cipher What if the connection fails for another reason? Does the server need a client certificate we don't have? The cipher has already been sent in the ServerHello

Also useful for testing clients

What else can we do? Writing tests for vulnerabilities is useful, but more is possible Now have a toolbox for working with TLS as a bunch of building blocks Decided to build a server fingerprinting tool

Basics of TLS probing There are a number of commonly used TLS stacks Openssl (and variants such as BoringSSL, LibreSSL) Microsoft SChannel Java Secure Socket Extension GnuTLS Less common ones too PolarSSL, MatrixSSL, wolfssl...

Lots of small differences The TLS specification is often unclear and implementations aren't perfect Specification allows a single record to contains multiple handshake messages Variations in which Alert messages are sent Some implementations just close the connection on error Implementations vary on what they consider invalid too

Example of a Probe TLS records can contain more than one handshake message OpenSSL never does this, but Microsoft and Java do Server Hello Server Hello Certificate Certificate Server Hello Done Server Hello Done Microsoft Schannel or Java SSE OpenSSL

TLS Prober TLS prober sends the probes and records the response Only records fields that don't change Microsoft IIS Fingerprint OpenSSL Fingerprint

Probing Can fingerprint a server by sending several different probes and recording the responses Probes include Variations in the TLS version numbers Invalid state transitions such as early CCS Invalid lengths Sending complete garbage in a valid record Various valid and invalid Server Name Indication extensions Probe the implementation not the configuration

Strengths and Weaknesses Can distinguish every implementation I have found Can even distinguish between specific versions when the fingerprint database is big enough Not affected by common configuration changes such as the cipher configuration Room for improvement though Take steps to address differences in the enabled TLS versions More fingerprints (please submit them!)

Probe all the things! Alexa provide a list of the top million websites University of Michigan provide data on which support TLS etc. at https://scans.io/ We can run the TLS prober over all these! Probing is trivially parallelisable 50 concurrent probes fingerprinted all 686,176 of the top million with port 443 open in 2.5 days Generated around 2GB of fingerprint data...

Headline Figures 686,176 targets, 668,809 valid results 17,367 failed to fingerprint (e.g. the port was now closed) 16,051,416 probes recorded Only 10,384 distinct fingerprints Most common fingerprint matches ~18% of the results

OpenSSL is king 60% of the probes produced a result matching OpenSSL The IIS signatures only matched 6% of the probes Results are biased by a number of factors Most high traffic sites use content delivery networks Most hardware TLS accelerators use a stack based on OpenSSL The fact remains though, that in practice we have a monoculture for TLS

What have we covered? The basics of the TLS protocol format Using pytls to create and decode TLS Using pytls to make readable and customisable vulerability tests Probing TLS implementations to determine the implementation and version Using parallel probing to look at the landscape of deployments in practice

Getting the code All the code is available on github pytls tls_prober https://github.com/westpointltd/pytls https://github.com/westpointltd/tls_prober The parallelised version and the alexa top million data will soon be released too Only 20MB when compressed

Questions? Presented by Richard J. Moore E: rich@westpoint.ltd.uk