testssl.sh: Testing TLS/SSL encryption
testssl.sh is a free Unix command line tool which checks a server's service
on any port for the support of TLS/SSL ciphers, protocols as well as some flaws.
It's designed to provide a clear output for a "is this good or bad" decision.
As for security reasons some distributors
outphase the buggy stuff – and this is exactly you want to check for – it's recommended to compile OpenSSL by
yourself or check out the OpenSSL binaries below (Linux) – they come with a whopping 191 ciphers, ~80 more than on an average Linux distro. In any case: Except the ciphers, you will get a warning if your OpenSSL client
cannot perform a specific check, see below.
testssl.sh is pretty much portable. It is working on every recent Linux distribution.
It is supposed also to work on any other unixoid systems — on FreeBSD and MacOSX it works with the limitations of an old OpenSSL version (0.98).
On any other system it is suggested to have GNU tools installed (specifically /bin/bash sed and awk), it also supposed to work on cygwin. However this is not tested.
I am curious on feedback though, see below.
(for development version 2.1, see github below)
- 2.0: Features:
- server preferences for protocols and ciphers
- checks for: RC4, PFS, SPDY
- web and app server banner, HSTS
- server key size
- TLS session tickets
- TLS server extensions
- heartbleed check from bash-heartbleed.sh with shell only SSL handshake!
- CCS check from ccs-injection.sh with shell only SSL handshake!
- somewhat smart check for BREACH vulnerability
- prelease of cipher suites name space mapping OpenSSL <--> RFC
- aaand: neat output
- 1.40: cleanups, path of URL supplied on the command line (is ignored for now)
- 1.30: can test now for cipher suites / protocols only, tests for tls v1.1/v1.2 , -a/--all renamed
- 1.21: CRIME support, see http://threatpost.com/en_us/blogs/new-attack-uses-ssltls-information-leak-hijack-https-sessions-090512.
- 1.18: Rearragement of arguments: URI comes now always last. NOPARANOID flag tells whether medium grade ciphers are ok.
- 1.17: tests now for renegotiation vulnerabity, see (CVE-2009-3555)
- 1.16: Invoking options changed with this release. Port and hostname / URL will be accepted only as one argument. major code cleanups. Also
checks now whether SSL is listening on the server side at all. -a/--all tests cipher by cipher now.
- More see CHANGELOG.
Starting testssl.sh with no params will give you a clue how to use it:
userid@somehost:~ % testssl.sh
testssl.sh <options> URI
where <options> is one of
<-h|--help> what you're looking at
<-b|--banner> displays banner + version
<-v|--version> same as above
<-V|--local> pretty print all local ciphers
<-V|--local> <hexcode> what cipher is <pattern hexcode>?
<-e|--each-cipher> check each local ciphers remotely
<-E|-ee|--cipher-per-proto> check those per protocol
<-f|--ciphers> check cipher suites
<-p|--protocols> check TLS/SSL protocols only
<-P|--preference> displays the servers picks: protocol+cipher
<-y|--spdy> checks for SPDY/NPN
<-B|--heartbleed> tests only for heartbleed vulnerability
<-I|--ccs|--ccs_injection> tests only for CCS injection vulnerability
<-R|--renegotiation> tests only for renegotiation vulnerability
<-C|--crime> tests only for CRIME vulnerability
<-T|--breach> tests only for BREACH vulnerability
<-s|--pfs|--fs|--nsa> checks (perfect) forward secrecy settings
<-4|--rc4|--appelbaum> which RC4 ciphers are being offered?
<-H|--header|--headers> check for HSTS and server banner string
URI is host|host:port|URL|URL:port
(port 443 is assumed unless otherwise specified)
<-t|--starttls> host:port <ftp|smtp|pop3|imap|xmpp|telnet> *) <SNI hostname>
*) for STARTTLS telnet support you need a patched openssl version (to be provided soon)
Normal use case is probably just "testssl.sh <hostname>", see first picture above. "testssl.sh -E <hostname>" was used in the
second picture above. A STARTTLS check (see last picture) would be achieved with e.g.
testssl.sh --starttls <smtphostname>.<tld>:587 smtp
testssl.sh -t <jabberhostname>.<tld>:5222 xmpp
testssl.sh --starttls <pophostname>.<tld>:110 pop3
As the help says: Currently only one option at a time works.
A maybe neat feature: If you want to find out what local ciphers you have and
print them pretty, use "testssl.sh -V". Ever wondered what hexcode a cipher is?
"testssl.sh -V 9f" lets you search for the hexcode 9f. If you have the file
"mapping-rfc.txt" in the same directory "testssl.sh -V" displays the matching RFC style cipher
suite name. Also during every cipher suite test the corresponding RFC style name is
displayed. It's a broad output. If you don't want this, you need to move mapping-rfc.txt
away -- for now.
Got it so far? Good.
Hint regarding OpenSSL binary
As mentioned above, a prerequisite for thoroughly checking SSL/TLS enabled servers is: all you want to check for has to be
available on your client. Transport encryption is not only depending on the server but also on your crypto provider on the client side –
especially if you want to use it for testing.
So there are drawbacks out of the Linux distributions boxes -- so to speak:
Thus the signed tarball provides specially compiled statically linked (except glibc and the loader)
OpenSSL binaries as a courtesy. The newer version version has ChaCha+Poly ciphers on board. There are also Kerberos binaries included -- the latter ones require a bunch of
libraries (no static binaries).
You'll need to unpack my binaries, dump those you need either in the same location as testssl.sh, named just "openssl" or "openssl.`uname -m`".
You can also tell testssl.sh via environment variable where your openssl binary is:
- one cannot check 56 Bit ciphers as they are disabled during compile time.
- some ciphers are disabled for security reasons,
- support maybe not included (to disable CRIME)
- and last but not least: SSLv2 seems to be outphased too, Ubuntu started this.
export OPENSSL=<path_to_myopenssl> before you use testssl. Or issue
OPENSSL=<path_to_myopenssl> testssl.sh <hostname>
Don't try outdated OpenSSL versions before 1.0! Those versions are deprecated, you likely will not get very far. testssl.sh is not locking
those out but things might not work as expected. Support will be retired soon.
If you insist on using crippled binaries, you'll get a warning in magenta, see picture on the right hand side.
Feedback, bugs and contributions are welcome!
Currently there are two git repos @ github and @ nginx goodies on bitbucket (thx Markus setting the latter up). Here @ https://testssl.sh you will always find the stable version. At the github repo is the latest-greatest devel version.
Mailing list, bug tracker etc. will come soon.
me via github or see info in testssl.sh / dirk aet testssl dot sh.
I post all significant updates on Twitter (@drwetter).