“Defeating SSL” Impact of Hash collisions on cyber security By vaibhav.

Slides:



Advertisements
Similar presentations
Chapter 14 – Authentication Applications
Advertisements

Authentication Applications. will consider authentication functions will consider authentication functions developed to support application-level authentication.
Cryptography and Network Security Third Edition by William Stallings Lecture slides by Lawrie Brown.
Hash Function. What are hash functions? Just a method of compressing strings – E.g., H : {0,1}*  {0,1} 160 – Input is called “message”, output is “digest”
Internet and Intranet Protocols and Applications Lecture 9a: Secure Sockets Layer (SSL) March, 2004 Arthur Goldberg Computer Science Department New York.
SSLstrip Stepan Shykerynets
Cryptography and Network Security
More Trick For Defeating SSL
Csci5233 Computer Security1 Bishop: Chapter 10 (Cont.) Key Management: Certificates.
Digital Signatures and Hash Functions. Digital Signatures.
Cryptography and Network Security Third Edition by William Stallings Lecture slides by Lawrie Brown.
CSCE 715: Network Systems Security Chin-Tser Huang University of South Carolina.
SSL & SharePoint IT:Network:Applications. Agenda Secure Socket Layer Encryption 101 SharePoint Customization SharePoint Integration.
Chapter 14 From Cryptography and Network Security Fourth Edition written by William Stallings, and Lecture slides by Lawrie Brown, the Australian Defence.
Chapter 4 Authentication Applications. Objectives: authentication functions developed to support application-level authentication & digital signatures.
Mar 19, 2002Mårten Trolin1 This lecture On the assignment Certificates and key management SSL/TLS –Introduction –Phases –Commands.
DESIGNING A PUBLIC KEY INFRASTRUCTURE
Apr 2, 2002Mårten Trolin1 Previous lecture On the assignment Certificates and key management –Obtaining a certificate –Verifying a certificate –Certificate.
Mar 12, 2002Mårten Trolin1 This lecture Diffie-Hellman key agreement Authentication Certificates Certificate Authorities SSL/TLS.
16.1 © 2004 Pearson Education, Inc. Exam Planning, Implementing, and Maintaining a Microsoft® Windows® Server 2003 Active Directory Infrastructure.
CSCI283 Fall 2005 GWU All slides from Bishop’s slide set Public Key Infrastructure (PKI)
Chapter 5 Cryptography Protecting principals communication in systems.
Apr 22, 2003Mårten Trolin1 Agenda Course high-lights – Symmetric and asymmetric cryptography – Digital signatures and MACs – Certificates – Protocols Interactive.
Encryption An Overview. Fundamental problems Internet traffic goes through many networks and routers Many of those networks are broadcast media Sniffing.
EECC694 - Shaaban #1 lec #16 Spring Properties of Secure Network Communication Secrecy: Only the sender and intended receiver should be able.
CERTIFICATES “a document containing a certified statement, especially as to the truth of something ”
Copyright, 1996 © Dale Carnegie & Associates, Inc. Digital Certificates Presented by Sunit Chauhan.
Chapter 8 Web Security.
TLS/SSL Review. Transport Layer Security A 30-second history Secure Sockets Layer was developed by Netscape in 1994 as a protocol which permitted persistent.
Alexander Potapov.  Authentication definition  Protocol architectures  Cryptographic properties  Freshness  Types of attack on protocols  Two-way.
Cryptography 101 Frank Hecker
CSCI 6962: Server-side Design and Programming
By Jyh-haw Yeh Boise State University ICIKM 2013.
Principles of Computer Security: CompTIA Security + ® and Beyond, Third Edition © 2012 Principles of Computer Security: CompTIA Security+ ® and Beyond,
Secure Electronic Transaction (SET)
SSL and https for Secure Web Communication CSCI 5857: Encoding and Encryption.
Digital Certificates Made Easy Sam Lutgring Director of Informational Technology Services Calhoun Intermediate School District.
Cryptography and Network Security Chapter 14 Fifth Edition by William Stallings Lecture slides by Lawrie Brown.
Secure Socket Layer (SSL)
Cryptography and Network Security (CS435) Part Fourteen (Web Security)
Certificate-Based Operations. Module Objectives By the end of this module participants will be able to: Define how cryptography is used to secure information.
Web Security : Secure Socket Layer Secure Electronic Transaction.
CERTIFICATES. What is a Digital Certificate? Electronic counterpart to a drive licenses or a passport. Enable individuals and organizations to secure.
Cryptography and Network Security (CS435) Part Twelve (Electronic Mail Security)
23-1 Last time □ P2P □ Security ♦ Intro ♦ Principles of cryptography.
Network Security7-1 CIS3360: Chapter 8: Cryptography Application of Public Cryptography Cliff Zou Spring 2012 TexPoint fonts used in EMF. Read the TexPoint.
X.509 Topics PGP S/MIME Kerberos. Directory Authentication Framework X.509 is part of the ISO X.500 directory standard. used by S/MIME, SSL, IPSec, and.
Cryptography and Network Security Chapter 14 Fourth Edition by William Stallings Lecture slides by Lawrie Brown.
Security fundamentals Topic 5 Using a Public Key Infrastructure.
Network Security Continued. Digital Signature You want to sign a document. Three conditions. – 1. The receiver can verify the identity of the sender.
Computer and Network Security - Message Digests, Kerberos, PKI –
Hash Functions Ramki Thurimella. 2 What is a hash function? Also known as message digest or fingerprint Compression: A function that maps arbitrarily.
1 SSL/TLS. 2 Web security Security requirements Secrecy to prevent eavesdroppers to learn sensitive information Entity authentication Message authentication.
Slides accompanying 2WC12 Sebastiaan de Hoogh. MD5 Compression function.
1 Certification Issue : how do we confidently know the public key of a given user? Authentication : a process for confirming or refuting a claim of identity.
Cryptographic Hash Function. A hash function H accepts a variable-length block of data as input and produces a fixed-size hash value h = H(M). The principal.
Apr 1, 2003Mårten Trolin1 Previous lecture Certificates and key management Non-interactive protocols –PGP SSL/TLS –Introduction –Phases –Commands.
SSL Certificates for Secure Websites
Cryptography and Network Security
Information Security message M one-way hash fingerprint f = H(M)
Chapter 5: The Art of Ensuring Integrity
Authentication Applications
Information Security message M one-way hash fingerprint f = H(M)
Using SSL – Secure Socket Layer
SSL (Secure Socket Layer)
Information Security message M one-way hash fingerprint f = H(M)
The Secure Sockets Layer (SSL) Protocol
Cryptography and Network Security
Chapter 8 roadmap 8.1 What is network security?
Cryptography Lecture 26.
Presentation transcript:

“Defeating SSL” Impact of Hash collisions on cyber security By vaibhav

Secure Sockets Layer 2

Objective Background Information of SSL, MD5 & “Certificate”\”Public Key” Infrastructure Attack scenario on core assumption of SSL i.e. collision resistance of hash function Attack scenarios on the specification\ implementation of SSL 3

when in doubt, ask 4

5

Cryptographic Hash Serves an essential role within a wide range of security applications. Like (a) digital signature generation and verification (b) session key establishment (c) management of password schemes (d) commitment schemes in cryptographic protocols 6

Hash Functions Compress an arbitrary finite length m-bit input message into a fixed n-bit output value called hash. hash if h = H(m) then, h is called the "hash" of m, m is called a "preimage" of h Data Message Digest 7

Properties of (good)Hash Function ( practicality ) computation of hash can be done efficiently ( preimage resistance ) given h, it is hard to compute a preimage of h ( second preimage resistance ) given m, it is hard to compute a second preimage of m ( collision resistance ) it is hard to compute a collision for H 8

Lets talk about SSL first Ensures secrecy,authenticity, and integrity. Safeguarding communication from both the passive and active adversaries. SSL rely heavily on the x509* certificate structure. For SSL protocols, it is the “common name” field in the subject of an x509 certificate that is used to identify entities presenting certificates. 9

X509 ? Digital certificates ? What ? ITU-T standard for the public key infrastructure. X.509 specifies standard formats for public key certificates Public key certificates are structured according to version3 of X.509 specification. A public key certificate uses a digital signature to bind a public key with an identity. 10

11

Certification Authorities & Hierarchy Browsers ship with a list of trusted CA certificate. o Firefox 3 includes 135 trusted CA certs. CAs’ responsibilities: o verify the identity of the requestor o verify domain ownership for SSL certs o revoke bad certificates 12

Site NameCN Check Expiry Check Signature Signin CA in trust store 13

What if … Root CA Intermediate I CA Intermediate II CA Hack.org Hack.org is a valid certificate issued by intermediate II CA What if hack.org issues a certificate for richest-bank.com ? Richest-bank.com Chain verification algorithm as described before would validate this certificate too. 14

Something must be wrong, but... All the signatures are valid. Nothing has expired. The chain is intact. The root CA is embedded in the browser and trusted. But we just created a valid certificate for Richest- bank, and we're not Richest-bank? 15

X509v3 extensions provide a extension to tackle with this. Basic Constraints: critical CA:FALSE But … Most CAs didn't explicitly set basicConstraints: CA=False Whether the field was there or not, most SSL implementations didn't bother to check it. Hacker moxie marlinspike a tool, sslsniff, to attack this vulnerability. Eventually Microsoft released a patch to address this issue. 16

Obtaining certificates Public Key Domain name User Identity User Public Private Key pair generation CSR generated CSR sent to CA Validates user identity and domain ownership Create and signs certificate User installs private key and certificate on a web server 17

Certificate request format 18

Certificate structure the "to-be-signed" part, consisting of: o serial number o validity period o issuer name o subject o subject public key o "basic constraints" field, containing a bit indicating whether this is a CA certificate or a user certificate a path length field the "signature" part, containing a digital signature, produced by CA`s private key, over the "to-be- signed“ part 19

20

Secure websites and certificates 21

Attack Scenario using Rogue CA certificate 22

23

Revisiting MD5 and MD5 Collision 24

Overview of MD5 Hash function MD5 designed in 1991 Iterative design using compression function. Collision  different messages, same hash 25

MD5 Collisions in : First MD5 collision attack Only difference between messages in random looking 128 collision bytes Currently < 1 second on commodity PC MD5( ) = MD5( ) 26

27

MD5 Collisions in : Stronger collision attack Chosen-Prefix Collisions Messages can differ freely up to the random looking 716 collision bytes Currently approx. 1 day on PS3+PC MD5( ) = MD5( ) 28

29

Generating Colliding Certificates 30

History of colliding certificates Certificates with colliding to-be-signed parts generate a pair of certificates sign the legitimate certificate copy the signature into the rogue cert Previous work Different RSA public keys in 2005 o using 2004 collision attack Different identities in 2006 o using chosen-prefix collisions o the theory is well known since

Colliding certificates in

Rogue CA certificate CA bit 33

Action Items for generating hash colliding certificates Find CA which issues MD5 signed certificate Predict the Validity and Serial Number Construct structure and content rogue Certificate such that real certificate( constructed by CA) and rouge CA cert(Constructed by Hackers) are perfectly aligned. Compute the collision blocks Create RSA key pair such that it includes collision block in it. Construct CSR and send it to CA for signing Detailed view 34

Why RapidSSL? Out of 9000 MD5 certificates collected 97% of those were issued by RapidSSL. RapidSSL issues exactly 6 seconds after “accept” button is clicked and expires in one year. RapidSSL uses sequential serial numbers and on weekend approximately 1000 certificates are issued. 35

Predicting the serial number Get the serial number S on Friday Predict the value for time T on Sunday to be S+1000 Generate the collision bits Shortly before time T buy enough certs to increment the counter to S+999 Send colliding request at time T and get serial number S

Collision generation and RSA keys Based on the 2007 chosen- prefix collisions paper with new improvements 1-2 days on a cluster of 200 PlayStation 3’s Equivalent to 8000 desktop CPU cores or $20,000 on Amazon EC2 takes couple of minutes to calculate RSA key pair such as it contains collision blocks 37

Another Attack on SSL 38

Background As mentioned earlier SSL handshake uses “common name” of certificate and compares with site name. Before year 2000 actual people were involved while dealing with certificate request. Entities are validated based on proof of ownership of the domain listed in the “common name” field. Now a days a simple lookup in WHOIS database for the root domain listed and sending a confirmation mail would complete the verification part. 39

ASN1.0 and Certificates Certificates are formatted using ASN1.0 notation. Supports different type of strings, all represented as PASCAL strings. Represented in memory by the length of the string followed by the string data. NULL character has no special meaning, like C strings Example : 0x05 (length) 0x44 ( D )0x41 (A )0x00 (NULL) 0x54 ( T )0x41 ( A ) 40

Malformed Request One can create a certificate request with common name as CA for verification would do WHOIS issues the certificate with embedded NULL to the owner of hack.com. Spoof and use NULL embedded certificatewww.richest-bank.com 41

Defeating SSL This is how comparison function would be implemented for CN verification. char *destination = getDomainWeAreConnectingTo(); char *commonName = getCommonNameFromCertificate(); Bool everythingIsOk = (strcmp(destination, commonName) == 0); char *commonName char *destination string match

Question ? 43

References 6/gauravaram06collision.pdf 6/gauravaram06collision.pdf 09/Marlinspike/BlackHat-DC-09-Marlinspike- Defeating-SSL.pdf 09/Marlinspike/BlackHat-DC-09-Marlinspike- Defeating-SSL.pdf 44