SlideShare una empresa de Scribd logo
1 de 16
Exploitation notes on CVE-2014-0160
© 2014 MDSec Consulting Ltd. All rights reserved.
Exploitation notes on CVE-2014-0160
Heartbleed <3
- The vulnerability is announced to the world 7th April 2014 by a
website, OpenSSL Security Advisory and OpenSSL 1.0.1g release.
- Discovered by Riku, Antti & Matti and Neel Mehta.
- I searched the page for a web cart.
- Shortly the next day ….
- Jared Stafford released “ssltest.py”
- Security community scrambled to fix.
© 2014 MDSec Consulting Ltd. All rights reserved.
Exploitation notes on CVE-2014-0160
RFC-6520 Heartbeat Extension
Bug introduced to the world NYE
2011 during implementation of
RFC-6520 in OpenSSL 1.0.1
Enabled by default in OpenSSL
1.0.1
Fixed in OpenSSL 1.0.1g & OpenSSL
1.0.2-beta1 still vulnerable – (git
has fix.)
If you run beta code on production
servers…
© 2014 MDSec Consulting Ltd. All rights reserved.
Exploitation notes on CVE-2014-0160
Vulnerability
© 2014 MDSec Consulting Ltd. All rights reserved.
Exploitation notes on CVE-2014-0160
How does it work?
© 2014 MDSec Consulting Ltd. All rights reserved.
Exploitation notes on CVE-2014-0160
How does it work?
© 2014 MDSec Consulting Ltd. All rights reserved.
Exploitation notes on CVE-2014-0160
Let the games commence.
Sites ranging from the FBI, Russian Standard Bank, Yahoo!, OpenSSL, Belgian
Intelligence Service and many more shown as leaking data.
- Screen shots of “ssltest.py” dumping 16384 bytes of heap memory began to
appear on social media sites. The content’s of the memory were alarming.
- IDS/IPS and Security vendors began to release detection signatures & scanners.
- Media frenzy ensued spreading confusing information e.g. #HeartbleedVirus
- The vulnerability was still not fully realized. Misconceptions abound.
© 2014 MDSec Consulting Ltd. All rights reserved.
Exploitation notes on CVE-2014-0160
On The Wire
• This is an unencrypted heartbleed attack transmitted on the wire.
• The response is returned in unencrypted packets.
© 2014 MDSec Consulting Ltd. All rights reserved.
Exploitation notes on CVE-2014-0160
Attack SSL, Encrypt with SSL!
• I wrote a stand-alone exploit in C using OpenSSL library to transmit the
Heartbeat request in encrypted packet.
• This was intentionally to bypass IPS/IDS signatures – it worked!
• Encrypting attacks on OpenSSL with OpenSSL makes it difficult to detect….
• IDS/IPS vendors began to develop alternative detection signatures.
© 2014 MDSec Consulting Ltd. All rights reserved.
Exploitation notes on CVE-2014-0160
On The Wire
• This is an encrypted heartbleed attack transmitted on the wire.
• The response is returned in encrypted packets.
© 2014 MDSec Consulting Ltd. All rights reserved.
Exploitation notes on CVE-2014-0160
Exploit Fails & Lessons
• I continued to push updates during the exploit
development process.
• I learnt not to commit code changes late at
night without review and testing… No, I am
not *THAT* OpenSSL developer!
• Internet is awesome, people began to submit
compile instructions for different Linux
platforms. Builds on most Linux/OS-X.
• Ayman Sagy added needed DTLS support.
• Re-use the code! Patches are welcome!
© 2014 MDSec Consulting Ltd. All rights reserved.
Exploitation notes on CVE-2014-0160
RSA Private Key Recovery
• Cloudflare announce secret key challenge for heartbleed.
• Provide nginx-1.5.13 web server linked against OpenSSL 1.0.1.f on Ubuntu
13.10 x86_64.
• Fedor Indutny solved the challenge first, others quickly followed.
• “include/openssl/rsa.h:struct rsa_st” holds RSA variables (p & q) in memory.
• RSA n := pq. We can use n to calculate if prime in memory is valid.
• Search for key size primes in memory leak and use to determine remaining
prime from modulo n (q % n == 0) – with p & q we generate RSA private key.
© 2014 MDSec Consulting Ltd. All rights reserved.
Exploitation notes on CVE-2014-0160
RSA Private Key Recovery
• Obtain certificate “openssl s_client -connect 192.168.11.23:443 < http-
get.txt | grep BEGIN –A n > out.pem”
• Improved “keyscan.py” by Einar Otto Stangvik to produce valid RSA private
keys instead of counting primes.
• Run “keyscan.py” on a memory dump to test possible values against the
certificate modulus n to identify if modulo is 0. The value and its division
result by n are checked and if primes we have p & q.
• We then generate the RSA private key from the prime values.
• Metasploit module also supports dumping private keys.
© 2014 MDSec Consulting Ltd. All rights reserved.
Exploitation notes on CVE-2014-0160
Heartbleed.c
• Exploit works against vulnerable OpenSSL servers and clients.
• Leaks upto 65535 bytes of heap data and 16 bytes of random padding.
• Can re-use connection.
• STARTTLS support.
• Multiple SSL protocols.
• Multiple ciphers.
• Saves leak to file.
© 2014 MDSec Consulting Ltd. All rights reserved.
Exploitation notes on CVE-2014-0160
Demo
Demo.
© 2014 MDSec Consulting Ltd. All rights reserved.
Exploitation notes on CVE-2014-0160
Conclusions
• CVE-2014-0160 will exist in appliances & infrastructure for some time.
• Affected servers and devices should be considered compromised.
• Your IDS/IPS cannot always save you.
• Enable Perfect Forward Secrecy.
• Enable Two-Factor Authentication (e.g. X.509).
E-mail: matthew@mdsec.co.uk
Twitter: @HackerFantastic
https://github.com/hackerfantastic/public

Más contenido relacionado

La actualidad más candente

Web Application Frewall
Web Application FrewallWeb Application Frewall
Web Application Frewall
Abhishek Singh
 
[OPD 2019] Top 10 Security Facts of 2020
[OPD 2019] Top 10 Security Facts of 2020[OPD 2019] Top 10 Security Facts of 2020
[OPD 2019] Top 10 Security Facts of 2020
OWASP
 
Hacking Tizen : The OS of Everything - Nullcon Goa 2015
Hacking Tizen : The OS of Everything - Nullcon Goa 2015Hacking Tizen : The OS of Everything - Nullcon Goa 2015
Hacking Tizen : The OS of Everything - Nullcon Goa 2015
Ajin Abraham
 
[OPD 2019] Governance as a missing part of IT security architecture
[OPD 2019] Governance as a missing part of IT security architecture[OPD 2019] Governance as a missing part of IT security architecture
[OPD 2019] Governance as a missing part of IT security architecture
OWASP
 

La actualidad más candente (20)

ios device protection review
ios device protection reviewios device protection review
ios device protection review
 
Beginners guide on how to start exploring IoT 2nd session
Beginners  guide on how to start exploring IoT 2nd sessionBeginners  guide on how to start exploring IoT 2nd session
Beginners guide on how to start exploring IoT 2nd session
 
Web Application Frewall
Web Application FrewallWeb Application Frewall
Web Application Frewall
 
Hacking IoT with EXPLIoT Framework
Hacking IoT with EXPLIoT FrameworkHacking IoT with EXPLIoT Framework
Hacking IoT with EXPLIoT Framework
 
CCNP Security-Firewall
CCNP Security-FirewallCCNP Security-Firewall
CCNP Security-Firewall
 
[OPD 2019] Top 10 Security Facts of 2020
[OPD 2019] Top 10 Security Facts of 2020[OPD 2019] Top 10 Security Facts of 2020
[OPD 2019] Top 10 Security Facts of 2020
 
Android security and penetration testing | DIVA | Yogesh Ojha
Android security and penetration testing | DIVA | Yogesh OjhaAndroid security and penetration testing | DIVA | Yogesh Ojha
Android security and penetration testing | DIVA | Yogesh Ojha
 
Hacking Tizen : The OS of Everything - Nullcon Goa 2015
Hacking Tizen : The OS of Everything - Nullcon Goa 2015Hacking Tizen : The OS of Everything - Nullcon Goa 2015
Hacking Tizen : The OS of Everything - Nullcon Goa 2015
 
[Wroclaw #9] The purge - dealing with secrets in Opera Software
[Wroclaw #9] The purge - dealing with secrets in Opera Software[Wroclaw #9] The purge - dealing with secrets in Opera Software
[Wroclaw #9] The purge - dealing with secrets in Opera Software
 
Orbleaf: Integrated Smart Card Development Platform
Orbleaf: Integrated Smart Card Development PlatformOrbleaf: Integrated Smart Card Development Platform
Orbleaf: Integrated Smart Card Development Platform
 
Too soft[ware defined] networks SD-Wan vulnerability assessment
Too soft[ware defined] networks SD-Wan vulnerability assessmentToo soft[ware defined] networks SD-Wan vulnerability assessment
Too soft[ware defined] networks SD-Wan vulnerability assessment
 
Security in the Age of Open Source
Security in the Age of Open SourceSecurity in the Age of Open Source
Security in the Age of Open Source
 
Writing ICS Vulnerability Analysis
Writing ICS Vulnerability AnalysisWriting ICS Vulnerability Analysis
Writing ICS Vulnerability Analysis
 
[OPD 2019] Governance as a missing part of IT security architecture
[OPD 2019] Governance as a missing part of IT security architecture[OPD 2019] Governance as a missing part of IT security architecture
[OPD 2019] Governance as a missing part of IT security architecture
 
Eclipse Plugin for ESP-IDF - EclipseCon Europe 2019
Eclipse Plugin for ESP-IDF -  EclipseCon Europe 2019Eclipse Plugin for ESP-IDF -  EclipseCon Europe 2019
Eclipse Plugin for ESP-IDF - EclipseCon Europe 2019
 
Safe and Secure Applications: Deploying in a Cloud or Multi-Cloud Environment
Safe and Secure Applications: Deploying in a Cloud or Multi-Cloud EnvironmentSafe and Secure Applications: Deploying in a Cloud or Multi-Cloud Environment
Safe and Secure Applications: Deploying in a Cloud or Multi-Cloud Environment
 
Java application security the hard way - a workshop for the serious developer
Java application security the hard way - a workshop for the serious developerJava application security the hard way - a workshop for the serious developer
Java application security the hard way - a workshop for the serious developer
 
Apache web-server-security
Apache web-server-securityApache web-server-security
Apache web-server-security
 
How to Contribute to Ansible
How to Contribute to AnsibleHow to Contribute to Ansible
How to Contribute to Ansible
 
WAFEC
WAFECWAFEC
WAFEC
 

Similar a 44cafe heart bleed

OISC 2019 - The OWASP Top 10 & AppSec Primer
OISC 2019 - The OWASP Top 10 & AppSec PrimerOISC 2019 - The OWASP Top 10 & AppSec Primer
OISC 2019 - The OWASP Top 10 & AppSec Primer
ThreatReel Podcast
 
AppSec & OWASP Top 10 Primer
AppSec & OWASP Top 10 PrimerAppSec & OWASP Top 10 Primer
AppSec & OWASP Top 10 Primer
ThreatReel Podcast
 
Short Introduction of Implicit Converion (ScalaMatsuri2014 LT)
Short Introduction of Implicit Converion (ScalaMatsuri2014 LT)Short Introduction of Implicit Converion (ScalaMatsuri2014 LT)
Short Introduction of Implicit Converion (ScalaMatsuri2014 LT)
Atsushi Oku
 

Similar a 44cafe heart bleed (20)

[CLASS 2014] Palestra Técnica - Jonathan Knudsen
[CLASS 2014] Palestra Técnica - Jonathan Knudsen[CLASS 2014] Palestra Técnica - Jonathan Knudsen
[CLASS 2014] Palestra Técnica - Jonathan Knudsen
 
LibreSSL, one year later
LibreSSL, one year laterLibreSSL, one year later
LibreSSL, one year later
 
Securing your Rails application
Securing your Rails applicationSecuring your Rails application
Securing your Rails application
 
OSDC 2014: Christopher Kunz - Software defined networking in an open-source c...
OSDC 2014: Christopher Kunz - Software defined networking in an open-source c...OSDC 2014: Christopher Kunz - Software defined networking in an open-source c...
OSDC 2014: Christopher Kunz - Software defined networking in an open-source c...
 
Why you are not secure: Apache, OpenSSL, and PHP (Intermediate Talk)
Why you are not secure: Apache, OpenSSL, and PHP  (Intermediate Talk)Why you are not secure: Apache, OpenSSL, and PHP  (Intermediate Talk)
Why you are not secure: Apache, OpenSSL, and PHP (Intermediate Talk)
 
OISC 2019 - The OWASP Top 10 & AppSec Primer
OISC 2019 - The OWASP Top 10 & AppSec PrimerOISC 2019 - The OWASP Top 10 & AppSec Primer
OISC 2019 - The OWASP Top 10 & AppSec Primer
 
Heartbleed
HeartbleedHeartbleed
Heartbleed
 
AppSec & OWASP Top 10 Primer
AppSec & OWASP Top 10 PrimerAppSec & OWASP Top 10 Primer
AppSec & OWASP Top 10 Primer
 
Help Doctor, my application is an onion!
Help Doctor, my application is an onion!Help Doctor, my application is an onion!
Help Doctor, my application is an onion!
 
WebGoat.SDWAN.Net in Depth
WebGoat.SDWAN.Net in DepthWebGoat.SDWAN.Net in Depth
WebGoat.SDWAN.Net in Depth
 
WebGoat.SDWAN.Net in Depth: SD-WAN Security Assessment
WebGoat.SDWAN.Net in Depth: SD-WAN Security Assessment WebGoat.SDWAN.Net in Depth: SD-WAN Security Assessment
WebGoat.SDWAN.Net in Depth: SD-WAN Security Assessment
 
SSL Checklist for Pentesters (BSides MCR 2014)
SSL Checklist for Pentesters (BSides MCR 2014)SSL Checklist for Pentesters (BSides MCR 2014)
SSL Checklist for Pentesters (BSides MCR 2014)
 
Bleeding Servers – How Hackers are Exploiting Known Vulnerabilities
Bleeding Servers – How Hackers are Exploiting Known VulnerabilitiesBleeding Servers – How Hackers are Exploiting Known Vulnerabilities
Bleeding Servers – How Hackers are Exploiting Known Vulnerabilities
 
Short Introduction of Implicit Conversion by TIS, Inc.
Short Introduction of Implicit Conversion by TIS, Inc.Short Introduction of Implicit Conversion by TIS, Inc.
Short Introduction of Implicit Conversion by TIS, Inc.
 
Short Introduction of Implicit Converion (ScalaMatsuri2014 LT)
Short Introduction of Implicit Converion (ScalaMatsuri2014 LT)Short Introduction of Implicit Converion (ScalaMatsuri2014 LT)
Short Introduction of Implicit Converion (ScalaMatsuri2014 LT)
 
LibreSSL
LibreSSLLibreSSL
LibreSSL
 
OpenStack in the Enterprise - Are You Ready? - Maish Saidel-Keesing
OpenStack in the Enterprise - Are You Ready? - Maish Saidel-KeesingOpenStack in the Enterprise - Are You Ready? - Maish Saidel-Keesing
OpenStack in the Enterprise - Are You Ready? - Maish Saidel-Keesing
 
FreeBSD and Hardening Web Server
FreeBSD and Hardening Web ServerFreeBSD and Hardening Web Server
FreeBSD and Hardening Web Server
 
wolfSSL Year In Review, 2013
wolfSSL Year In Review, 2013wolfSSL Year In Review, 2013
wolfSSL Year In Review, 2013
 
How to exploit heartbleed vulnerability demonstration
How to exploit heartbleed vulnerability demonstrationHow to exploit heartbleed vulnerability demonstration
How to exploit heartbleed vulnerability demonstration
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Último (20)

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 

44cafe heart bleed

  • 1. Exploitation notes on CVE-2014-0160
  • 2. © 2014 MDSec Consulting Ltd. All rights reserved. Exploitation notes on CVE-2014-0160 Heartbleed <3 - The vulnerability is announced to the world 7th April 2014 by a website, OpenSSL Security Advisory and OpenSSL 1.0.1g release. - Discovered by Riku, Antti & Matti and Neel Mehta. - I searched the page for a web cart. - Shortly the next day …. - Jared Stafford released “ssltest.py” - Security community scrambled to fix.
  • 3. © 2014 MDSec Consulting Ltd. All rights reserved. Exploitation notes on CVE-2014-0160 RFC-6520 Heartbeat Extension Bug introduced to the world NYE 2011 during implementation of RFC-6520 in OpenSSL 1.0.1 Enabled by default in OpenSSL 1.0.1 Fixed in OpenSSL 1.0.1g & OpenSSL 1.0.2-beta1 still vulnerable – (git has fix.) If you run beta code on production servers…
  • 4. © 2014 MDSec Consulting Ltd. All rights reserved. Exploitation notes on CVE-2014-0160 Vulnerability
  • 5. © 2014 MDSec Consulting Ltd. All rights reserved. Exploitation notes on CVE-2014-0160 How does it work?
  • 6. © 2014 MDSec Consulting Ltd. All rights reserved. Exploitation notes on CVE-2014-0160 How does it work?
  • 7. © 2014 MDSec Consulting Ltd. All rights reserved. Exploitation notes on CVE-2014-0160 Let the games commence. Sites ranging from the FBI, Russian Standard Bank, Yahoo!, OpenSSL, Belgian Intelligence Service and many more shown as leaking data. - Screen shots of “ssltest.py” dumping 16384 bytes of heap memory began to appear on social media sites. The content’s of the memory were alarming. - IDS/IPS and Security vendors began to release detection signatures & scanners. - Media frenzy ensued spreading confusing information e.g. #HeartbleedVirus - The vulnerability was still not fully realized. Misconceptions abound.
  • 8. © 2014 MDSec Consulting Ltd. All rights reserved. Exploitation notes on CVE-2014-0160 On The Wire • This is an unencrypted heartbleed attack transmitted on the wire. • The response is returned in unencrypted packets.
  • 9. © 2014 MDSec Consulting Ltd. All rights reserved. Exploitation notes on CVE-2014-0160 Attack SSL, Encrypt with SSL! • I wrote a stand-alone exploit in C using OpenSSL library to transmit the Heartbeat request in encrypted packet. • This was intentionally to bypass IPS/IDS signatures – it worked! • Encrypting attacks on OpenSSL with OpenSSL makes it difficult to detect…. • IDS/IPS vendors began to develop alternative detection signatures.
  • 10. © 2014 MDSec Consulting Ltd. All rights reserved. Exploitation notes on CVE-2014-0160 On The Wire • This is an encrypted heartbleed attack transmitted on the wire. • The response is returned in encrypted packets.
  • 11. © 2014 MDSec Consulting Ltd. All rights reserved. Exploitation notes on CVE-2014-0160 Exploit Fails & Lessons • I continued to push updates during the exploit development process. • I learnt not to commit code changes late at night without review and testing… No, I am not *THAT* OpenSSL developer! • Internet is awesome, people began to submit compile instructions for different Linux platforms. Builds on most Linux/OS-X. • Ayman Sagy added needed DTLS support. • Re-use the code! Patches are welcome!
  • 12. © 2014 MDSec Consulting Ltd. All rights reserved. Exploitation notes on CVE-2014-0160 RSA Private Key Recovery • Cloudflare announce secret key challenge for heartbleed. • Provide nginx-1.5.13 web server linked against OpenSSL 1.0.1.f on Ubuntu 13.10 x86_64. • Fedor Indutny solved the challenge first, others quickly followed. • “include/openssl/rsa.h:struct rsa_st” holds RSA variables (p & q) in memory. • RSA n := pq. We can use n to calculate if prime in memory is valid. • Search for key size primes in memory leak and use to determine remaining prime from modulo n (q % n == 0) – with p & q we generate RSA private key.
  • 13. © 2014 MDSec Consulting Ltd. All rights reserved. Exploitation notes on CVE-2014-0160 RSA Private Key Recovery • Obtain certificate “openssl s_client -connect 192.168.11.23:443 < http- get.txt | grep BEGIN –A n > out.pem” • Improved “keyscan.py” by Einar Otto Stangvik to produce valid RSA private keys instead of counting primes. • Run “keyscan.py” on a memory dump to test possible values against the certificate modulus n to identify if modulo is 0. The value and its division result by n are checked and if primes we have p & q. • We then generate the RSA private key from the prime values. • Metasploit module also supports dumping private keys.
  • 14. © 2014 MDSec Consulting Ltd. All rights reserved. Exploitation notes on CVE-2014-0160 Heartbleed.c • Exploit works against vulnerable OpenSSL servers and clients. • Leaks upto 65535 bytes of heap data and 16 bytes of random padding. • Can re-use connection. • STARTTLS support. • Multiple SSL protocols. • Multiple ciphers. • Saves leak to file.
  • 15. © 2014 MDSec Consulting Ltd. All rights reserved. Exploitation notes on CVE-2014-0160 Demo Demo.
  • 16. © 2014 MDSec Consulting Ltd. All rights reserved. Exploitation notes on CVE-2014-0160 Conclusions • CVE-2014-0160 will exist in appliances & infrastructure for some time. • Affected servers and devices should be considered compromised. • Your IDS/IPS cannot always save you. • Enable Perfect Forward Secrecy. • Enable Two-Factor Authentication (e.g. X.509). E-mail: matthew@mdsec.co.uk Twitter: @HackerFantastic https://github.com/hackerfantastic/public