Tuesday, March 17, 2015

FREAK - (Factoring attack on RSA-EXPORT Keys) a SSL security bug

Protective monitoring signatures

NCC Group’s Cyber Defence Operations team has developed the following alpha Suricata detection signature for FREAK:

alert tcp any any <> any any (msg:"SSL EXPORT Ciphers"; flow:established,to_server; ssl_state:client_hello; content:"|00 14 00 11 00 19 00 08 00 06 00 17 00 03 00 ff|"; sid:1; rev:1;)

However, this is alpha as research, development and testing continues. To determine if a Server accepts Export Ciphers, run the following command:
openssl s_client -connect google.com:443 -cipher 'EXPORT'

The Server will respond with a message like the following if it does not support the Cipher suite:
CONNECTED(00000003)
 
3073972424:error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure:s23_clnt.c:724:
 
---
 
no peer certificate available
 
---
 
No client certificate CA names sent
 
---
 
SSL handshake has read 7 bytes and written 75 bytes
 
---
 
New, (NONE), Cipher is (NONE)
 
Secure Renegotiation IS NOT supported
 
Compression: NONE
 
Expansion: NONE





If the Server does support the Cipher suite, you will get a response similar to this:
CONNECTED(00000003)
 
depth=2 C = US, O = "VeriSign, Inc.", OU = VeriSign Trust Network, OU = "(c) 2006 VeriSign, Inc. - For authorized use only", CN = VeriSign Class 3 Public Primary Certification Authority - G5
 
verify error:num=20:unable to get local issuer certificate
 
verify return:0
 
---
 
…SNIP…
 
---
 
No client certificate CA names sent
 
---
 
SSL handshake has read 4778 bytes and written 193 bytes
 
---
 
New, TLSv1/SSLv3, Cipher is EXP-RC4-MD5
 
Server public key is 2048 bit
 
Secure Renegotiation IS supported
 
Compression: NONE
 
Expansion: NONE
 
SSL-Session:
 
    Protocol  : TLSv1
 
    Cipher    : EXP-RC4-MD5
 
    Session-ID: 1234E36E65F99D0F1234344F3F123493391560B0F123423EECF0835123467959
 
    Session-ID-ctx
 
    Master-Key: 057ED9F44171BC3AC2BAD…
 
 …SNIP…







As you can see, the Server responded using TLSv1 Cipher:

EXP-RC4-MD5 (TLS_RSA_EXPORT_WITH_RC4_40_MD5)

Looking at this request in Wireshark, we see our Client only offers the Export Cipher suites: 
So if we are being MITM’d we would have seen our ‘Client Hello’ request (using the Standard Cipher suite) leave our browser, and the Server would have responded but with the Export Cipher suite.
The Suricata signature we created specifically looks for the Export Cipher suite above. The rule is very tight (in regards to what it is looking for), and will fail if one of the Export Ciphers are not included or in they are in a different order (hence why it is an alpha signature).



No comments:

Post a Comment