Hacking Pseudo Random Number Generator
Hacking Pseudo Random Number Generator
Introduction
Web applications rely on randomness for security. Pseudo-random number generators (PRNG) No such thing as a random number generator Deterministic seed
Who is Affected?
Joomla Content management, build web sites, applications Patched March 27, 2012 MediaWiki Server-based wiki for data processing, storage and display Patched March 22, 2012 Gallery 2 & 3 Open source web based photo album organizer Patched April 3, 2012 ZenCart Free, user-friendly, open source shopping cart software Patched September 17, 2012
Otherwise, entropy reduction Cases of concatenation This technique is built for Apache Not dependent on this VM
Server
Time: 12:
06:54
Server Time: 12:06:55.000000 Microseconds: 000000
T2
Time: 12:
06:55
1. (T2 - T1)/2 = Length of blue arrow 2. Add this to T1 to find blue dot 3. Off by one-way time to server, so add 1/2 RTT(red arrow) to find calculated time 4. 12:06:55 - calculated time = offset
T1
Time: 12:06:5
T2
Request Mis s
ing File
Server
Local
Reset Victi m Passwo rd
Server
Use ZenCart code to generate reset tokens around estimated seed time Request logins with these estimates until user account compromised
Wrong Password
Try Nearby Token
Welcome User
Local
Reset Pass word
Server
Seeded in this range
Attacker
1st request: reset attacker's password 2nd request: reset target user's password
Webserver
BlackHat Results
Configuration CPU (GHz) 1 x 3.2 4 x 2.3 1 x 0.3 2 x 2.6 RTT (ms) 1.1 8.2 9 135 ATS avg error (us) 410 4135 2724 83573 Request Twins avg error (us) 47 1153 4849 299
Source: George Argyros and Aggelos Kiayias. 2012. I forgot your password: randomness attacks against PHP applications. In Proceedings of the 21st USENIX conference on Security symposium(Security'12). USENIX Association, Berkeley, CA, USA, 66.
The Exercise
Adversarial Time Synchronization (ATS) Groups of 1-3 Worksheet & Files in /ad/eng/courses/ec/ec521/students/
Successful Attack