security bootcamp 2013 - timing info-leak made easy - quan minh tâm
TRANSCRIPT
![Page 1: Security Bootcamp 2013 - Timing info-leak made easy - Quan Minh Tâm](https://reader034.vdocument.in/reader034/viewer/2022052523/556d11ced8b42ad34f8b51a6/html5/thumbnails/1.jpg)
Timing Info-leak
Made EasyPresenter: Quan Minh Tam
![Page 2: Security Bootcamp 2013 - Timing info-leak made easy - Quan Minh Tâm](https://reader034.vdocument.in/reader034/viewer/2022052523/556d11ced8b42ad34f8b51a6/html5/thumbnails/2.jpg)
Đơn vị tổ chức:
Đơn vị tài trợ:
![Page 3: Security Bootcamp 2013 - Timing info-leak made easy - Quan Minh Tâm](https://reader034.vdocument.in/reader034/viewer/2022052523/556d11ced8b42ad34f8b51a6/html5/thumbnails/3.jpg)
Outline
• Review SSL/TLS weaks
• BEAST is not beast
• CRIME is not crime
– Compression
– CRIME
• TIME is time
– CRIME+
10/22/2013 11:32 PM www.securitybootcamp.vn
![Page 4: Security Bootcamp 2013 - Timing info-leak made easy - Quan Minh Tâm](https://reader034.vdocument.in/reader034/viewer/2022052523/556d11ced8b42ad34f8b51a6/html5/thumbnails/4.jpg)
Cryptanalysis
• Chosen plaintext | ciphertext
• Adaptive chosen plaintext | ciphertext
• Side channel attack
• Bruteforce attack
• Meet-in-the middle
• Linear | differential attack
• Birthday
10/22/2013 11:32 PM www.securitybootcamp.vn
![Page 5: Security Bootcamp 2013 - Timing info-leak made easy - Quan Minh Tâm](https://reader034.vdocument.in/reader034/viewer/2022052523/556d11ced8b42ad34f8b51a6/html5/thumbnails/5.jpg)
Timeline
10/22/2013 11:32 PM www.securitybootcamp.vn
• BEAST - 2011
• CRIME - 2012
• BREACH - 2013
• LUCKY 13 - 2013
• TIME - 2013
• RC4 biases in TLS
![Page 6: Security Bootcamp 2013 - Timing info-leak made easy - Quan Minh Tâm](https://reader034.vdocument.in/reader034/viewer/2022052523/556d11ced8b42ad34f8b51a6/html5/thumbnails/6.jpg)
CRIME
10/22/2013 11:32 PM www.securitybootcamp.vn
![Page 7: Security Bootcamp 2013 - Timing info-leak made easy - Quan Minh Tâm](https://reader034.vdocument.in/reader034/viewer/2022052523/556d11ced8b42ad34f8b51a6/html5/thumbnails/7.jpg)
CRIME
• Compression Ratio Info-leak Made Easy
• Chosen plaintext attack
10/22/2013 11:32 PM www.securitybootcamp.vn
![Page 8: Security Bootcamp 2013 - Timing info-leak made easy - Quan Minh Tâm](https://reader034.vdocument.in/reader034/viewer/2022052523/556d11ced8b42ad34f8b51a6/html5/thumbnails/8.jpg)
CRIME
10/22/2013 11:32 PM www.securitybootcamp.vn
![Page 9: Security Bootcamp 2013 - Timing info-leak made easy - Quan Minh Tâm](https://reader034.vdocument.in/reader034/viewer/2022052523/556d11ced8b42ad34f8b51a6/html5/thumbnails/9.jpg)
COMPRESSION
10/22/2013 11:32 PM www.securitybootcamp.vn
![Page 10: Security Bootcamp 2013 - Timing info-leak made easy - Quan Minh Tâm](https://reader034.vdocument.in/reader034/viewer/2022052523/556d11ced8b42ad34f8b51a6/html5/thumbnails/10.jpg)
COMPRESSION
10/22/2013 11:32 PM www.securitybootcamp.vn
![Page 11: Security Bootcamp 2013 - Timing info-leak made easy - Quan Minh Tâm](https://reader034.vdocument.in/reader034/viewer/2022052523/556d11ced8b42ad34f8b51a6/html5/thumbnails/11.jpg)
COMPRESSION
10/22/2013 11:32 PM www.securitybootcamp.vn
![Page 12: Security Bootcamp 2013 - Timing info-leak made easy - Quan Minh Tâm](https://reader034.vdocument.in/reader034/viewer/2022052523/556d11ced8b42ad34f8b51a6/html5/thumbnails/12.jpg)
COMPRESSION
10/22/2013 11:32 PM www.securitybootcamp.vn
http://www.c-sharpcorner.com/uploadfile/shivprasadk/best-practice-no-4-improve-bandwidth-performance-of-asp-net-sites-using-iis-compression/
![Page 13: Security Bootcamp 2013 - Timing info-leak made easy - Quan Minh Tâm](https://reader034.vdocument.in/reader034/viewer/2022052523/556d11ced8b42ad34f8b51a6/html5/thumbnails/13.jpg)
COMPRESSION
10/22/2013 11:32 PM www.securitybootcamp.vn
• Gzip/Deflate
• HTTP Respone body
• HTTP Request body
• Header compression
– SSL/TLS Compression
• Servers: Open SSL, others
• Clients: Chrome
– SPDY
• Server: Apache mod_spdy
• Client: -IE
![Page 14: Security Bootcamp 2013 - Timing info-leak made easy - Quan Minh Tâm](https://reader034.vdocument.in/reader034/viewer/2022052523/556d11ced8b42ad34f8b51a6/html5/thumbnails/14.jpg)
CRIME demo
10/22/2013 11:32 PM www.securitybootcamp.vn
![Page 15: Security Bootcamp 2013 - Timing info-leak made easy - Quan Minh Tâm](https://reader034.vdocument.in/reader034/viewer/2022052523/556d11ced8b42ad34f8b51a6/html5/thumbnails/15.jpg)
How can you become a victim of CRIME?
• 1st requirement: the
attacker can sniff your
network traffic.
– You share a (W)LAN.
– He's hacked your home
router.
– He's your network
admin, ISP or
government.
10/22/2013 11:32 PM www.securitybootcamp.vn
https://docs.google.com/presentation/d/11eBmGiHbYcHR9gL5nDyZChu_-lCa2GizeuOfaLU2HOU/edit#slide=id.g1d134dff_0_165
![Page 16: Security Bootcamp 2013 - Timing info-leak made easy - Quan Minh Tâm](https://reader034.vdocument.in/reader034/viewer/2022052523/556d11ced8b42ad34f8b51a6/html5/thumbnails/16.jpg)
How can you become a victim of CRIME?
• 2nd requirement:
you visit evil.com.
– You click on a link.
– Or you surf a non-
HTTPS site.
10/22/2013 11:32 PM www.securitybootcamp.vn
https://docs.google.com/presentation/d/11eBmGiHbYcHR9gL5nDyZChu_-lCa2GizeuOfaLU2HOU/edit#slide=id.g1e3070b2_1_21
![Page 17: Security Bootcamp 2013 - Timing info-leak made easy - Quan Minh Tâm](https://reader034.vdocument.in/reader034/viewer/2022052523/556d11ced8b42ad34f8b51a6/html5/thumbnails/17.jpg)
TIME
10/22/2013 11:32 PM www.securitybootcamp.vn
![Page 18: Security Bootcamp 2013 - Timing info-leak made easy - Quan Minh Tâm](https://reader034.vdocument.in/reader034/viewer/2022052523/556d11ced8b42ad34f8b51a6/html5/thumbnails/18.jpg)
Review
• Round-Trip Time (RTT)
• Maximum Transmission Unit (MTU)
• Maximum Segment Size (MSS)
MSS = MTU - sizeof(TCPHDR) - sizeof(IPHDR)
• TCP Sliding Window System
10/22/2013 11:32 PM www.securitybootcamp.vn
![Page 19: Security Bootcamp 2013 - Timing info-leak made easy - Quan Minh Tâm](https://reader034.vdocument.in/reader034/viewer/2022052523/556d11ced8b42ad34f8b51a6/html5/thumbnails/19.jpg)
10/22/2013 11:32 PM www.securitybootcamp.vn
http://ulam2.cs.luc.edu/ebook/html/slidingwindows.html
![Page 20: Security Bootcamp 2013 - Timing info-leak made easy - Quan Minh Tâm](https://reader034.vdocument.in/reader034/viewer/2022052523/556d11ced8b42ad34f8b51a6/html5/thumbnails/20.jpg)
TIME
• Timing Info-leak Made Easy
• Chosen Plaintext Attack
• Targets compression and timing
information leakage
10/22/2013 11:32 PM www.securitybootcamp.vn
![Page 21: Security Bootcamp 2013 - Timing info-leak made easy - Quan Minh Tâm](https://reader034.vdocument.in/reader034/viewer/2022052523/556d11ced8b42ad34f8b51a6/html5/thumbnails/21.jpg)
• HTTP request
– CRIME for request to extract cookie data
• HTTP response
– Extended CRIME to extract response data
– Access a behind authentication resource
for user login status detection
– Application specific: e.g. number of digits in
bank account balance
10/22/2013 11:32 PM www.securitybootcamp.vn
![Page 22: Security Bootcamp 2013 - Timing info-leak made easy - Quan Minh Tâm](https://reader034.vdocument.in/reader034/viewer/2022052523/556d11ced8b42ad34f8b51a6/html5/thumbnails/22.jpg)
HTTP payload
• HTTP Payload size may carry sensitive
information
– HTTP payload size differences detection is
sufficient to extract the sensitive information
• Using timing measurements attacker can
distinguish HTTP payload size differences
• These timing measurements can be done with
javascript on attacker site
10/22/2013 11:32 PM www.securitybootcamp.vn
![Page 23: Security Bootcamp 2013 - Timing info-leak made easy - Quan Minh Tâm](https://reader034.vdocument.in/reader034/viewer/2022052523/556d11ced8b42ad34f8b51a6/html5/thumbnails/23.jpg)
XHR POC
• Create HTTP request with XHR– XHR adheres to SOP
• Allows GET requests to flow
– If headers allow show response
– If not, abort
• We don’t care for the response
– Timing leaks the request size
• Use getTime() on XHR events– onreadystatechange
• Noise elimination– Repeat the process (say 10 times) and obtain Minimal time
10/23/2013 2:41 AM www.securitybootcamp.vn
![Page 24: Security Bootcamp 2013 - Timing info-leak made easy - Quan Minh Tâm](https://reader034.vdocument.in/reader034/viewer/2022052523/556d11ced8b42ad34f8b51a6/html5/thumbnails/24.jpg)
• HTML with Javascript, sending method is XHR
• Sends one byte diff requests alternately 10 times
– The longer request crosses the send window boundary
– The shorter is exactly within
• Measures requests time
• Outputs length and time
• Outputs the minimal timing values for both requests’
length
10/23/2013 2:51 AM www.securitybootcamp.vn
![Page 25: Security Bootcamp 2013 - Timing info-leak made easy - Quan Minh Tâm](https://reader034.vdocument.in/reader034/viewer/2022052523/556d11ced8b42ad34f8b51a6/html5/thumbnails/25.jpg)
XHR
10/22/2013 11:32 PM www.securitybootcamp.vn
![Page 26: Security Bootcamp 2013 - Timing info-leak made easy - Quan Minh Tâm](https://reader034.vdocument.in/reader034/viewer/2022052523/556d11ced8b42ad34f8b51a6/html5/thumbnails/26.jpg)
10/23/2013 2:33 AM www.securitybootcamp.vn
![Page 27: Security Bootcamp 2013 - Timing info-leak made easy - Quan Minh Tâm](https://reader034.vdocument.in/reader034/viewer/2022052523/556d11ced8b42ad34f8b51a6/html5/thumbnails/27.jpg)
10/23/2013 2:35 AM www.securitybootcamp.vn
![Page 28: Security Bootcamp 2013 - Timing info-leak made easy - Quan Minh Tâm](https://reader034.vdocument.in/reader034/viewer/2022052523/556d11ced8b42ad34f8b51a6/html5/thumbnails/28.jpg)
10/22/2013 11:32 PM www.securitybootcamp.vn
![Page 29: Security Bootcamp 2013 - Timing info-leak made easy - Quan Minh Tâm](https://reader034.vdocument.in/reader034/viewer/2022052523/556d11ced8b42ad34f8b51a6/html5/thumbnails/29.jpg)
10/23/2013 2:50 AM www.securitybootcamp.vn
![Page 30: Security Bootcamp 2013 - Timing info-leak made easy - Quan Minh Tâm](https://reader034.vdocument.in/reader034/viewer/2022052523/556d11ced8b42ad34f8b51a6/html5/thumbnails/30.jpg)
Real world
10/23/2013 2:53 AM www.securitybootcamp.vn
1
SCB
![Page 31: Security Bootcamp 2013 - Timing info-leak made easy - Quan Minh Tâm](https://reader034.vdocument.in/reader034/viewer/2022052523/556d11ced8b42ad34f8b51a6/html5/thumbnails/31.jpg)
• Iframe
• Use getTime() on iframe events
– onLoad
– Onreadystatechange(IE)
10/23/2013 3:02 AM www.securitybootcamp.vn
1
![Page 32: Security Bootcamp 2013 - Timing info-leak made easy - Quan Minh Tâm](https://reader034.vdocument.in/reader034/viewer/2022052523/556d11ced8b42ad34f8b51a6/html5/thumbnails/32.jpg)
Real world
10/23/2013 2:57 AM www.securitybootcamp.vn
2
SCB
![Page 33: Security Bootcamp 2013 - Timing info-leak made easy - Quan Minh Tâm](https://reader034.vdocument.in/reader034/viewer/2022052523/556d11ced8b42ad34f8b51a6/html5/thumbnails/33.jpg)
• HTTP request with IMG src
– It is not a image? Don’t worry
– X-Frame-Options? Don’t worry
• Use getTime() on img events
– onLoad
– Onreadystatechange(IE)
10/23/2013 3:07 AM www.securitybootcamp.vn
2
![Page 34: Security Bootcamp 2013 - Timing info-leak made easy - Quan Minh Tâm](https://reader034.vdocument.in/reader034/viewer/2022052523/556d11ced8b42ad34f8b51a6/html5/thumbnails/34.jpg)
New Risk?
10/23/2013 3:09 AM www.securitybootcamp.vn
![Page 35: Security Bootcamp 2013 - Timing info-leak made easy - Quan Minh Tâm](https://reader034.vdocument.in/reader034/viewer/2022052523/556d11ced8b42ad34f8b51a6/html5/thumbnails/35.jpg)
New Risk?
10/23/2013 3:12 AM www.securitybootcamp.vn
• Automation attack
– via URL
– via loadtine
• SOP?
– data leaked out
![Page 36: Security Bootcamp 2013 - Timing info-leak made easy - Quan Minh Tâm](https://reader034.vdocument.in/reader034/viewer/2022052523/556d11ced8b42ad34f8b51a6/html5/thumbnails/36.jpg)
MITIGATIONS
• Adding random timing delays
• X-Frame-Options
• Unknown-parameter
• CAPTCHA, CSRF token
10/22/2013 11:32 PM www.securitybootcamp.vn
![Page 37: Security Bootcamp 2013 - Timing info-leak made easy - Quan Minh Tâm](https://reader034.vdocument.in/reader034/viewer/2022052523/556d11ced8b42ad34f8b51a6/html5/thumbnails/37.jpg)
MITIGATIONS
• Adding random timing delays
10/23/2013 3:15 AM www.securitybootcamp.vn
ineffective
![Page 38: Security Bootcamp 2013 - Timing info-leak made easy - Quan Minh Tâm](https://reader034.vdocument.in/reader034/viewer/2022052523/556d11ced8b42ad34f8b51a6/html5/thumbnails/38.jpg)
MITIGATIONS
• X-Frame-Options
– Browser should support and respect “X-
Frame-Options'' header for all content
inclusion (not just IFRAME);
10/23/2013 3:23 AM www.securitybootcamp.vn
![Page 39: Security Bootcamp 2013 - Timing info-leak made easy - Quan Minh Tâm](https://reader034.vdocument.in/reader034/viewer/2022052523/556d11ced8b42ad34f8b51a6/html5/thumbnails/39.jpg)
MITIGATIONS
• CSRF protection
• Unknow parameter
• Captcha
10/23/2013 3:23 AM www.securitybootcamp.vn
![Page 40: Security Bootcamp 2013 - Timing info-leak made easy - Quan Minh Tâm](https://reader034.vdocument.in/reader034/viewer/2022052523/556d11ced8b42ad34f8b51a6/html5/thumbnails/40.jpg)
That’s all
10/23/2013 3:24 AM www.securitybootcamp.vn