andresriancho / pico

Tool to identify and exploit timing attacks
GNU General Public License v3.0
10 stars 6 forks source link

Exploitation Algorithm #28

Open andresriancho opened 8 years ago

andresriancho commented 8 years ago

The timing attack algorithm should be able to discover a valid, hard-coded, API key with zero knowledge.

Some ideas:

$ ./pico ...
...
Was able to find a timing difference using 4 bytes.
Will continue the timing attack using 4-byte blocks.
andresriancho commented 8 years ago

Introduction

The main equation that drives this attack is as follows: c := is the character set of the target string n := is the total length of the target string

Brute Force: c^n trials (usually infeasible to perform. Sometimes you need the earth time to break the system)

Timing Attack in a perfect environment: c * n (usually infeasible also due to noise)

Realistic Timing attack: c^t * n/t * l where t << n and c^t can be generated in reasonable time l is the number of trials needed to reduce the error of noise and distinguish between valid and invalid trial

By carefully selecting the t, a timing attack can be performed. t should be big enough to make statistical difference over the variance in network delay and small enough to execute the attack in reasonable time. Statistical approaches such as the null and alternative hypotheses are some of the means to analyze the timing attack results.

Source

https://appsecusa2015.sched.org/event/3VgT/practical-timing-attacks-using-mathematical-amplification-of-time-difference-in-operator

andresriancho commented 8 years ago

In this video they do talk about similar things: first attack with a known API key, analyze which statistical analysis model fits best, then try to guess new ones.

andresriancho commented 8 years ago

Number of samples

If in doubt just take more samples

The number of samples should also be part of the exploitation algorithm. More samples are going to increase precision.

What I would do is to start with a sample count of 1000 and see if I can discover the known differences in that scenario. If I'm unable to do so, then try with 5k, 10k, 25k.

Make the max number of samples 150k (by default) and let the user change it.