Tools - testssl
Alasta 26 Juillet 2016 tools bash collecte tools Linux Open Source Security shell kali ssl
Description : Nous allons utiliser testssl.sh pour découvrir les ciphers supportés par un service SSL/TLS.
Rappel :
Attention dans cet article l'outils est utilisé pour la recherche et l'apprentissage. Ce type d'outils ne doit pas être utilisé vers un serveur qui ne vous appartient pas, ceci peut être puni par la loi (voir les articles 323-XX).
Environnement de test :
Pour cela nous allons utiliser une VM tournant sur la distribution Kali.
Installation du script :
Recupération du script
Aller sur le site https://testssl.sh/ et récupérer le script shell testssl.sh.
Rendre le script exécutable une fois la récupération éffectuée.
1 $ chmod +x testssl.sh
Utilisation :
La commande et ses options
1 root@kali:~# ./testssl.sh -h
2
3 No mapping file found
4
5 testssl.sh <options>
6
7 -h, --help what you're looking at
8 -b, --banner displays banner + version of testssl.sh
9 -v, --version same as previous
10 -V, --local pretty print all local ciphers
11 -V, --local <pattern> which local ciphers with <pattern> are available?
12 (if pattern not a number: word match)
13
14 testssl.sh <options> URI ("testssl.sh URI" does everything except -E)
15
16 -e, --each-cipher checks each local cipher remotely
17 -E, --cipher-per-proto checks those per protocol
18 -f, --ciphers checks common cipher suites
19 -p, --protocols checks TLS/SSL protocols
20 -S, --server_defaults displays the servers default picks and certificate info
21 -P, --preference displays the servers picks: protocol+cipher
22 -y, --spdy, --npn checks for SPDY/NPN
23 -x, --single-cipher <pattern> tests matched <pattern> of ciphers
24 (if <pattern> not a number: word match)
25 -U, --vulnerable tests all vulnerabilities
26 -B, --heartbleed tests for heartbleed vulnerability
27 -I, --ccs, --ccs-injection tests for CCS injection vulnerability
28 -R, --renegotiation tests for renegotiation vulnerabilities
29 -C, --compression, --crime tests for CRIME vulnerability
30 -T, --breach tests for BREACH vulnerability
31 -O, --poodle tests for POODLE (SSL) vulnerability
32 -Z, --tls-fallback checks TLS_FALLBACK_SCSV mitigation
33 -F, --freak tests for FREAK vulnerability
34 -A, --beast tests for BEAST vulnerability
35 -J, --logjam tests for LOGJAM vulnerability
36 -s, --pfs, --fs,--nsa checks (perfect) forward secrecy settings
37 -4, --rc4, --appelbaum which RC4 ciphers are being offered?
38 -H, --header, --headers tests HSTS, HPKP, server/app banner, security headers, cookie, reverse proxy, IPv4 address
39
40 special invocations:
41
42 -t, --starttls <protocol> does a default run against a STARTTLS enabled <protocol>
43 --xmpphost <to_domain> for STARTTLS enabled XMPP it supplies the XML stream to-'' domain -- sometimes needed
44 --mx <domain/host> tests MX records from high to low priority (STARTTLS, port 25)
45 --ip <ipv4> a) tests the supplied <ipv4> instead of resolving host(s) in URI
46 b) arg "one" means: just test the first DNS returns (useful for multiple IPs)
47 --file <file name> mass testing option: Just put multiple testssl.sh command lines in <file name>,
48 one line per instance. Comments via # allowed, EOF signals end of <file name>.
49
50 partly mandatory parameters:
51
52 URI host|host:port|URL|URL:port (port 443 is assumed unless otherwise specified)
53 pattern an ignore case word pattern of cipher hexcode or any other string in the name, kx or bits
54 protocol is one of ftp,smtp,pop3,imap,xmpp,telnet,ldap (for the latter two you need e.g. the supplied openssl)
55
56 tuning options:
57
58 --assuming-http if protocol check fails it assumes HTTP protocol and enforces HTTP checks
59 --ssl-native fallback to checks with OpenSSL where sockets are normally used
60 --openssl <PATH> use this openssl binary (default: look in $PATH, $RUN_DIR of testssl.sh
61 --proxy <host>:<port> connect via the specified HTTP proxy
62 --sneaky be less verbose wrt referer headers
63 --quiet don't output the banner. By doing this you acknowledge usage terms normally appearing in the banner
64 --wide wide output for tests like RC4, BEAST. PFS also with hexcode, kx, strength, RFC name
65 --show-each for wide outputs: display all ciphers tested -- not only succeeded ones
66 --warnings <batch|off|false> "batch" doesn't wait for keypress, "off" or "false" skips connection warning
67 --color <0|1|2> 0: no escape or other codes, 1: b/w escape codes, 2: color (default)
68 --debug <0-6> 1: screen output normal but debug output in temp files. 2-6: see line ~105
69
70 All options requiring a value can also be called with '=' (e.g. testssl.sh -t=smtp --wide --openssl=/usr/bin/openssl <URI>.
71 <URI> is always the last parameter.
72
73 Need HTML output? Just pipe through "aha" (Ansi HTML Adapter: github.com/theZiz/aha) like
74
75 "testssl.sh <options> <URI> | aha >output.html"
La commande de base
1 root@kali:~# ./testssl.sh mail.google.com
2
3 No mapping file found
4
5 ###########################################################
6 testssl.sh 2.6 from https://testssl.sh/
7 (1.379c 2015/09/29 16:47:47)
8
9 This program is free software. Distribution and
10 modification under GPLv2 permitted.
11 USAGE w/o ANY WARRANTY. USE IT AT YOUR OWN RISK!
12
13 Please file bugs @ https://testssl.sh/bugs/
14
15 ###########################################################
16
17 Using "OpenSSL 1.0.2g 1 Mar 2016" [~124 ciphers] on
18 kali:/usr/bin/openssl
19 (built: "reproducible build, date unspecified", platform: "debian-amd64")
20
21
22 Testing now (2016-07-26 10:21) ---> 172.217.20.37:443 (mail.google.com) <---
23
24 further IP addresses: 2a00:1450:4007:80e::2005
25 rDNS (172.217.20.37): par10s09-in-f5.1e100.net.
26 Service detected: HTTP
27
28
29 --> Testing protocols (via sockets except TLS 1.2 and SPDY/NPN)
30
31 SSLv2 not offered (OK)
32 SSLv3 not offered (OK)
33 TLS 1 offered
34 TLS 1.1 offered
35 TLS 1.2 offered (OK)
36 SPDY/NPN h2, spdy/3.1, http/1.1 (advertised)
37
38 --> Testing ~standard cipher lists
39
40 Null Ciphers not offered (OK)
41 Anonymous NULL Ciphers not offered (OK)
42 Anonymous DH Ciphers not offered (OK)
43 40 Bit encryption Local problem: No 40 Bit encryption configured in /usr/bin/openssl
44 56 Bit encryption Local problem: No 56 Bit encryption configured in /usr/bin/openssl
45 Export Ciphers (general) Local problem: No Export Ciphers (general) configured in /usr/bin/openssl
46 Low (<=64 Bit) Local problem: No Low (<=64 Bit) configured in /usr/bin/openssl
47 DES Ciphers Local problem: No DES Ciphers configured in /usr/bin/openssl
48 Medium grade encryption not offered (OK)
49 Triple DES Ciphers offered (NOT ok)
50 High grade encryption offered (OK)
51
52 --> Testing (perfect) forward secrecy, (P)FS -- omitting 3DES, RC4 and Null Encryption here
53
54 PFS is offered (OK) ECDHE-ECDSA-AES256-GCM-SHA384 ECDHE-RSA-AES256-GCM-SHA384 ECDHE-RSA-AES256-SHA384 ECDHE-ECDSA-AES256-SHA384 ECDHE-RSA-AES256-SHA ECDHE-ECDSA-AES256-SHA ECDHE-ECDSA-AES128-GCM-SHA256 ECDHE-RSA-AES128-GCM-SHA256 ECDHE-ECDSA-AES128-SHA256 ECDHE-RSA-AES128-SHA256 ECDHE-RSA-AES128-SHA ECDHE-ECDSA-AES128-SHA
55
56 --> Testing server preferences
57
58 Has server cipher order? yes (OK)
59 Negotiated protocol TLSv1.2
60 Negotiated cipher ECDHE-ECDSA-AES128-GCM-SHA256, 256 bit ECDH
61 Cipher order
62 TLSv1: ECDHE-ECDSA-AES128-SHA ECDHE-ECDSA-AES256-SHA ECDHE-RSA-AES128-SHA AES128-SHA DES-CBC3-SHA ECDHE-RSA-AES256-SHA AES256-SHA
63 TLSv1.1: ECDHE-ECDSA-AES128-SHA ECDHE-ECDSA-AES256-SHA ECDHE-RSA-AES128-SHA AES128-SHA DES-CBC3-SHA ECDHE-RSA-AES256-SHA AES256-SHA
64 TLSv1.2: ECDHE-ECDSA-AES128-GCM-SHA256 ECDHE-ECDSA-AES128-SHA ECDHE-ECDSA-AES256-GCM-SHA384 ECDHE-ECDSA-AES128-SHA256 ECDHE-ECDSA-AES256-SHA ECDHE-ECDSA-AES256-SHA384 ECDHE-RSA-AES128-GCM-SHA256 ECDHE-RSA-AES128-SHA AES128-GCM-SHA256 AES128-SHA AES128-SHA256 DES-CBC3-SHA ECDHE-RSA-AES256-GCM-SHA384 ECDHE-RSA-AES128-SHA256 ECDHE-RSA-AES256-SHA ECDHE-RSA-AES256-SHA384 AES256-GCM-SHA384 AES256-SHA AES256-SHA256
65 h2: ECDHE-RSA-AES128-GCM-SHA256 ECDHE-RSA-AES128-SHA AES128-GCM-SHA256 AES128-SHA AES128-SHA256 DES-CBC3-SHA ECDHE-RSA-AES256-GCM-SHA384 ECDHE-RSA-AES128-SHA256 ECDHE-RSA-AES256-SHA ECDHE-RSA-AES256-SHA384 AES256-GCM-SHA384 AES256-SHA AES256-SHA256
66 spdy/3.1: ECDHE-RSA-AES128-GCM-SHA256 ECDHE-RSA-AES128-SHA AES128-GCM-SHA256 AES128-SHA AES128-SHA256 DES-CBC3-SHA ECDHE-RSA-AES256-GCM-SHA384 ECDHE-RSA-AES128-SHA256 ECDHE-RSA-AES256-SHA ECDHE-RSA-AES256-SHA384 AES256-GCM-SHA384 AES256-SHA AES256-SHA256
67 http/1.1: ECDHE-RSA-AES128-GCM-SHA256 ECDHE-RSA-AES128-SHA AES128-GCM-SHA256 AES128-SHA AES128-SHA256 DES-CBC3-SHA ECDHE-RSA-AES256-GCM-SHA384 ECDHE-RSA-AES128-SHA256 ECDHE-RSA-AES256-SHA ECDHE-RSA-AES256-SHA384 AES256-GCM-SHA384 AES256-SHA AES256-SHA256
68
69 --> Testing server defaults (Server Hello)
70
71 TLS server extensions renegotiation info, server name, session ticket, EC point formats
72 Session Tickets RFC 5077 100800 seconds
73 Server key size EC 256 bit
74 Signature Algorithm SHA256 with RSA
75 Fingerprint / Serial SHA1 049885477BEE6012283FD4D777ABF7046D778FC5 / 1144F32C0739F308
76 SHA256 C59D84ACF5B829712E72A543A2B8DA3BB38BB7877B8B349761508C9C7D7B4C73
77 Common Name (CN) mail.google.com (works w/o SNI)
78 subjectAltName (SAN) mail.google.com inbox.google.com
79 Issuer Google Internet Authority G2 (Google Inc from US)
80 EV cert (experimental) no
81 Certificate Expiration >= 60 days (2016-07-13 09:26 --> 2016-10-05 09:17 -0400)
82 # of certificates provided 3
83 Certificate Revocation List http://pki.google.com/GIAG2.crl
84 OCSP URI http://clients1.google.com/ocsp
85 OCSP stapling not offered
86 TLS clock skew +2 sec from localtime
87
88
89 --> Testing HTTP header response @ "/"
90
91 HTTP Status Code 301 Moved Permanently, redirecting to "/mail/"
92 HTTP clock skew +1 sec from localtime
93 Strict Transport Security --
94 Public Key Pinning --
95 Server banner GSE
96 Application banner --
97 Cookie(s) (none issued at "/")
98 Security headers X-Frame-Options: SAMEORIGIN
99 X-XSS-Protection: 1; mode=block
100 X-Content-Type-Options: nosniff
101 Reverse Proxy banner --
102
103
104 --> Testing vulnerabilities
105
106 Heartbleed (CVE-2014-0160) not vulnerable (OK)
107 CCS (CVE-2014-0224) not vulnerable (OK)
108 Secure Renegotiation (CVE-2009-3555) not vulnerable (OK)
109 Secure Client-Initiated Renegotiation not vulnerable (OK)
110 CRIME, TLS (CVE-2012-4929) Local problem: /usr/bin/openssl lacks zlib support
111 BREACH (CVE-2013-3587) NOT ok: uses gzip HTTP compression (only "/" tested)
112 POODLE, SSL (CVE-2014-3566) not vulnerable (OK)
113 TLS_FALLBACK_SCSV (RFC 7507), experim. Downgrade attack prevention supported (OK)
114 FREAK (CVE-2015-0204) Local problem: /usr/bin/openssl doesn't have any EXPORT RSA ciphers configured
115 LOGJAM (CVE-2015-4000), experimental Local problem: /usr/bin/openssl doesn't have any DHE EXPORT ciphers configured
116 BEAST (CVE-2011-3389) TLS1: DES-CBC3-SHA
117 -- but also supports higher protocols (possible mitigation): TLSv1.1 TLSv1.2
118 RC4 (CVE-2013-2566, CVE-2015-2808) no RC4 ciphers detected (OK)
119
120
121 --> Testing all locally available 124 ciphers against the server, ordered by encryption strength
122
123 Hexcode Cipher Suite Name (OpenSSL) KeyExch. Encryption Bits
124 -------------------------------------------------------------------------
125 xc030 ECDHE-RSA-AES256-GCM-SHA384 ECDH 256 AESGCM 256
126 xc02c ECDHE-ECDSA-AES256-GCM-SHA384 ECDH 256 AESGCM 256
127 xc028 ECDHE-RSA-AES256-SHA384 ECDH 256 AES 256
128 xc024 ECDHE-ECDSA-AES256-SHA384 ECDH 256 AES 256
129 xc014 ECDHE-RSA-AES256-SHA ECDH 256 AES 256
130 xc00a ECDHE-ECDSA-AES256-SHA ECDH 256 AES 256
131 x9d AES256-GCM-SHA384 RSA AESGCM 256
132 x3d AES256-SHA256 RSA AES 256
133 x35 AES256-SHA RSA AES 256
134 xc02f ECDHE-RSA-AES128-GCM-SHA256 ECDH 256 AESGCM 128
135 xc02b ECDHE-ECDSA-AES128-GCM-SHA256 ECDH 256 AESGCM 128
136 xc027 ECDHE-RSA-AES128-SHA256 ECDH 256 AES 128
137 xc023 ECDHE-ECDSA-AES128-SHA256 ECDH 256 AES 128
138 xc013 ECDHE-RSA-AES128-SHA ECDH 256 AES 128
139 xc009 ECDHE-ECDSA-AES128-SHA ECDH 256 AES 128
140 x9c AES128-GCM-SHA256 RSA AESGCM 128
141 x3c AES128-SHA256 RSA AES 128
142 x2f AES128-SHA RSA AES 128
143 x0a DES-CBC3-SHA RSA 3DES 168
144
145
146 Done now (2016-07-26 10:22) ---> 172.217.20.37:443 (mail.google.com) <---