Check and Fix SSL servers for SSLv3 connections or the Poodle CVE-2014-3566 bug

14-10-2014 | Remy van Elst


Table of Contents


poodle

The POODLE bug is a new bug discovered by Google in the SSLv3 protocol. The fix is easy, disable support for SSLv3. See https://cipherli.st for a good list of SSL ciphers. You can use this check from the shell to check your servers.

This command can easily be automated with other shell scripts. It also allows you to check your services without exposing them to an external checking website.

See the google security blog for more info on the bug: http://googleonlinesecurity.blogspot.nl/2014/10/this-poodle-bites-exploiting-ssl-30.html.

You can use a website like http://poodlebleed.com/ for a web based check.

Fix POODLE

To fix the bug, disable SSLv3 and use a secure cipherlist. I've written a few good tutorials about strong SSL security for different webservers. These tutorials automatically fix POODLE because they disable SSLv3:

Want an easy, very secure copy-pastable config for your webserver? Check out my other project, https://cipherli.st for a good, secure config.

If this article helped you and you want to support me AND get $10 Digital Ocean credit (2 months free), use this link to order: https://www.digitalocean.com/?refcode=7435ae6b8212

TLS-FALLBACK-SCSV

Google have proposed an extension to SSL/TLS named TLSFALLBACKSCSV that seeks to prevent forced SSL downgrades. This is automatically enabled if you upgrade OpenSSL to the following versions:

  • OpenSSL 1.0.1 has TLSFALLBACKSCSV in 1.0.1j and higher.
  • OpenSSL 1.0.0 has TLSFALLBACKSCSV in 1.0.0o and higher.
  • OpenSSL 0.9.8 has TLSFALLBACKSCSV in 0.9.8zc and higher.

Manual check

Use the following command to check an IP or hostname:

echo | timeout 3 openssl s_client -connect HOSTNAMEORIPADDRESS:443 >/dev/null 2>&1; if [[ $? != 0 ]]; then echo "UNKNOWN: HOSTNAMEORIPADDRESS timeout or connection error"; else echo | openssl s_client -connect HOSTNAMEORIPADDRESS:443 -ssl3 2>&1 | grep -qo "sslv3 alert handshake failure\|SSL3_GET_RECORD:wrong version number" && echo "OK: HOSTNAMEORIPADDRESS Not vulnerable" || echo "FAIL:  HOSTNAMEORIPADDRESS vulnerable; sslv3 connection accepted"; fi

Replace HOSTNAMEORIPADDRESS by the actual hostname or IP address. If you use SNI, add the -servername actualhost.org option to the 2 OpenSSL commands, like so:

openssl s_client -servername snihostname.org -connect 172.16.30.5:443 -ssl    

Examples

Non-vulnerable website:

 echo | timeout 3 openssl s_client -connect raymii.org:443 >/dev/null 2>&1; if [[ $? != 0 ]]; then echo "UNKNOWN: raymii.org timeout or connection error"; else echo | openssl s_client -connect raymii.org:443 -ssl3 2>&1 | grep -qo "sslv3 alert handshake failure\|SSL3_GET_RECORD:wrong version number" && echo "OK: raymii.org Not vulnerable" || echo "FAIL:  raymii.org vulnerable; sslv3 connection accepted"; fi

Result:

OK: raymii.org Not vulnerable

Vulnerable site:

echo | timeout 3 openssl s_client -connect sslv3-testhost.com:443 >/dev/null 2>&1; if [[ $? != 0 ]]; then echo "UNKNOWN: sslv3-testhost.com timeout or connection error"; else echo | openssl s_client -connect sslv3-testhost.com:443 -ssl3 2>&1 | grep -qo "sslv3 alert handshake failure\|SSL3_GET_RECORD:wrong version number" && echo "OK: sslv3-testhost.com Not vulnerable" || echo "FAIL:  sslv3-testhost.com vulnerable; sslv3 connection accepted"; fi

Result:

FAIL: sslv3-testhost.com vulnerable; sslv3 connection accepted

Site without SSL:

echo | timeout 3 openssl s_client -connect pepermunt.net:443 >/dev/null 2>&1; if [[ $? != 0 ]]; then echo "UNKNOWN: pepermunt.net timeout or connection error"; else echo | openssl s_client -connect pepermunt.net:443 -ssl3 2>&1 | grep -qo "sslv3 alert handshake failure\|SSL3_GET_RECORD:wrong version number" && echo "OK: pepermunt.net Not vulnerable" || echo "FAIL:  pepermunt.net vulnerable; sslv3 connection accepted"; fi

Result:

UNKNOWN: pepermunt.net timeout or connection error

You can check other ports by changing 443 to any other valid port.


Tags: bash, centos, cve-2014-3566, debian, openssl, poodle, slv3, ssl, ubuntu,