Nmap Development mailing list archives

[NSE] Extended ssl-enum-ciphers script


From: "Bojan Zdrnja (SANS ISC)" <bojan.isc () gmail com>
Date: Sun, 10 Aug 2014 22:19:03 +0200

Hi all,

The ssl-enum-ciphers script is very useful in detecting supported ciphers.
However, it does not retrieve a list of preferred ciphers by the server.
This is important because administrators can often enable desired ciphers
(such as PFS ciphers), but they incorrectly set the preferred cipher suite
order on the server. This can result in non-PFS cipher suites selected,
although both the server and the client support PFS.
This happens because the client sends the list of the supported ciphers and
the server picks "the strongest one" according to its preferred list - so
if there is any other cipher common between the client and the server, and
it has higher priority than the PFS cipher, it will be selected.

SSL Labs' shows this when testing reference browsers, but I wanted to be
able to check this myself, from command line, especially when I'm testing
servers that are not reachable to SSL Labs (or I don't want them
to see the results).

So I modified the Nmap's ssl-enum-ciphers.nse script to list preferred
ciphers in addition to just enumerating ciphers.

The script's output now looks like this (the preferred ciphers order is
new):

Host is up (0.037s latency).
PORT    STATE SERVICE
443/tcp open  https
| ssl-enum-ciphers:
|   SSLv3:
|     ciphers:
|       TLS_RSA_WITH_3DES_EDE_CBC_SHA - strong
|       TLS_RSA_WITH_RC4_128_MD5 - strong
|       TLS_RSA_WITH_RC4_128_SHA - strong
|     preferred ciphers order:
|       TLS_RSA_WITH_RC4_128_SHA
|       TLS_RSA_WITH_3DES_EDE_CBC_SHA
|       TLS_RSA_WITH_RC4_128_MD5
|     compressors:
|       NULL
|   TLSv1.0:
|     ciphers:
|       TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA - strong
|       TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA - strong
|       TLS_RSA_WITH_3DES_EDE_CBC_SHA - strong
|       TLS_RSA_WITH_AES_128_CBC_SHA - strong
|       TLS_RSA_WITH_AES_256_CBC_SHA - strong
|       TLS_RSA_WITH_RC4_128_MD5 - strong
|       TLS_RSA_WITH_RC4_128_SHA - strong
|     preferred ciphers order:
|       TLS_RSA_WITH_AES_128_CBC_SHA
|       TLS_RSA_WITH_AES_256_CBC_SHA
|       TLS_RSA_WITH_RC4_128_SHA
|       TLS_RSA_WITH_3DES_EDE_CBC_SHA
|       TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
|       TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
|       TLS_RSA_WITH_RC4_128_MD5
|     compressors:
|       NULL
|_  least strength: strong


You can see that this particular server (for TLSv1.0) does support PFS
ciphers (the ECDHE ones), but its preferred order results in the client's
probably picking the non-PFS ciphers.

The script is available at https://github.com/bojanisc/nmap-scripts - I
tested it quite a bit and it works OK so I think it might be a good
addition to the set of scripts included with Nmap.

I will also post a SANS ISC (https://isc.sans.edu) diary about this
tomorrow.

Cheers,

Bojan
_______________________________________________
Sent through the dev mailing list
http://nmap.org/mailman/listinfo/dev
Archived at http://seclists.org/nmap-dev/


Current thread: