Code Monkey home page Code Monkey logo

ssl-tls-ecdsa-timing-attack's Introduction

Timing/Lattice Attack on the ECDSA (binary curves) nonces of OpenSSL

This is a work trying to reproduce and improve on Billy Bob Brumley and Nicola Tuveri - Remote Timing Attacks are Still Practical.

You can reproduce my setup with what you find here. The lattice attack works. The remote timing is not precise enough to make the attack work (we need a huge amount of samples to make the attack work). If you can get the same setup and better timing that what I get below then you should contact me :)

It works on an unpatched version of OpenSSL, but theorically it should work on any TLS framework that has such a timing attack (and not only on binary curves).

But first, if you want to know more about this research check the latest draft of the whitepaper, and here are also direct links to the Timing Attack and the Lattice Attack. And also a demo of the attack.

If you know more about how to collect extremely accurate timing samples on a remote target I might need you. From a small sample of signatures I get mediocre results, the more signatures I get, the better results I get:

these are the results I get from a million signatures:

stats

And from 10 million signatures I get better results. But this takes ~19 hours and still has too many false positives.

stats2

Structure

  • in setup/ you can find how to setup the server and the client to reproduce the attack (and how to modify the server's openSSL to remove the fix)

  • in datasets/ you have data I got from my own experiments. You can play with that if you don't want to setup a client/server. Note that my measurements from the client sucks

  • in tools/ you have tools to play with the data in datasets/. Read the README there for more info.

  • PoC/ is an old proof of concept, it can run and find a key. It's not very pretty though

To Do/Try

  • Time with SO_TIMESTAMPING on raw sockets. Use a NIC that allows for hardware TCP timestamping. Also try to get nanoseconds results. See timestamping.c
  • Look at what Paul McMillan does, basically the same thing but he uses tcpdump and parses the pcap instead. I think it's less clean.
  • Find other ways to optimize the network card (Tuning 10Gb network cards on Linux by Breno Henrique Leitao, IBM).
  • Time UDP packet instead (and target DTLS). This would allow to play with raw sockets (ip packets) directly. Is this a good idea though?
  • Look at Nguyen way's of attacking ECDSA, he seems to build his lattice differently. Maybe we can get better results on the lattice attack
  • Modify the ClientHello from the timing attack to only accept ECDHE-ECDSA... (so that we can test it against different frameworks). Do a openssl s_client -connect website:443 -cipher 'ECDHE-ECDSA' with -msg, -debug or tcpdump the traffic to get the packet.
  • Truncate the hash correctly in the timing attack. I still get the hashes directly from the server because I'm lazy to understand how OpenSSL truncate hashes

ssl-tls-ecdsa-timing-attack's People

Contributors

mimoo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ssl-tls-ecdsa-timing-attack's Issues

Does the all curves have this vulnerability?

I collect the cpu cycle and nonce's length for curve NID_sect283r1, NID_secp256k1 and NID_X9_62_prime256v1. But the result doesn't indicate that the shorter nonce has the less time to computer the signature. Only the curve NID_sect163r2 that used in the paper has the right relationship between time and nonce's length.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.