How do I list the SSL/TLS cipher suites a particular website offers?

How can I retrieve a list of the SSL/TLS cipher suites a particular website offers?

I've tried openssl, but if you examine the output:

$ echo -n | openssl s_client -connect
CONNECTED(00000003)
depth=1 /C=ZA/O=Thawte Consulting (Pty) Ltd./CN=Thawte SGC CA
verify error:num=20:unable to get local issuer certificate
verify return:0
---
Certificate chain 0 s:/C=US/ST=California/L=Mountain View/O=Google Inc/CN= i:/C=ZA/O=Thawte Consulting (Pty) Ltd./CN=Thawte SGC CA 1 s:/C=ZA/O=Thawte Consulting (Pty) Ltd./CN=Thawte SGC CA i:/C=US/O=VeriSign, Inc./OU=Class 3 Public Primary Certification Authority
---
Server certificate
-----BEGIN CERTIFICATE-----
MIIDITCCAoqgAwIBAgIQL9+89q6RUm0PmqPfQDQ+mjANBgkqhkiG9w0BAQUFADBM
MQswCQYDVQQGEwJaQTElMCMGA1UEChMcVGhhd3RlIENvbnN1bHRpbmcgKFB0eSkg
THRkLjEWMBQGA1UEAxMNVGhhd3RlIFNHQyBDQTAeFw0wOTEyMTgwMDAwMDBaFw0x
MTEyMTgyMzU5NTlaMGgxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlh
MRYwFAYDVQQHFA1Nb3VudGFpbiBWaWV3MRMwEQYDVQQKFApHb29nbGUgSW5jMRcw
FQYDVQQDFA53d3cuZ29vZ2xlLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkC
gYEA6PmGD5D6htffvXImttdEAoN4c9kCKO+IRTn7EOh8rqk41XXGOOsKFQebg+jN
gtXj9xVoRaELGYW84u+E593y17iYwqG7tcFR39SDAqc9BkJb4SLD3muFXxzW2k6L
05vuuWciKh0R73mkszeK9P4Y/bz5RiNQl/Os/CRGK1w7t0UCAwEAAaOB5zCB5DAM
BgNVHRMBAf8EAjAAMDYGA1UdHwQvMC0wK6ApoCeGJWh0dHA6Ly9jcmwudGhhd3Rl
LmNvbS9UaGF3dGVTR0NDQS5jcmwwKAYDVR0lBCEwHwYIKwYBBQUHAwEGCCsGAQUF
BwMCBglghkgBhvhCBAEwcgYIKwYBBQUHAQEEZjBkMCIGCCsGAQUFBzABhhZodHRw
Oi8vb2NzcC50aGF3dGUuY29tMD4GCCsGAQUFBzAChjJodHRwOi8vd3d3LnRoYXd0
ZS5jb20vcmVwb3NpdG9yeS9UaGF3dGVfU0dDX0NBLmNydDANBgkqhkiG9w0BAQUF
AAOBgQCfQ89bxFApsb/isJr/aiEdLRLDLE5a+RLizrmCUi3nHX4adpaQedEkUjh5
u2ONgJd8IyAPkU0Wueru9G2Jysa9zCRo1kNbzipYvzwY4OA8Ys+WAi0oR1A04Se6
z5nRUP8pJcA2NhUzUnC+MY+f6H/nEQyNv4SgQhqAibAxWEEHXw==
-----END CERTIFICATE-----
subject=/C=US/ST=California/L=Mountain View/O=Google Inc/CN=
issuer=/C=ZA/O=Thawte Consulting (Pty) Ltd./CN=Thawte SGC CA
---
No client certificate CA names sent
---
SSL handshake has read 1777 bytes and written 316 bytes
---
New, TLSv1/SSLv3, Cipher is AES256-SHA
Server public key is 1024 bit
Compression: NONE
Expansion: NONE
SSL-Session: Protocol : TLSv1 Cipher : AES256-SHA Session-ID: 748E2B5FEFF9EA065DA2F04A06FBF456502F3E64DF1B4FF054F54817C473270C Session-ID-ctx: Master-Key: C4284AE7D76421F782A822B3780FA9677A726A25E1258160CA30D346D65C5F4049DA3D10A41F3FA4816DD9606197FAE5 Key-Arg : None Start Time: 1266259321 Timeout : 300 (sec) Verify return code: 20 (unable to get local issuer certificate)
---

it just shows that the cipher suite is something with AES256-SHA. I know I could grep through the hex dump of the conversation, but I was hoping for something a little more elegant.

I would prefer to do this on Linux, but Windows (or other) would be fine. This question is motivated by the security testing I do for PCI and general penetration testing.

Update:

GregS points out below that the SSL server picks from the cipher suites of the client. So it seems I would need to test all cipher suites one at a time. I think I can hack something together, but is there a simpler, more future-proof (e.g. new ciphers) way to do this?

4

21 Answers

I wrote a bash script to test cipher suites. It gets a list of supported cipher suites from OpenSSL and tries to connect using each one. If the handshake is successful, it prints YES. If the handshake isn't successful, it prints NO, followed by the OpenSSL error text.

#!/usr/bin/env bash
# OpenSSL requires the port number.
SERVER=$1
DELAY=1
ciphers=$(openssl ciphers 'ALL:eNULL' | sed -e 's/:/ /g')
echo Obtaining cipher list from $(openssl version).
for cipher in ${ciphers[@]}
do
echo -n Testing $cipher...
result=$(echo -n | openssl s_client -cipher "$cipher" -connect $SERVER 2>&1)
if [[ "$result" =~ ":error:" ]] ; then error=$(echo -n $result | cut -d':' -f6) echo NO \($error\)
else if [[ "$result" =~ "Cipher is ${cipher}" || "$result" =~ "Cipher :" ]] ; then echo YES else echo UNKNOWN RESPONSE echo $result fi
fi
sleep $DELAY
done

Here's sample output showing 3 unsupported ciphers, and 1 supported cipher:

[@linux ~]$ ./test_ciphers 192.168.1.11:443
Obtaining cipher list from OpenSSL 0.9.8k 25 Mar 2009.
Testing ADH-AES256-SHA...NO (sslv3 alert handshake failure)
Testing DHE-RSA-AES256-SHA...NO (sslv3 alert handshake failure)
Testing DHE-DSS-AES256-SHA...NO (sslv3 alert handshake failure)
Testing AES256-SHA...YES

EDIT: Add flexibility as host and port are provided as parameter to the script

15

Nmap with ssl-enum-ciphers

There is no better or faster way to get a list of available ciphers from a network service. Plus, nmap will provide a strength rating of strong, weak, or unknown for each available cipher.

First, download the ssl-enum-ciphers.nse nmap script (explanation here). Then from the same directory as the script, run nmap as follows:

List ciphers supported by an HTTP server

$ nmap --script ssl-enum-ciphers -p 443 

List ciphers supported by an IMAP server

$ nmap --script ssl-enum-ciphers -p 993 mail.example.com

Here is a snippet of output from a Dovecot IMAP server:

993/tcp open imaps
| ssl-enum-ciphers:
| SSLv3:
| ciphers:
| TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA - strong
| TLS_DHE_RSA_WITH_AES_128_CBC_SHA - strong
| TLS_DHE_RSA_WITH_AES_256_CBC_SHA - strong
| TLS_RSA_WITH_IDEA_CBC_SHA - weak
...
| TLSv1.0:
| ciphers:
| TLS_DHE_RSA_WITH_3DES_EDE_CBC_SHA - strong
| TLS_DHE_RSA_WITH_AES_128_CBC_SHA - strong
| TLS_DHE_RSA_WITH_AES_256_CBC_SHA - strong
| TLS_RSA_WITH_IDEA_CBC_SHA - weak
...
|_ least strength: weak
Nmap done: 1 IP address (1 host up) scanned in 1.03 seconds
13

Is there a tool that can test what SSL/TLS cipher suites a particular website offers?

Yes, you could use the online tool on SSL Labs' website to query the Public SSL Server Database.

Here is a snippet of information that it provides:

alt text

(screenshot from results of google.com)

5

sslscan is a nice little utility.

It tests connecting with TLS and SSL (and the build script can link with its own copy of OpenSSL so that obsolete SSL versions are checked as well) and reports about the server's cipher suites and certificate.

Example output for google.com (trimmed down for readability):

$ sslscan google.com
Testing SSL server google.com on port 443 TLS renegotiation:
Secure session renegotiation supported TLS Compression:
Compression disabled Heartbleed:
TLS 1.2 not vulnerable to heartbleed
TLS 1.1 not vulnerable to heartbleed
TLS 1.0 not vulnerable to heartbleed Supported Server Cipher(s):
Preferred TLSv1.2 128 bits ECDHE-RSA-AES128-GCM-SHA256 Curve P-256 DHE 256
Accepted TLSv1.2 128 bits ECDHE-RSA-AES128-SHA Curve P-256 DHE 256
Accepted TLSv1.2 128 bits ECDHE-RSA-RC4-SHA Curve P-256 DHE 256
Accepted TLSv1.2 128 bits AES128-GCM-SHA256
Accepted TLSv1.2 128 bits AES128-SHA
<snip>
Preferred TLSv1.1 128 bits ECDHE-RSA-AES128-SHA Curve P-256 DHE 256
Accepted TLSv1.1 128 bits ECDHE-RSA-RC4-SHA Curve P-256 DHE 256
Accepted TLSv1.1 128 bits AES128-SHA
<snip>
Preferred TLSv1.0 128 bits ECDHE-RSA-AES128-SHA Curve P-256 DHE 256
Accepted TLSv1.0 128 bits ECDHE-RSA-RC4-SHA Curve P-256 DHE 256
Accepted TLSv1.0 128 bits AES128-SHA
<snip>
Preferred SSLv3 128 bits RC4-SHA
Accepted SSLv3 128 bits RC4-MD5
<snip> SSL Certificate:
Signature Algorithm: sha256WithRSAEncryption
RSA Key Strength: 2048
Subject: *.google.com
Altnames: DNS:*.google.com, DNS:*.android.com, <snip>
Issuer: Google Internet Authority G2
Not valid before: Apr 7 08:24:31 2016 GMT
Not valid after: Jun 30 08:20:00 2016 GMT
10

Since this is such a great reference thread for SSL scanning tools, I'll list CipherScan which was created a year ago and can also identify problems with key exchange ciphers.

If you want my fork which supports SNI and FreeBSD, the URL is

It's a script which calls openssl s_client and supports using your own OpenSSL binary so that you can test upcoming features or new ciphers (chacha20+poly1305 per example).

It also lets you connect to any port you want and use starttlss.

Here is a typical output

# ./cipherscan -o ./openssl api.mycompany.com:443
...................
prio ciphersuite protocols pfs_keysize
1 DHE-RSA-AES256-GCM-SHA384 TLSv1.2 DH,4096bits
2 DHE-RSA-AES256-SHA256 TLSv1.2 DH,4096bits
3 ECDHE-RSA-AES256-GCM-SHA384 TLSv1.2 ECDH,P-384,384bits
4 ECDHE-RSA-AES256-SHA384 TLSv1.2 ECDH,P-384,384bits
5 DHE-RSA-AES128-GCM-SHA256 TLSv1.2 DH,4096bits
6 DHE-RSA-AES128-SHA256 TLSv1.2 DH,4096bits
7 ECDHE-RSA-AES128-GCM-SHA256 TLSv1.2 ECDH,P-384,384bits
8 ECDHE-RSA-AES128-SHA256 TLSv1.2 ECDH,P-384,384bits
9 DHE-RSA-CAMELLIA256-SHA TLSv1,TLSv1.1,TLSv1.2 DH,4096bits
10 DHE-RSA-AES256-SHA TLSv1,TLSv1.1,TLSv1.2 DH,4096bits
11 ECDHE-RSA-AES256-SHA TLSv1,TLSv1.1,TLSv1.2 ECDH,P-384,384bits
12 DHE-RSA-CAMELLIA128-SHA TLSv1,TLSv1.1,TLSv1.2 DH,4096bits
13 DHE-RSA-AES128-SHA TLSv1,TLSv1.1,TLSv1.2 DH,4096bits
14 ECDHE-RSA-AES128-SHA TLSv1,TLSv1.1,TLSv1.2 ECDH,P-384,384bits
15 CAMELLIA256-SHA TLSv1,TLSv1.1,TLSv1.2
16 AES256-SHA TLSv1,TLSv1.1,TLSv1.2
17 CAMELLIA128-SHA TLSv1,TLSv1.1,TLSv1.2
18 AES128-SHA TLSv1,TLSv1.1,TLSv1.2
Certificate: trusted, 4096 bit, sha256WithRSAEncryption signature
TLS ticket lifetime hint: 300
OCSP stapling: supported

And here are a list of options

-a | --allciphers Test all known ciphers individually at the end.
-b | --benchmark Activate benchmark mode.
-d | --delay Pause for n seconds between connections
-D | --debug Output ALL the information.
-h | --help Shows this help text.
-j | --json Output results in JSON format.
-o | --openssl path/to/your/openssl binary you want to use.
-v | --verbose Increase verbosity.

The json output is useful if you're calling this from other scripts.

1

This one is Python based, works in Linux/Mac/Windows from command line.

After a little googling I found this Testing for SSL-TLS (OWASP-CM-001):

The nmap scanner, via the “–sV” scan option, is able to identify SSL services. Vulnerability Scanners, in addition to performing service discovery, may include checks against weak ciphers (for example, the Nessus scanner has the capability of checking SSL services on arbitrary ports, and will report weak ciphers).

and also: Foundstone SSL Digger is a tool to assess the strength of SSL servers by testing the ciphers supported. Some of these ciphers are known to be insecure.

I am using for most of the SSL tests testssl.sh (see / devel version @ . It tests for vulnerabilities, ciphers, protocols etc.

0

This answer summarizes best given answers sofar and argues why to choose an alternative (or not!).


To find the best solution, we should first answer 'why do we want to enumerate all supported ciphers?'. Here the focus is on the security aspect, i.e., to find out if a server is vulnerable or not. The next question to answer is if the output should be machine readable, e.g., to be further used in a script, or not.

  1. testssl.sh

  • CLI (Bash)
  • TLSv1.3
  • Checks for known vulnerabilities
  • Self-contained (not installation needed)
  • Supports 370 ciphers (as of version 3.1) including deprecated ciphers (not included in newer openSSL versions)
  • Produces machine-readable results (CSV and JSON)
  • (parallelized) batch processing
  • Slow

Maybe the most important advantage of testssl.sh over the following alternatives is the usage of a set of binaries which are tailored for vulnerability testing (read developer's explanation here).

  1. cipherscan

  • CLI (python)
  • No TLSv1.3
  • Self-contained
  • Limited cipher suites (hard-coded)
  • Produces machine-readable results (JSON)
  • Fast
  1. nmap ssl-enum-ciphers

  • CLI (nmap script)
  • No TLSv1.3 (newer versions do support this!)
  • Self-contained
  • Limited cipher suites (hard-coded)
  • Checks for known vulnerabilities
  • No machine-readable results

For an exhaustive overview of available tools see sslLabs Assessment Tools.

1

SSLScan is great; a new tool SSLDiagnos works for Windows, or you can just write a script using the openssl s_client.

If you want a nice grepable output (and support for checking all SSL/TLS versions)

Usage: ./script.sh

#!/usr/bin/env bash
ciphers2=$(openssl ciphers -ssl2 'ALL:eNULL' | sed -e 's/:/ /g')
ciphers3=$(openssl ciphers -ssl3 'ALL:eNULL' | sed -e 's/:/ /g')
cipherst1=$(openssl ciphers -tls1 'ALL:eNULL' | sed -e 's/:/ /g')
cipherst11=$(openssl ciphers -tls1.1 'ALL:eNULL' | sed -e 's/:/ /g')
cipherst12=$(openssl ciphers -tls1.2 'ALL:eNULL' | sed -e 's/:/ /g')
SSL2="SSL2("
for cipher in ${ciphers2[@]}
do
result=$(echo -n | openssl s_client -ssl2 -cipher "$cipher" -connect $1:443 2>&1)
if [[ "$result" =~ "Cipher is ${cipher}" ]] ; then SSL2="${SSL2}${cipher}:"
fi
done
SSL2=$(echo "${SSL2})" | sed -e 's/:)/)/g')
SSL3="SSL3("
for cipher in ${ciphers3[@]}
do
result=$(echo -n | openssl s_client -ssl3 -cipher "$cipher" -connect $1:443 2>&1)
if [[ "$result" =~ "Cipher is ${cipher}" ]] ; then SSL3="${SSL3}${cipher}:"
fi
done
SSL3=$(echo "${SSL3})" | sed -e 's/:)/)/g')
TLS1="TLS1("
for cipher in ${cipherst1[@]}
do
result=$(echo -n | openssl s_client -tls1 -cipher "$cipher" -connect $1:443 2>&1)
if [[ "$result" =~ "Cipher is ${cipher}" ]] ; then TLS1="${TLS1}${cipher}:"
fi
done
TLS1=$(echo "${TLS1})" | sed -e 's/:)/)/g')
TLS11="TLS1.1("
for cipher in ${cipherst11[@]}
do
result=$(echo -n | openssl s_client -tls1_1 -cipher "$cipher" -connect $1:443 2>&1)
if [[ "$result" =~ "Cipher is ${cipher}" ]] ; then TLS11="${TLS11}${cipher}:"
fi
done
TLS11=$(echo "${TLS11})" | sed -e 's/:)/)/g')
TLS12="TLS1.2("
for cipher in ${cipherst12[@]}
do
result=$(echo -n | openssl s_client -tls1_2 -cipher "$cipher" -connect $1:443 2>&1)
if [[ "$result" =~ "Cipher is ${cipher}" ]] ; then TLS12="${TLS12}${cipher}:"
fi
done
TLS12=$(echo "${TLS12})" | sed -e 's/:)/)/g')
echo "$1,$SSL2,$SSL3,$TLS1,$TLS11,$TLS12";
4

There is a nice little script at pentesterscripting.com to utilise both SSLScan and OpenSSL to check for:

  • SSL v2;
  • Week ciphers suits;
  • MD5; and
  • TLS Renegotiation vulnerability

(via the Internet Archive Wayback Machine)

Duplicated here for futureproofing as the main site is now dead:

#!/usr/bin/env bash
# Description:
# Script to extract the most security relevant details from a
# target SSL/TLS implementation by using sslscan.
# Author: Raul Siles (raul _AT_ taddong _DOT_ com)
# Taddong ()
# Date: 2011-05-27
# Version: 1.0
#
# - Current SSL/TLS tests:
# SSLv2, NULL cipher, weak ciphers -key length-, strong
# ciphers -AES-, MD5 signed cert, SSL/TLS renegotiation
#
# Requires:
# - sslscan
#
#
# Credits: Based on ssl_test.sh by Aung Khant,
#
#
# /**************************************************************************
# * Copyright 2011 by Taddong (Raul Siles) *
# * *
# * This program is free software; you can redistribute it and/or modify *
# * it under the terms of the GNU General Public License as published by *
# * the Free Software Foundation; either version 3 of the License, or *
# * (at your option) any later version. *
# * *
# * This program is distributed in the hope that it will be useful, *
# * but WITHOUT ANY WARRANTY; without even the implied warranty of *
# * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
# * GNU General Public License for more details. *
# * *
# * You should have received a copy of the GNU General Public License *
# * along with this program. If not, see < *
# * *
# **************************************************************************/
#
VERSION=1.0
OPENSSLVERSION=$(openssl version)
SSLSCANVERSION=$(sslscan --version | grep version | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g")
echo ------------------------------------------------------
echo " TLSSLed - ($VERSION) based on sslscan and openssl"
echo " by Raul Siles ()"
echo " ( inspired by ssl_test.sh by Aung Khant )"
echo ------------------------------------------------------
echo + openssl version: $OPENSSLVERSION
echo + $SSLSCANVERSION
echo ------------------------------------------------------
echo
if [ $# -ne 2 ]; then echo Usage: $0 IP PORT exit
fi
HOST=$1
PORT=$2
echo [*] Analyzing SSL/TLS on $HOST:$PORT ...
echo
# Run sslcan once, store the results to a log file and
# analyze that file for all the different tests:
DATE=$(date +%F_%R:%S)
TARGET=$HOST:$PORT
LOGFILE=sslscan\_$TARGET\_$DATE.log
ERRFILE=sslscan\_$TARGET\_$DATE.err
echo [*] Running sslscan on $HOST:$PORT...
sslscan $HOST:$PORT > $LOGFILE 2> $ERRFILE
echo
echo [*] Testing for SSLv2 ...
cat $LOGFILE | grep "Accepted SSLv2"
echo
echo [*] Testing for NULL cipher ...
cat $LOGFILE | grep "NULL" | grep Accepted
echo
echo [*] Testing for weak ciphers \(based on key length\) ...
cat $LOGFILE | grep " 40 bits" | grep Accepted
echo
cat $LOGFILE | grep " 56 bits" | grep Accepted
echo
echo [*] Testing for strong ciphers \(AES\) ...
cat $LOGFILE | grep "AES" | grep Accepted
echo
echo [*] Testing for MD5 signed certificate ...
#cat $LOGFILE | grep -E 'MD5WithRSAEncryption|md5WithRSAEncryption'
cat $LOGFILE | grep -i 'MD5WithRSAEncryption'
echo
echo [*] Checking preferred server ciphers ...
cat $LOGFILE | sed '/Prefered Server Cipher(s):/,/^$/!d' | sed -r "s/\x1B\[([0-9]{1,2}(;[0-9]{1,2})?)?[m|K]//g"
echo
echo [*] Testing for SSLv3/TLSv1 renegotiation vuln. \(CVE-2009-3555\) ...
#echo [*] echo R \| openssl s_client -connect $HOST:$PORT \| grep "DONE"
#
# Renegotiation details go to stderr (2>)
#
# if $OPENSSLVERSION is updated (version?) it supports RFC5746 and will print:
# Secure Renegotiation IS NOT supported
# Secure Renegotiation IS supported
#
echo R | openssl s_client -connect $HOST:$PORT | grep -E "Secure Renegotiation IS|DONE"
echo
echo [*] New files created:
ls -l $LOGFILE
if [ ! -s $ERRFILE ]; then # Error file is empty rm $ERRFILE
else ls -l $ERRFILE
fi
echo
echo
echo [*] done
echo

Usage: ./ssltest.sh HOST PORT

0

Based on @indiv's answer and suggestion to post it as its own answer, I am providing my tweaked version of @indiv's script. You can provide a host as the first argument, and it will output the same results as the original script, but a little more formatted:

#!/usr/bin/env bash
# adapted from
# OpenSSL requires the port number.
# SERVER=192.168.1.1:443
SERVER=$1
if [[ -z "$SERVER" ]]; then echo "ERROR: no server specified"; exit 1; fi;
## Set up colors, if possible
if [[ $(tput colors) ]];then COLOR_BOLD="$(tput bold)" # "\e[1;32m" COLOR_GREEN="$(tput setaf 2)" # "\e[1;32m" COLOR_RESET="$(tput sgr0)" # "\e[0m"
fi
SERVER=$1:443
echo Server is ${COLOR_BOLD}"$SERVER"${COLOR_RESET}
DELAY=1
ciphers=$(openssl ciphers 'ALL:eNULL' | sed -e 's/:/ /g')
echo Obtaining cipher list from $(openssl version).
for cipher in ${ciphers[@]} do printf "%-42s" "Testing $cipher... " result=$(echo -n | openssl s_client -cipher "$cipher" -connect $SERVER 2>&1) if [[ "$result" =~ ":error:" ]] ; then error=$(echo -n $result | cut -d':' -f6) echo NO \($error\) else if [[ "$result" =~ "Cipher is ${cipher}" || "$result" =~ "Cipher :" ]] ; then echo ${COLOR_BOLD}${COLOR_GREEN}YES${COLOR_RESET} else echo UNKNOWN RESPONSE echo $result fi fi sleep $DELAY
done

The (free of charge) OpenSSL Cookbook by Ivan Ristić, who developed the SSL Labs online tool noted in Kez's answer, states:

If you want to determine all suites supported by a particular server, start by invoking openssl ciphers ALL to obtain a list of all suites supported by your version of OpenSSL. Then submit them to the server one by one to test them individually. I am not suggesting that you do this manually; this is a situation in which a little automation goes a long way. In fact, this is a situation in which looking around for a good tool might be appropriate.

There is a disadvantage to testing this way, however. You can only test the suites that OpenSSL supports. ...

No single SSL/TLS library supports all cipher suites, and that makes comprehensive testing difficult. For SSL Labs, I resorted to using partial handshakes for this purpose, with a custom client that pretends to support arbitrary suites. It actually can’t negotiate even a single suite, but just proposing to negotiate is enough for servers to tell you if they support a suite or not. Not only can you test all the suites this way, but you can also do it very efficiently.

(My emphasis.)

One tool I haven't seen mentioned in other answers is Stephen Bradshaw's SSLTest, which, among other things, is intended to compare "the detected ciphers and protocols against compliance standards such as DSD ISM and PCI-DSS."

So, try this or one of the tools mentioned in the other answers, or else build your own and consider using Ristić's approach of partial handshakes.

Nmap's ssl-enum-ciphers script can list the supported ciphers and SSL/TLS versions, as well as the supported compressors.

1

I wrote a tool that does exactly this. It's called tlsenum and it's available on GitHub.

[ayrx@division tlsenum]$ ./tlsenum.py twitter.com 443
TLS Versions supported by server: 3.0, 1.0, 1.1, 1.2
Supported Cipher suites in order of priority:
TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
TLS_ECDHE_RSA_WITH_RC4_128_SHA
TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA
TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA
TLS_RSA_WITH_AES_128_GCM_SHA256
TLS_RSA_WITH_RC4_128_SHA
TLS_RSA_WITH_RC4_128_MD5
TLS_RSA_WITH_AES_128_CBC_SHA
TLS_RSA_WITH_AES_256_CBC_SHA
TLS_RSA_WITH_3DES_EDE_CBC_SHA

Here is an example output of the tool against twitter.com.

It's similar to what SSL Lab's does but I find that having a command line tool that you can automate and parse is much more useful.

SSLyze, originally at , is now at . It was mentioned in another answer, but without much detail.

SSLyze is Python based, and works on Linux/Mac/Windows from command line. It uses OpenSSL, and on Windows, it comes with a bundled copy of OpenSSL.

Lists protocols, cipher suites, and key details, plus tests for some common vulnerabilities. It's possible to enable or disable particular checks, to get more data or speed up the scan.

The only thing you can do is try them all, one at a time, and see which ones are accepted. I am not aware of a tool to do this, though it should not be hard to cobble one together from scripting tools and openssl s_client.

While the client advertises which ciphersuites it will accept, the server simply picks one and uses it or fails the connection if it finds nothing it likes.

1

All those answers are fine. One part of the answer could explain why do we need a tool to discover list of server and not ask directly in TLS that server gives all its supported cipher suites just like TLS client does when it connects to a server.

Answer is that server does not send a list ever, it just select in client cipher list the cipher it wants to use, this is the way SSL/TLS protocol is written :

That's why client has to enumerate ciphers to be able to find those supported by server and for that to do at least one new start handshake (ClientHello) for each cipher suite.

While looking for something that does AUTH TLS on FTP, I discovered this tool: ssl-cipher-suite-enum

It’s a perl script that basically does what hackajar’s shell script does, only more sophisticated.

It also offers a basic evaluation of offered ciphers and protocols. It’s somewhat like SSL Labs tools, only for home use. :)

By default, it only supports AUTH SSL on FTP, but a simple search and replace can fix that. As a bonus, it also claims to support SMTP with STARTTLS and RDP.

TestSSLServer is a purely Java-based solution. Advantages:

  • it's working very low-level, just on plain Sockets, so it's independent of possible unavailable ciphers from JDK or OpenSSL.

  • it doesn't require any additional ports (like ICMP for ping) to be opened

  • it's working with client certificates present

Disadvantages:

  • as of 2016, the list of ciphers might be outdated (though I'm no expert here to judge this)

My personal experience: given a tight-laced server with just a single HTTPS port open (no other port), client certificates required and iptables being active, it was still able to list available ciphers, while top-voted solutions were not (I was trying small shell script, SSL Labs, NMap, sslscan)

You Might Also Like