In order to mitigate the "Poodle" vulnerability, I'd like to disable SSLv3 support in my (in this case, TLS, rather than HTTPS) server. How can I use openssl s_client to verify that I've done this?
5 Answers
OpenSSL s_client
To check if you have disabled the SSLv3 support, then run the following
openssl s_client -connect example.com:443 -ssl3 which should produce something like
3073927320:error:14094410:SSL routines:SSL3_READ_BYTES:sslv3 alert handshake failure:s3_pkt.c:1258:SSL alert number 40 3073927320:error:1409E0E5:SSL routines:SSL3_WRITE_BYTES:ssl handshake failure:s3_pkt.c:596: meaning SSLv3 is disabled on the server. Otherwise the connection will established successfully.
Nmap
Alternatively, you can use nmap to scan server for supported version:
# nmap --script ssl-enum-ciphers example.com Starting Nmap 6.47 ( http://nmap.org ) at 2014-10-15 03:19 PDT Nmap scan report for example.com (203.0.113.100) Host is up (0.090s latency). rDNS record for 203.0.113.100: edge.example.com Not shown: 997 filtered ports PORT STATE SERVICE 80/tcp open http 443/tcp open https | ssl-enum-ciphers: | **SSLv3: No supported ciphers found** | TLSv1.0: - The openssl command works; I can't get the nmap script to work, though.Roger Lipscombe– Roger Lipscombe2014-10-15 10:55:33 +00:00Commented Oct 15, 2014 at 10:55
- 7Ah. Non-default port. Use
--script +ssl-enum-ciphers, per stackoverflow.com/a/17175548/8446.Roger Lipscombe– Roger Lipscombe2014-10-15 11:11:21 +00:00Commented Oct 15, 2014 at 11:11 - What is the output of your nmap command ?ifexploit– ifexploit2014-10-15 11:37:45 +00:00Commented Oct 15, 2014 at 11:37
- gist.github.com/rlipscombe/eb941f08f24016fe5cd0Roger Lipscombe– Roger Lipscombe2014-10-15 12:02:55 +00:00Commented Oct 15, 2014 at 12:02
- 1It's working fine; I solved it. I'm using a non-standard port, so I have to prefix the script name with '+' to force it to run.Roger Lipscombe– Roger Lipscombe2014-10-19 14:24:11 +00:00Commented Oct 19, 2014 at 14:24
On a side note you can use nmap with ssl-enum-ciphers script as follows
nmap --script ssl-enum-ciphers -p 443 example.com You will get a response like this.
PORT STATE SERVICE 443/tcp open https | ssl-enum-ciphers: | SSLv3: | ciphers: | TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA - strong | TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA - strong | TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA - strong | TLS_RSA_WITH_RC4_128_MD5 - strong | TLS_RSA_WITH_RC4_128_SHA - strong | compressors: | NULL | TLSv1.0: | ciphers: | TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA - strong | TLS_RSA_WITH_RC4_128_MD5 - strong | TLS_RSA_WITH_RC4_128_SHA - strong | compressors: | NULL | TLSv1.1: | ciphers: | TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA - strong | TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA - strong | compressors: | NULL | TLSv1.2: | ciphers: | TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA - strong | TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA - strong | TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 - strong | compressors: | NULL |_ least strength: strong As you can see it lists all the supported versions of ssl/tls as well as the cipher suites
- Simply the fastest way to get a list of available ciphers on a remote endpoint. nmap rules, as usual! ;)stamster– stamster2020-06-16 20:44:07 +00:00Commented Jun 16, 2020 at 20:44
If just SSLv3 is disabled, you can also force openssl s_client to use only TLS:
openssl s_client -connect exmaple.com:443 -tls1 - 3For TLS 1.0 and above, you should use the
-servernameoption too. In enlists SNI.user29925– user299252015-06-05 03:48:53 +00:00Commented Jun 5, 2015 at 3:48 - 9This does not verify that ssl3 is disable, it just tells to use TLS 1Matteo– Matteo2016-03-09 13:49:11 +00:00Commented Mar 9, 2016 at 13:49
I created this test for the availability of the SSLv3 protocol. There is probably a better way to search for a string that also shows that CBC ciphers are in use, but most people just seem to want to know if SSLv3 is available at all.
A few things to note:
- Written for the bash on Mac OS X so can't say for sure it will work everywhere
- Uses gtimeout vs. timeout since Mac is weird about those core utils
- allexternal.txt is a file with one hostname or IP per line
script:
for ip in `awk '{print $1}' < allexternal.txt`; do if gtimeout 30 openssl s_client -connect $ip:443 -ssl3 | grep -q 'Protocol : SSLv3' ; then echo $ip SSLv3 detected >> sslv3output; else echo $ip SSLv3 NOT detected >> sslv3output; fi; done - Apologies for the formatting, wasn't sure how to have grave accents show up as literal instead of making it into a code block.theterribletrivium– theterribletrivium2014-10-15 22:44:23 +00:00Commented Oct 15, 2014 at 22:44
- 2Thanks for sharing, but can I suggest you use echo 'QUIT' so you don't have to install gtimeout. The second line should read... if echo 'QUIT' | openssl s_client -connect $ip:443 -ssl3 | grep -q 'Protocol : SSLv3' ; thenAlex Lauerman– Alex Lauerman2014-11-11 02:44:15 +00:00Commented Nov 11, 2014 at 2:44
- Using "Protocol : SSLv3" also seems to be dubious. Per this page: security.stackexchange.com/a/71459/51963, "Cipher : 0000" may be a better string to search for.thesquaregroot– thesquaregroot2016-07-13 16:40:20 +00:00Commented Jul 13, 2016 at 16:40
It's worth noting that the -ssl3 option in OpenSSL now has to be enabled at compile time. If you're running on pre-compiled binaries then the option may not be available. See this issue: https://github.com/openssl/openssl/issues/6801
An alternative tool is testssl.sh. This checks for protocols, ciphers and selected vulnerabilities: https://github.com/drwetter/testssl.sh