diff --git a/CHANGELOG.md b/CHANGELOG.md index 02f5301..c199921 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,8 +4,9 @@ ### Features implemented / improvements in 3.3dev * QUIC protocol check -* bump SSLlabs rating guide to 2009r +* Bump SSLlabs rating guide to 2009r * Check for Opossum vulnerability +* Enable IPv6 automagically, i.e. if target via IPv6 is reachable just (also) scan it ### Features implemented / improvements in 3.2 diff --git a/doc/testssl.1 b/doc/testssl.1 index 3d23674..21068b1 100644 --- a/doc/testssl.1 +++ b/doc/testssl.1 @@ -1,16 +1,34 @@ -.\" Automatically generated by Pandoc 3.1.11.1 +.\" Automatically generated by Pandoc 2.17.1.1 .\" +.\" Define V font for inline verbatim, using C font in formats +.\" that render this, and otherwise B font. +.ie "\f[CB]x\f[]"x" \{\ +. ftr V B +. ftr VI BI +. ftr VB B +. ftr VBI BI +.\} +.el \{\ +. ftr V CR +. ftr VI CI +. ftr VB CB +. ftr VBI CBI +.\} .TH "" "" "" "" "" +.hy .SS NAME +.PP testssl.sh \[en] check encryption of SSL/TLS servers .SS SYNOPSIS -\f[CR]testssl.sh [OPTIONS] \f[R], -\f[CR]testssl.sh [OPTIONS] \-\-file \f[R] +.PP +\f[V]testssl.sh [OPTIONS] \f[R], +\f[V]testssl.sh [OPTIONS] --file \f[R] .PP or .PP -\f[CR]testssl.sh [BANNER OPTIONS]\f[R] +\f[V]testssl.sh [BANNER OPTIONS]\f[R] .SS DESCRIPTION +.PP testssl.sh is a free command line tool which checks a server\[cq]s service on any port for the support of TLS/SSL ciphers, protocols as well as cryptographic flaws and much more. @@ -28,10 +46,11 @@ Except DNS lookups or unless you instruct testssl.sh to check for revocation of certificates it doesn\[cq]t use any other hosts or even third parties for any test. .SS REQUIREMENTS -Testssl.sh is out of the box portable: it runs under any Unix\-like +.PP +Testssl.sh is out of the box portable: it runs under any Unix-like stack: Linux, *BSD, MacOS X, WSL=Windows Subsystem for Linux, Cygwin and MSYS2. -\f[CR]bash\f[R] is a prerequisite, also version 3 is still supported. +\f[V]bash\f[R] is a prerequisite, also version 3 is still supported. Standard utilities like awk, sed, tr and head are also needed. This can be of a BSD, System 5 or GNU flavor whereas grep from System V is not yet supported. @@ -40,13 +59,14 @@ Any OpenSSL or LibreSSL version is needed as a helper. Unlike previous versions of testssl.sh almost every check is done via (TCP) sockets. In addition statically linked OpenSSL binaries for major operating -systems are supplied in \f[CR]./bin/\f[R]. +systems are supplied in \f[V]./bin/\f[R]. .SS GENERAL -\f[CR]testssl.sh URI\f[R] as the default invocation does the so\-called +.PP +\f[V]testssl.sh URI\f[R] as the default invocation does the so-called default run which does a number of checks and puts out the results colorized (ANSI and termcap) on the screen. -It does every check listed below except \f[CR]\-E\f[R] which are (order -of appearance): +It does every check listed below except \f[V]-E\f[R] which are (order of +appearance): .IP " 0)" 4 displays a banner (see below), does a DNS lookup also for further IP addresses and does for the returned IP address a reverse lookup. @@ -63,7 +83,7 @@ forward secrecy: ciphers and elliptical curves server defaults (certificate info, TLS extensions, session information) .IP " 6)" 4 HTTP header (if HTTP detected or being forced via -\f[CR]\-\-assume\-http\f[R]) +\f[V]--assume-http\f[R]) .IP " 7)" 4 vulnerabilities .IP " 8)" 4 @@ -72,83 +92,95 @@ testing each of 370 preconfigured ciphers client simulation .IP "10)" 4 rating +.PP +If a target FQDN has multiple IPv4 and/or multiple IPv6 addresses, it +scans all IPs with the specified options or using the default run - +unless specified otherwise, see \f[V]--ip\f[R], \f[V]-4\f[R] and +\f[V]-6\f[R]. +IPv6 connectivity is automagically checked. +If there\[cq]s noch such thing you will see a banner \f[I]Testing all +\f[BI]IPv4\f[I] addresses\f[R] and all IPv6 addresses will appear in +round brackets. .SS OPTIONS AND PARAMETERS +.PP Options are either short or long options. Any long or short option requiring a value can be called with or without an equal sign. E.g. -\f[CR]testssl.sh \-t=smtp \-\-wide \-\-openssl=/usr/bin/openssl \f[R] +\f[V]testssl.sh -t=smtp --wide --openssl=/usr/bin/openssl \f[R] (short options with equal sign) is equivalent to -\f[CR]testssl.sh \-\-starttls smtp \-\-wide \-\-openssl /usr/bin/openssl \f[R] +\f[V]testssl.sh --starttls smtp --wide --openssl /usr/bin/openssl \f[R] (long option without equal sign). Some command line options can also be preset via ENV variables. -\f[CR]WIDE=true OPENSSL=/usr/bin/openssl testssl.sh \-\-starttls=smtp \f[R] +\f[V]WIDE=true OPENSSL=/usr/bin/openssl testssl.sh --starttls=smtp \f[R] would be the equivalent to the aforementioned examples. Preference has the command line over any environment variables. .PP -\f[CR]\f[R] or \f[CR]\-\-file \f[R] always needs to be the -last parameter. +\f[V]\f[R] or \f[V]--file \f[R] always needs to be the last +parameter. .SS BANNER OPTIONS (standalone) -\f[CR]\-\-help\f[R] (or no arg) displays command line help .PP -\f[CR]\-b, \-\-banner\f[R] displays testssl.sh banner, including -license, usage conditions, version of testssl.sh, detected openssl -version, its path to it, # of ciphers of openssl, its build date and the +\f[V]--help\f[R] (or no arg) displays command line help +.PP +\f[V]-b, --banner\f[R] displays testssl.sh banner, including license, +usage conditions, version of testssl.sh, detected openssl version, its +path to it, # of ciphers of openssl, its build date and the architecture. .PP -\f[CR]\-v, \-\-version\f[R] same as before +\f[V]-v, --version\f[R] same as before .PP -\f[CR]\-V [pattern], \-\-local [pattern]\f[R] pretty print all local -ciphers supported by openssl version. +\f[V]-V [pattern], --local [pattern]\f[R] pretty print all local ciphers +supported by openssl version. If a pattern is supplied it performs a match (ignore case) on any of the strings supplied in the wide output, see below. The pattern will be searched in the any of the columns: hexcode, cipher suite name (OpenSSL or IANA), key exchange, encryption, bits. -It does a word pattern match for non\-numbers, for number just a normal +It does a word pattern match for non-numbers, for number just a normal match applies. -Numbers here are defined as [0\-9,A\-F]. +Numbers here are defined as [0-9,A-F]. This means (attention: catch) that the pattern CBC is matched as -non\-word, but AES as word. -This option also accepts \f[CR]\-\-openssl=\f[R]. +non-word, but AES as word. +This option also accepts \f[V]--openssl=\f[R]. .SS INPUT PARAMETERS -\f[CR]URI\f[R] can be a hostname, an IPv4 or IPv6 address (restriction +.PP +\f[V]URI\f[R] can be a hostname, an IPv4 or IPv6 address (restriction see below) or an URL. IPv6 addresses need to be in square brackets. For any given parameter port 443 is assumed unless specified by appending a colon and a port number. -The only preceding protocol specifier allowed is \f[CR]https\f[R]. +The only preceding protocol specifier allowed is \f[V]https\f[R]. You need to be aware that checks for an IP address might not hit the vhost you want. DNS resolution (A/AAAA record) is being performed unless you have an -\f[CR]/etc/hosts\f[R] entry for the hostname. +\f[V]/etc/hosts\f[R] entry for the hostname. .PP -\f[CR]\-\-file \f[R] or the equivalent \f[CR]\-iL \f[R] -are mass testing options. -Per default it implicitly turns on \f[CR]\-\-warnings batch\f[R], unless +\f[V]--file \f[R] or the equivalent \f[V]-iL \f[R] are +mass testing options. +Per default it implicitly turns on \f[V]--warnings batch\f[R], unless warnings has been set to off before. In its first incarnation the mass testing option reads command lines -from \f[CR]fname\f[R]. -\f[CR]fname\f[R] consists of command lines of testssl, one line per +from \f[V]fname\f[R]. +\f[V]fname\f[R] consists of command lines of testssl, one line per instance. -Comments after \f[CR]#\f[R] are ignored, \f[CR]EOF\f[R] signals the end -of fname any subsequent lines will be ignored too. +Comments after \f[V]#\f[R] are ignored, \f[V]EOF\f[R] signals the end of +fname any subsequent lines will be ignored too. You can also supply additional options which will be inherited to each child, e.g.\ When invoking -\f[CR]testssl.sh \-\-wide \-\-log \-\-file \f[R] . -Each single line in \f[CR]fname\f[R] is parsed upon execution. +\f[V]testssl.sh --wide --log --file \f[R] . +Each single line in \f[V]fname\f[R] is parsed upon execution. If there\[cq]s a conflicting option and serial mass testing option is being performed the check will be aborted at the time it occurs and depending on the output option potentially leaving you with an output file without footer. In parallel mode the mileage varies, likely a line won\[cq]t be scanned. .PP -Alternatively \f[CR]fname\f[R] can be in \f[CR]nmap\f[R]\[cq]s -grep(p)able output format (\f[CR]\-oG\f[R]). +Alternatively \f[V]fname\f[R] can be in \f[V]nmap\f[R]\[cq]s grep(p)able +output format (\f[V]-oG\f[R]). Only open ports will be considered. Multiple ports per line are allowed. The ports can be different and will be tested by testssl.sh according to common practice in the internet, i.e.\ if nmap shows in its output an -open port 25, automatically \f[CR]\-t smtp\f[R] will be added before the +open port 25, automatically \f[V]-t smtp\f[R] will be added before the URI whereas port 465 will be treated as a plain TLS/SSL port, not requiring an STARTTLS SMTP handshake upfront. This is done by an internal table which correlates nmap\[cq]s open port @@ -167,127 +199,127 @@ results. A typical internal conversion to testssl.sh file format from nmap\[cq]s grep(p)able format could look like: .IP -.EX +.nf +\f[C] 10.10.12.16:443 10.10.12.16:1443 - \-t smtp host.example.com:25 + -t smtp host.example.com:25 host.example.com:443 host.example.com:631 - \-t ftp 10.10.12.11:21 + -t ftp 10.10.12.11:21 10.10.12.11:8443 -.EE +\f[R] +.fi .PP -Please note that \f[CR]fname\f[R] has to be in Unix format. +Please note that \f[V]fname\f[R] has to be in Unix format. DOS carriage returns won\[cq]t be accepted. Instead of the command line switch the environment variable FNAME will be honored too. .PP -\f[CR]\-\-mode \f[R]. +\f[V]--mode \f[R]. Mass testing to be done serial (default) or parallel -(\f[CR]\-\-parallel\f[R] is shortcut for the latter, -\f[CR]\-\-serial\f[R] is the opposite option). +(\f[V]--parallel\f[R] is shortcut for the latter, \f[V]--serial\f[R] is +the opposite option). Per default mass testing is being run in serial mode, i.e.\ one line after the other is processed and invoked. -The variable \f[CR]MASS_TESTING_MODE\f[R] can be defined to be either -equal \f[CR]serial\f[R] or \f[CR]parallel\f[R]. +The variable \f[V]MASS_TESTING_MODE\f[R] can be defined to be either +equal \f[V]serial\f[R] or \f[V]parallel\f[R]. .PP -\f[CR]\-\-warnings \f[R]. +\f[V]--warnings \f[R]. The warnings parameter determines how testssl.sh will deal with situations where user input normally will be necessary. There are two options. -\f[CR]batch\f[R] doesn\[cq]t wait for a confirming keypress when a -client\- or server\-side problem is encountered. +\f[V]batch\f[R] doesn\[cq]t wait for a confirming keypress when a +client- or server-side problem is encountered. As of 3.0 it just then terminates the particular scan. -This is automatically chosen for mass testing (\f[CR]\-\-file\f[R]). -\f[CR]off\f[R] just skips the warning, the confirmation but continues -the scan, independent whether it makes sense or not. +This is automatically chosen for mass testing (\f[V]--file\f[R]). +\f[V]off\f[R] just skips the warning, the confirmation but continues the +scan, independent whether it makes sense or not. Please note that there are conflicts where testssl.sh will still ask for confirmation which are the ones which otherwise would have a drastic impact on the results. Almost any other decision will be made in the future as a best guess by testssl.sh. The same can be achieved by setting the environment variable -\f[CR]WARNINGS\f[R]. +\f[V]WARNINGS\f[R]. .PP -\f[CR]\-\-connect\-timeout \f[R] This is useful for socket TCP +\f[V]--socket-timeout \f[R] This is useful for socket TCP connections to a node. If the node does not complete a TCP handshake (e.g.\ because it is down or behind a firewall or there\[cq]s an IDS or a tarpit) testssl.sh may usually hang for around 2 minutes or even much more. -This parameter instructs testssl.sh to wait at most \f[CR]seconds\f[R] +This parameter instructs testssl.sh to wait at most \f[V]seconds\f[R] for the handshake to complete before giving up. This option only works if your OS has a timeout binary installed. -CONNECT_TIMEOUT is the corresponding environment variable. +SOCKET_TIMEOUT is the corresponding environment variable. +This doesn\[cq]t work on Macs out of the box. .PP -\f[CR]\-\-openssl\-timeout \f[R] This is especially useful for -all connects using openssl and practically useful for mass testing. +\f[V]--openssl-timeout \f[R] This is especially useful for all +connects using openssl and practically useful for mass testing. It avoids the openssl connect to hang for \[ti]2 minutes. -The expected parameter \f[CR]seconds\f[R] instructs testssl.sh to wait +The expected parameter \f[V]seconds\f[R] instructs testssl.sh to wait before the openssl connect will be terminated. The option is only available if your OS has a timeout binary installed. -As there are different implementations of \f[CR]timeout\f[R]: It +As there are different implementations of \f[V]timeout\f[R]: It automatically calls the binary with the right parameters. OPENSSL_TIMEOUT is the equivalent environment variable. +This doesn\[cq]t work on Macs out of the box. .PP -\f[CR]\-\-basicauth \f[R] This can be set to provide HTTP -basic auth credentials which are used during checks for security -headers. +\f[V]--basicauth \f[R] This can be set to provide HTTP basic +auth credentials which are used during checks for security headers. BASICAUTH is the ENV variable you can use instead. .PP -\f[CR]\-\-reqheader
\f[R] This can be used to add additional -HTTP request headers in the correct format -\f[CR]Headername: headercontent\f[R]. +\f[V]--reqheader
\f[R] This can be used to add additional HTTP +request headers in the correct format +\f[V]Headername: headercontent\f[R]. This parameter can be called multiple times if required. For example: -\f[CR]\-\-reqheader \[aq]Proxy\-Authorization: Basic dGVzdHNzbDpydWxlcw==\[aq] \-\-reqheader \[aq]ClientID: 0xDEADBEAF\[aq]\f[R]. +\f[V]--reqheader \[aq]Proxy-Authorization: Basic dGVzdHNzbDpydWxlcw==\[aq] --reqheader \[aq]ClientID: 0xDEADBEAF\[aq]\f[R]. REQHEADER is the corresponding environment variable. .PP -\f[CR]\-\-mtls \f[R] This can be set to provide a -file containing a client certificatete and a private key (not encrypted) -in PEM format, which is used when a mutual TLS authentication is -required by the remote server. +\f[V]--mtls \f[R] This can be set to provide a file +containing a client certificatete and a private key (not encrypted) in +PEM format, which is used when a mutual TLS authentication is required +by the remote server. MTLS is the equivalent environment variable. .SS SPECIAL INVOCATIONS -\f[CR]\-t , \-\-starttls \f[R] does a default run -against a STARTTLS enabled \f[CR]protocol\f[R]. -\f[CR]protocol\f[R] must be one of \f[CR]ftp\f[R], \f[CR]smtp\f[R], -\f[CR]pop3\f[R], \f[CR]imap\f[R], \f[CR]xmpp\f[R], \f[CR]sieve\f[R], -\f[CR]xmpp\-server\f[R], \f[CR]telnet\f[R], \f[CR]ldap\f[R], -\f[CR]irc\f[R], \f[CR]lmtp\f[R], \f[CR]nntp\f[R], \f[CR]postgres\f[R], -\f[CR]mysql\f[R]. +.PP +\f[V]-t , --starttls \f[R] does a default run +against a STARTTLS enabled \f[V]protocol\f[R]. +\f[V]protocol\f[R] must be one of \f[V]ftp\f[R], \f[V]smtp\f[R], +\f[V]pop3\f[R], \f[V]imap\f[R], \f[V]xmpp\f[R], \f[V]sieve\f[R], +\f[V]xmpp-server\f[R], \f[V]telnet\f[R], \f[V]ldap\f[R], \f[V]irc\f[R], +\f[V]lmtp\f[R], \f[V]nntp\f[R], \f[V]postgres\f[R], \f[V]mysql\f[R]. For the latter four you need e.g.\ the supplied OpenSSL or OpenSSL version 1.1.1. Please note: MongoDB doesn\[cq]t offer a STARTTLS connection, IRC -currently only works with \f[CR]\-\-ssl\-native\f[R]. -\f[CR]irc\f[R] is WIP. +currently only works with \f[V]--ssl-native\f[R]. +\f[V]irc\f[R] is WIP. .PP -\f[CR]\-\-xmpphost \f[R] is an additional option for +\f[V]--xmpphost \f[R] is an additional option for STARTTLS enabled XMPP: It expects the jabber domain as a parameter. This is only needed if the domain is different from the URI supplied. .PP -\f[CR]\-\-mx \f[R] tests all MX records (STARTTLS on port -25) from high to low priority, one after the other. +\f[V]--mx \f[R] tests all MX records (STARTTLS on port 25) +from high to low priority, one after the other. .PP -\f[CR]\-\-ip \f[R] tests either the supplied IPv4 or IPv6 address -instead of resolving host(s) in \f[CR]\f[R]. +\f[V]--ip \f[R] tests either the supplied IPv4 or IPv6 address +instead of resolving host(s) in \f[V]\f[R]. IPv6 addresses need to be supplied in square brackets. -\f[CR]\-\-ip=one\f[R] means: just test the first A record DNS returns +\f[V]--ip=one\f[R] means: just test the first A record DNS returns (useful for multiple IPs). -If \f[CR]\-6\f[R] and \f[CR]\-\-ip=one\f[R] was supplied an AAAA record -will be picked if available. -The \f[CR]\-\-ip\f[R] option might be also useful if you want to resolve +If \f[V]-6\f[R] and \f[V]--ip=one\f[R] was supplied an AAAA record will +be picked if available. +The \f[V]--ip\f[R] option might be also useful if you want to resolve the supplied hostname to a different IP, similar as if you would edit -\f[CR]/etc/hosts\f[R] or -\f[CR]/c/Windows/System32/drivers/etc/hosts\f[R]. -\f[CR]\-\-ip=proxy\f[R] tries a DNS resolution via proxy. -\f[CR]\-\-ip=proxy\f[R] plus \f[CR]\-\-nodns=min\f[R] is useful for -situations with no local DNS as there\[cq]ll be no DNS timeouts when -trying to resolve CAA, TXT and MX records. +\f[V]/etc/hosts\f[R] or \f[V]/c/Windows/System32/drivers/etc/hosts\f[R]. +\f[V]--ip=proxy\f[R] tries a DNS resolution via proxy. +\f[V]--ip=proxy\f[R] plus \f[V]--nodns=min\f[R] is useful for situations +with no local DNS as there\[cq]ll be no DNS timeouts when trying to +resolve CAA, TXT and MX records. .PP -\f[CR]\-\-proxy :\f[R] does ANY check via the specified -proxy. -\f[CR]\-\-proxy=auto\f[R] inherits the proxy setting from the -environment. +\f[V]--proxy :\f[R] does ANY check via the specified proxy. +\f[V]--proxy=auto\f[R] inherits the proxy setting from the environment. Any hostname supplied will be resolved to the first A record, if it does not exist the AAAA record is used. IPv4 and IPv6 addresses can be passed too, the latter \f[I]also\f[R] @@ -295,32 +327,30 @@ with square bracket notation. Please note that you need a newer OpenSSL or LibreSSL version for IPv6 proxy functionality. In addition if you want lookups via proxy you can specify -\f[CR]DNS_VIA_PROXY=true\f[R]. -OCSP revocation checking (\f[CR]\-S \-\-phone\-out\f[R]) is not -supported by OpenSSL via proxy. +\f[V]DNS_VIA_PROXY=true\f[R]. +OCSP revocation checking (\f[V]-S --phone-out\f[R]) is not supported by +OpenSSL via proxy. As supplying a proxy is an indicator for port 80 and 443 outgoing being blocked in your network an OCSP revocation check won\[cq]t be performed. -However if \f[CR]IGN_OCSP_PROXY=true\f[R] has been supplied it will be +However if \f[V]IGN_OCSP_PROXY=true\f[R] has been supplied it will be tried directly. Authentication to the proxy is not supported, also no HTTPS or SOCKS proxy. .PP -\f[CR]\-6\f[R] does (also) IPv6 checks. -Please note that testssl.sh doesn\[cq]t perform checks on an IPv6 -address automatically, because of two reasons: testssl.sh does no -connectivity checks for IPv6 and it cannot determine reliably whether -the OpenSSL binary you\[cq]re using has IPv6 s_client support. -\f[CR]\-6\f[R] assumes both is the case. -If both conditions are met and you in general prefer to test for IPv6 -branches as well you can add \f[CR]HAS_IPv6\f[R] to your shell -environment. +\f[V]-6\f[R] scans only IPv6 addresses of the target. Besides the OpenSSL binary supplied IPv6 is known to work with vanilla OpenSSL >= 1.1.0 and older versions >=1.0.2 in RHEL/CentOS/FC and Gentoo. +Scans are somewhat in line with tools like curl or wget, i.e.\ if +there\[cq]s an IPv6 address of the target which can be reached, it just +uses them. +If you don\[cq]t want this behavior, you need to supply \f[V]-4.\f[R] .PP -\f[CR]\-\-ssl\-native\f[R] Instead of using a mixture of bash sockets -and a few openssl s_client connects, testssl.sh uses the latter (almost) -only. +\f[V]-4\f[R] scans only IPv4 addresses of the target, IPv6 addresses of +the target won\[cq]t be scanned. +.PP +\f[V]--ssl-native\f[R] Instead of using a mixture of bash sockets and a +few openssl s_client connects, testssl.sh uses the latter (almost) only. This is faster but provides less accurate results, especially for the client simulation and for cipher support. For all checks you will see a warning if testssl.sh cannot tell if a @@ -332,14 +362,14 @@ It should only be used if you prefer speed over accuracy or you know that your target has sufficient overlap with the protocols and cipher provided by your openssl binary. .PP -\f[CR]\-\-openssl \f[R] testssl.sh tries first very -hard to find the binary supplied (where the tree of testssl.sh resides, -from the directory where testssl.sh has been started from, etc.). +\f[V]--openssl \f[R] testssl.sh tries first very hard +to find the binary supplied (where the tree of testssl.sh resides, from +the directory where testssl.sh has been started from, etc.). If all that doesn\[cq]t work it falls back to openssl supplied from the -OS (\f[CR]$PATH\f[R]). +OS (\f[V]$PATH\f[R]). With this option you can point testssl.sh to your binary of choice and override any internal magic to find the openssl binary. -(Environment preset via \f[CR]OPENSSL=\f[R]). +(Environment preset via \f[V]OPENSSL=\f[R]). Depending on your test parameters it could be faster to pick the OpenSSL version which has a bigger overlap in terms of ciphers protocols with the target. @@ -347,15 +377,16 @@ Also, when testing a modern server, OpenSSL 3.X is faster than older OpenSSL versions, or on MacOS 18, as opposed to the provided LibreSSL version. .SS TUNING OPTIONS -\f[CR]\-\-bugs\f[R] does some workarounds for buggy servers like padding +.PP +\f[V]--bugs\f[R] does some workarounds for buggy servers like padding for old F5 devices. -The option is passed as \f[CR]\-bug\f[R] to openssl when needed, see -\f[CR]s_client(1)\f[R], environment preset via -\f[CR]BUGS=\[dq]\-bugs\[dq]\f[R] (1x dash). +The option is passed as \f[V]-bug\f[R] to openssl when needed, see +\f[V]s_client(1)\f[R], environment preset via +\f[V]BUGS=\[dq]-bugs\[dq]\f[R] (1x dash). For the socket part testssl.sh has always workarounds in place to cope with broken server implementations. .PP -\f[CR]\-\-assuming\-http\f[R] testssl.sh normally does upfront an +\f[V]--assuming-http\f[R] testssl.sh normally does upfront an application protocol detection. In cases where HTTP cannot be automatically detected you may want to use this option. @@ -366,37 +397,37 @@ protocol, e.g.\ SHA1 signed certificates, the lack of any SAN matches and some vulnerabilities will be punished harder when checking a web server as opposed to a mail server. .PP -\f[CR]\-n, \-\-nodns \f[R] tells testssl.sh which DNS lookups +\f[V]-n, --nodns \f[R] tells testssl.sh which DNS lookups should be performed. -\f[CR]min\f[R] uses only forward DNS resolution (A and AAAA record or MX +\f[V]min\f[R] uses only forward DNS resolution (A and AAAA record or MX record) and skips CAA lookups and PTR records from the IP address back to a DNS name. -\f[CR]none\f[R] performs no DNS lookups at all. +\f[V]none\f[R] performs no DNS lookups at all. For the latter you either have to supply the IP address as a target, to -use \f[CR]\-\-ip\f[R] or have the IP address in \f[CR]/etc/hosts\f[R]. +use \f[V]--ip\f[R] or have the IP address in \f[V]/etc/hosts\f[R]. The use of the switch is only useful if you either can\[cq]t or are not willing to perform DNS lookups. The latter can apply e.g.\ to some pentests. In general this option could e.g.\ help you to avoid timeouts by DNS lookups. -\f[CR]NODNS\f[R] is the environment variable for this. -\f[CR]\-\-nodns=min\f[R] plus \f[CR]\-\-ip=proxy\f[R] is useful for -situations with no local DNS as there\[cq]ll be no DNS timeouts when -trying to resolve CAA, TXT and MX records. +\f[V]NODNS\f[R] is the environment variable for this. +\f[V]--nodns=min\f[R] plus \f[V]--ip=proxy\f[R] is useful for situations +with no local DNS as there\[cq]ll be no DNS timeouts when trying to +resolve CAA, TXT and MX records. .PP -\f[CR]\-\-sneaky\f[R] For HTTP header checks testssl.sh uses normally -the server friendly HTTP user agent \f[CR]TLS tester from ${URL}\f[R]. +\f[V]--sneaky\f[R] For HTTP header checks testssl.sh uses normally the +server friendly HTTP user agent \f[V]TLS tester from ${URL}\f[R]. With this option your traces are less verbose and a Firefox user agent is being used. Be aware that it doesn\[cq]t hide your activities. That is just not possible (environment preset via -\f[CR]SNEAKY=true\f[R]). +\f[V]SNEAKY=true\f[R]). .PP -\f[CR]\-\-user\-agent \f[R] tells testssl.sh to use the -supplied HTTP user agent instead of the standard user agent -\f[CR]TLS tester from ${URL}\f[R]. +\f[V]--user-agent \f[R] tells testssl.sh to use the supplied +HTTP user agent instead of the standard user agent +\f[V]TLS tester from ${URL}\f[R]. .PP -\f[CR]\-\-ids\-friendly\f[R] is a switch which may help to get a scan +\f[V]--ids-friendly\f[R] is a switch which may help to get a scan finished which otherwise would be blocked by a server side IDS. This switch skips tests for the following vulnerabilities: Heartbleed, CCS Injection, Ticketbleed and ROBOT. @@ -406,8 +437,8 @@ Please be advised that as an alternative or as a general approach you can try to apply evasion techniques by changing the variables USLEEP_SND and / or USLEEP_REC and maybe MAX_WAITSOCK. .PP -\f[CR]\-\-phone\-out\f[R] Checking for revoked certificates via CRL and -OCSP is not done per default. +\f[V]--phone-out\f[R] Checking for revoked certificates via CRL and OCSP +is not done per default. This switch instructs testssl.sh to query external \[en] in a sense of the current run \[en] URIs. By using this switch you acknowledge that the check might have privacy @@ -417,9 +448,9 @@ testssl.sh doesn\[cq]t handle. PHONE_OUT is the environment variable for this which needs to be set to true if you want this. .PP -\f[CR]\-\-add\-ca \f[R] enables you to add your own CA(s) in PEM +\f[V]--add-ca \f[R] enables you to add your own CA(s) in PEM format for trust chain checks. -\f[CR]CAfile\f[R] can be a directory containing files with a .pem +\f[V]CAfile\f[R] can be a directory containing files with a .pem extension, a single file or multiple files as a comma separated list of root CAs. Internally they will be added during runtime to all CA stores. @@ -427,62 +458,63 @@ This is (only) useful for internal hosts whose certificates are issued by internal CAs. Alternatively ADDTL_CA_FILES is the environment variable for this. .SS SINGLE CHECK OPTIONS +.PP Any single check switch supplied as an argument prevents testssl.sh from doing a default run. -It just takes this and if supplied other options and runs them \- in the +It just takes this and if supplied other options and runs them - in the order they would also appear in the default run. .PP -\f[CR]\-e, \-\-each\-cipher\f[R] checks each of the (currently -configured) 370 ciphers via openssl + sockets remotely on the server and -reports back the result in wide mode. +\f[V]-e, --each-cipher\f[R] checks each of the (currently configured) +370 ciphers via openssl + sockets remotely on the server and reports +back the result in wide mode. If you want to display each cipher tested you need to add -\f[CR]\-\-show\-each\f[R]. -Per default it lists the following parameters: \f[CR]hexcode\f[R], -\f[CR]OpenSSL cipher suite name\f[R], \f[CR]key exchange\f[R], -\f[CR]encryption bits\f[R], \f[CR]IANA/RFC cipher suite name\f[R]. -Please note the \f[CR]\-\-mapping\f[R] parameter changes what cipher -suite names you will see here and at which position. +\f[V]--show-each\f[R]. +Per default it lists the following parameters: \f[V]hexcode\f[R], +\f[V]OpenSSL cipher suite name\f[R], \f[V]key exchange\f[R], +\f[V]encryption bits\f[R], \f[V]IANA/RFC cipher suite name\f[R]. +Please note the \f[V]--mapping\f[R] parameter changes what cipher suite +names you will see here and at which position. Also please note that the \f[B]bit\f[R] length for the encryption is shown and not the \f[B]security\f[R] length, albeit it\[cq]ll be sorted by the latter. -For 3DES due to the Meet\-in\-the\-Middle problem the bit size of 168 -bits is equivalent to the security size of 112 bits. +For 3DES due to the Meet-in-the-Middle problem the bit size of 168 bits +is equivalent to the security size of 112 bits. .PP -\f[CR]\-E, \-\-cipher\-per\-proto\f[R] is similar to -\f[CR]\-e, \-\-each\-cipher\f[R]. +\f[V]-E, --cipher-per-proto\f[R] is similar to +\f[V]-e, --each-cipher\f[R]. It checks each of the possible ciphers, here: per protocol. If you want to display each cipher tested you need to add -\f[CR]\-\-show\-each\f[R]. +\f[V]--show-each\f[R]. The output is sorted by security strength, it lists the encryption bits though. .PP -\f[CR]\-s, \-\-std, \-\-categories\f[R] tests certain lists of cipher -suites / cipher categories by strength. -(\f[CR]\-\-standard\f[R] is deprecated.) -Those lists are (\f[CR]openssl ciphers $LIST\f[R], $LIST from below:) +\f[V]-s, --std, --categories\f[R] tests certain lists of cipher suites / +cipher categories by strength. +(\f[V]--standard\f[R] is deprecated.) +Those lists are (\f[V]openssl ciphers $LIST\f[R], $LIST from below:) .IP \[bu] 2 -\f[CR]NULL encryption ciphers\f[R]: `NULL:eNULL' +\f[V]NULL encryption ciphers\f[R]: `NULL:eNULL' .IP \[bu] 2 -\f[CR]Anonymous NULL ciphers\f[R]: `aNULL:ADH' +\f[V]Anonymous NULL ciphers\f[R]: `aNULL:ADH' .IP \[bu] 2 -\f[CR]Export ciphers\f[R] (w/o the preceding ones): `EXPORT:!ADH:!NULL' +\f[V]Export ciphers\f[R] (w/o the preceding ones): `EXPORT:!ADH:!NULL' .IP \[bu] 2 -\f[CR]LOW\f[R] (64 Bit + DES ciphers, without EXPORT ciphers): +\f[V]LOW\f[R] (64 Bit + DES ciphers, without EXPORT ciphers): `LOW:DES:RC2:RC4:MD5:!ADH:!EXP:!NULL:!eNULL:!AECDH' .IP \[bu] 2 -\f[CR]3DES + IDEA ciphers\f[R]: `3DES:IDEA:!aNULL:!ADH:!MD5' +\f[V]3DES + IDEA ciphers\f[R]: `3DES:IDEA:!aNULL:!ADH:!MD5' .IP \[bu] 2 -\f[CR]Obsoleted CBC ciphers\f[R]: +\f[V]Obsoleted CBC ciphers\f[R]: `HIGH:MEDIUM:AES:CAMELLIA:ARIA:!IDEA:!CHACHA20:!3DES:!RC2:!RC4:!AESCCM8:!AESCCM:!AESGCM:!ARIAGCM:!aNULL:!MD5' .IP \[bu] 2 -\f[CR]Strong ciphers with no FS\f[R] (AEAD): +\f[V]Strong ciphers with no FS\f[R] (AEAD): `AESGCM:CHACHA20:CamelliaGCM:AESCCM:ARIAGCM:!kEECDH:!kEDH:!kDHE:!kDHEPSK:!kECDHEPSK:!aNULL' .IP \[bu] 2 -\f[CR]Forward Secrecy strong ciphers\f[R] (AEAD): +\f[V]Forward Secrecy strong ciphers\f[R] (AEAD): `AESGCM:CHACHA20:CamelliaGCM:AESCCM:ARIAGCM:!kPSK:!kRSAPSK:!kRSA:!kDH:!kECDH:!aNULL' .PP -\f[CR]\-f, \-\-fs, \-\-nsa, \-\-forward\-secrecy\f[R] Checks robust -forward secrecy key exchange. +\f[V]-f, --fs, --nsa, --forward-secrecy\f[R] Checks robust forward +secrecy key exchange. \[lq]Robust\[rq] means that ciphers having intrinsic severe weaknesses like Null Authentication or Encryption, 3DES and RC4 won\[cq]t be considered here. @@ -492,28 +524,28 @@ encryption sucks. Also this section lists the available elliptical curves and Diffie Hellman groups, as well as FFDHE groups (TLS 1.2 and TLS 1.3). .PP -\f[CR]\-p, \-\-protocols\f[R] checks TLS/SSL protocols SSLv2, SSLv3, TLS -1.0 through TLS 1.3. +\f[V]-p, --protocols\f[R] checks TLS/SSL protocols SSLv2, SSLv3, TLS 1.0 +through TLS 1.3. And for HTTP also QUIC (HTTP/3), SPDY (NPN) and ALPN (HTTP/2). For TLS 1.3 the final version and several drafts (from 18 on) are tested. QUIC needs OpenSSL >= 3.2 which can be automatically picked up when in -\f[CR]/usr/bin/openssl\f[R] (or when defined environment variable +\f[V]/usr/bin/openssl\f[R] (or when defined environment variable OPENSSL2). -If a TLS\-1.3\-only host is encountered and the openssl\-bad version is +If a TLS-1.3-only host is encountered and the openssl-bad version is used testssl.sh will e.g.\ for HTTP header checks switch to -\f[CR]/usr/bin/openssl\f[R] (or when defined via ENV to OPENSSL2). +\f[V]/usr/bin/openssl\f[R] (or when defined via ENV to OPENSSL2). Also this will be tried for the QUIC check. .PP -\f[CR]\-P, \-\-server\-preference, \-\-preference\f[R] displays the -servers preferences: cipher order, with used openssl client: negotiated -protocol and cipher. +\f[V]-P, --server-preference, --preference\f[R] displays the servers +preferences: cipher order, with used openssl client: negotiated protocol +and cipher. If there\[cq]s a cipher order enforced by the server it displays it for each protocol (openssl+sockets). If there\[cq]s not, it displays instead which ciphers from the server were picked with each protocol. .PP -\f[CR]\-S, \-\-server_defaults\f[R] displays information from the server +\f[V]-S, --server_defaults\f[R] displays information from the server hello(s): .IP \[bu] 2 Available TLS extensions, @@ -548,9 +580,8 @@ validity: start + end time, how many days to go (warning for certificate lifetime >=5 years) .IP \[bu] 2 revocation info (CRL, OCSP, OCSP stapling + must staple). -When \f[CR]\-\-phone\-out\f[R] supplied it checks against the -certificate issuer whether the host certificate has been revoked (plain -OCSP, CRL). +When \f[V]--phone-out\f[R] supplied it checks against the certificate +issuer whether the host certificate has been revoked (plain OCSP, CRL). .IP \[bu] 2 displaying DNS Certification Authority Authorization resource record .IP \[bu] 2 @@ -559,31 +590,31 @@ Certificate Transparency info (if provided by server). .PP For the trust chain check 5 certificate stores are provided. If the test against one of the trust stores failed, the one is being -identified and the reason for the failure is displayed \- in addition -the ones which succeeded are displayed too. +identified and the reason for the failure is displayed - in addition the +ones which succeeded are displayed too. You can configure your own CA via ADDTL_CA_FILES, see section -\f[CR]FILES\f[R] below. +\f[V]FILES\f[R] below. If the server provides no matching record in Subject Alternative Name (SAN) but in Common Name (CN), it will be indicated as this is deprecated. Also for multiple server certificates are being checked for as well as -for the certificate reply to a non\-SNI (Server Name Indication) client +for the certificate reply to a non-SNI (Server Name Indication) client hello to the IP address. Regarding the TLS clock skew: it displays the time difference to the client. Only a few TLS stacks nowadays still support this and return the local -clock \f[CR]gmt_unix_time\f[R], e.g.\ IIS, openssl < 1.0.1f. +clock \f[V]gmt_unix_time\f[R], e.g.\ IIS, openssl < 1.0.1f. In addition to the HTTP date you could e.g.\ derive that there are different hosts where your TLS and your HTTP request ended \[en] if the time deltas differ significantly. .PP -\f[CR]\-x , \-\-single\-cipher \f[R] tests matched -\f[CR]pattern\f[R] of ciphers against a server. -Patterns are similar to \f[CR]\-V pattern , \-\-local pattern\f[R], see +\f[V]-x , --single-cipher \f[R] tests matched +\f[V]pattern\f[R] of ciphers against a server. +Patterns are similar to \f[V]-V pattern , --local pattern\f[R], see above about matching. .PP -\f[CR]\-h, \-\-header, \-\-headers\f[R] if the service is HTTP (either -by detection or by enforcing via \f[CR]\-\-assume\-http\f[R]. +\f[V]-h, --header, --headers\f[R] if the service is HTTP (either by +detection or by enforcing via \f[V]--assume-http\f[R]. It tests several HTTP headers like .IP \[bu] 2 HTTP Strict Transport Security (HSTS) @@ -606,197 +637,197 @@ IPv4 address in header .IP \[bu] 2 Cookie (including Secure/HTTPOnly flags) .IP \[bu] 2 -Decodes BIG IP F5 non\-encrypted cookies +Decodes BIG IP F5 non-encrypted cookies .IP \[bu] 2 -Security headers (X\-Frame\-Options, X\-XSS\-Protection, -Expect\-CT,\&... +Security headers (X-Frame-Options, X-XSS-Protection, Expect-CT,\&... , CSP headers). Nonsense is not yet detected here. .PP -\f[CR]\-c, \-\-client\-simulation\f[R] This simulates a handshake with a +\f[V]-c, --client-simulation\f[R] This simulates a handshake with a number of standard clients so that you can figure out which client cannot or can connect to your site. For the latter case the protocol, cipher and curve is displayed, also if there\[cq]s Forward Secrecy. testssl.sh uses a handselected set of clients which are retrieved by the SSLlabs API. -The output is aligned in columns when combined with the -\f[CR]\-\-wide\f[R] option. +The output is aligned in columns when combined with the \f[V]--wide\f[R] +option. If you want the full nine yards of clients displayed use the environment variable ALL_CLIENTS. .PP -\f[CR]\-g, \-\-grease\f[R] checks several server implementation bugs -like tolerance to size limitations and GREASE, see RFC 8701. +\f[V]-g, --grease\f[R] checks several server implementation bugs like +tolerance to size limitations and GREASE, see RFC 8701. This check doesn\[cq]t run per default. .SS VULNERABILITIES -\f[CR]\-U, \-\-vulnerable, \-\-vulnerabilities\f[R] Just tests all (of -the following) vulnerabilities. -The environment variable \f[CR]VULN_THRESHLD\f[R] determines after which +.PP +\f[V]-U, --vulnerable, --vulnerabilities\f[R] Just tests all (of the +following) vulnerabilities. +The environment variable \f[V]VULN_THRESHLD\f[R] determines after which value a separate headline for each vulnerability is being displayed. -Default is \f[CR]1\f[R] which means if you check for two -vulnerabilities, only the general headline for vulnerabilities section -is displayed \[en] in addition to the vulnerability and the result. +Default is \f[V]1\f[R] which means if you check for two vulnerabilities, +only the general headline for vulnerabilities section is displayed \[en] +in addition to the vulnerability and the result. Otherwise each vulnerability or vulnerability section gets its own headline in addition to the output of the name of the vulnerability and test result. A vulnerability section is comprised of more than one check, e.g.\ the renegotiation vulnerability check has two checks, so has Logjam. .PP -\f[CR]\-H, \-\-heartbleed\f[R] Checks for Heartbleed, a memory leakage -in openssl. +\f[V]-H, --heartbleed\f[R] Checks for Heartbleed, a memory leakage in +openssl. Unless the server side doesn\[cq]t support the heartbeat extension it is likely that this check runs into a timeout. The seconds to wait for a reply can be adjusted with -\f[CR]HEARTBLEED_MAX_WAITSOCK\f[R]. +\f[V]HEARTBLEED_MAX_WAITSOCK\f[R]. 8 is the default. .PP -\f[CR]\-I, \-\-ccs, \-\-ccs\-injection\f[R] Checks for CCS Injection -which is an openssl vulnerability. +\f[V]-I, --ccs, --ccs-injection\f[R] Checks for CCS Injection which is +an openssl vulnerability. Sometimes also here the check needs to wait for a reply. The predefined timeout of 5 seconds can be changed with the environment -variable \f[CR]CCS_MAX_WAITSOCK\f[R]. +variable \f[V]CCS_MAX_WAITSOCK\f[R]. .PP -\f[CR]\-T, \-\-ticketbleed\f[R] Checks for Ticketbleed memory leakage in +\f[V]-T, --ticketbleed\f[R] Checks for Ticketbleed memory leakage in BigIP loadbalancers. .PP -\f[CR]\-\-OP, \-\-opossum\f[R] Checks for HTTP to HTTPS upgrade -vulnerability named Opossum. +\f[V]--OP, --opossum\f[R] Checks for HTTP to HTTPS upgrade vulnerability +named Opossum. .PP -\f[CR]\-\-BB, \-\-robot\f[R] Checks for vulnerability to ROBOT / -(\f[I]Return Of Bleichenbacher\[cq]s Oracle Threat\f[R]) attack. +\f[V]--BB, --robot\f[R] Checks for vulnerability to ROBOT / (\f[I]Return +Of Bleichenbacher\[cq]s Oracle Threat\f[R]) attack. .PP -\f[CR]\-\-SI, \-\-starttls\-injection\f[R] Checks for STARTTLS injection +\f[V]--SI, --starttls-injection\f[R] Checks for STARTTLS injection vulnerabilities (SMTP, IMAP, POP3 only). -\f[CR]socat\f[R] and OpenSSL >=1.1.0 is needed. +\f[V]socat\f[R] and OpenSSL >=1.1.0 is needed. .PP -\f[CR]\-R, \-\-renegotiation\f[R] Tests renegotiation vulnerabilities. +\f[V]-R, --renegotiation\f[R] Tests renegotiation vulnerabilities. Currently there\[cq]s a check for \f[I]Secure Renegotiation\f[R] and for -\f[I]Secure Client\-Initiated Renegotiation\f[R]. +\f[I]Secure Client-Initiated Renegotiation\f[R]. Please be aware that vulnerable servers to the latter can likely be DoSed very easily (HTTP). -A check for \f[I]Insecure Client\-Initiated Renegotiation\f[R] is not -yet implemented. +A check for \f[I]Insecure Client-Initiated Renegotiation\f[R] is not yet +implemented. .PP -\f[CR]\-C, \-\-compression, \-\-crime\f[R] Checks for CRIME -(\f[I]Compression Ratio Info\-leak Made Easy\f[R]) vulnerability in TLS. +\f[V]-C, --compression, --crime\f[R] Checks for CRIME (\f[I]Compression +Ratio Info-leak Made Easy\f[R]) vulnerability in TLS. CRIME in SPDY is not yet being checked for. .PP -\f[CR]\-B, \-\-breach\f[R] Checks for BREACH (\f[I]Browser -Reconnaissance and Exfiltration via Adaptive Compression of -Hypertext\f[R]) vulnerability. +\f[V]-B, --breach\f[R] Checks for BREACH (\f[I]Browser Reconnaissance +and Exfiltration via Adaptive Compression of Hypertext\f[R]) +vulnerability. As for this vulnerability HTTP level compression is a prerequisite it\[cq]ll be not tested if HTTP cannot be detected or the detection is -not enforced via \f[CR]\-\-assume\-http\f[R]. +not enforced via \f[V]--assume-http\f[R]. Please note that only the URL supplied (normally \[lq]/\[rq] ) is being tested. .PP -\f[CR]\-O, \-\-poodle\f[R] Tests for SSL POODLE (\f[I]Padding Oracle On +\f[V]-O, --poodle\f[R] Tests for SSL POODLE (\f[I]Padding Oracle On Downgraded Legacy Encryption\f[R]) vulnerability. It basically checks for the existence of CBC ciphers in SSLv3. .PP -\f[CR]\-Z, \-\-tls\-fallback\f[R] Checks TLS_FALLBACK_SCSV mitigation. +\f[V]-Z, --tls-fallback\f[R] Checks TLS_FALLBACK_SCSV mitigation. TLS_FALLBACK_SCSV is basically a ciphersuite appended to the Client Hello trying to prevent protocol downgrade attacks by a Man in the Middle. .PP -\f[CR]\-W, \-\-sweet32\f[R] Checks for vulnerability to SWEET32 by -testing 64 bit block ciphers (3DES, RC2 and IDEA). +\f[V]-W, --sweet32\f[R] Checks for vulnerability to SWEET32 by testing +64 bit block ciphers (3DES, RC2 and IDEA). .PP -\f[CR]\-F, \-\-freak\f[R] Checks for FREAK vulnerability (\f[I]Factoring -RSA Export Keys\f[R]) by testing for EXPORT RSA ciphers +\f[V]-F, --freak\f[R] Checks for FREAK vulnerability (\f[I]Factoring RSA +Export Keys\f[R]) by testing for EXPORT RSA ciphers .PP -\f[CR]\-D, \-\-drown\f[R] Checks for DROWN vulnerability -(\f[I]Decrypting RSA with Obsolete and Weakened eNcryption\f[R]) by -checking whether the SSL 2 protocol is available at the target. +\f[V]-D, --drown\f[R] Checks for DROWN vulnerability (\f[I]Decrypting +RSA with Obsolete and Weakened eNcryption\f[R]) by checking whether the +SSL 2 protocol is available at the target. Please note that if you use the same RSA certificate elsewhere you might be vulnerable too. testssl.sh doesn\[cq]t check for this but provides a helpful link \[at] censys.io which provides this service. .PP -\f[CR]\-J, \-\-logjam\f[R] Checks for LOGJAM vulnerability by checking -for DH EXPORT ciphers. +\f[V]-J, --logjam\f[R] Checks for LOGJAM vulnerability by checking for +DH EXPORT ciphers. It also checks for \[lq]common primes\[rq] which are preconfigured DH keys. DH keys =< 1024 Bit will be penalized. Also FFDHE groups (TLS 1.2) will be displayed here. .PP -\f[CR]\-A, \-\-beast\f[R] Checks BEAST vulnerabilities in SSL 3 and TLS -1.0 by testing the usage of CBC ciphers. +\f[V]-A, --beast\f[R] Checks BEAST vulnerabilities in SSL 3 and TLS 1.0 +by testing the usage of CBC ciphers. .PP -\f[CR]\-L, \-\-lucky13\f[R] Checks for LUCKY13 vulnerability. -It checks for the presence of CBC ciphers in TLS versions 1.0 \- 1.2. +\f[V]-L, --lucky13\f[R] Checks for LUCKY13 vulnerability. +It checks for the presence of CBC ciphers in TLS versions 1.0 - 1.2. .PP -\f[CR]\-WS, \-\-winshock\f[R] Checks for Winshock vulnerability. +\f[V]-WS, --winshock\f[R] Checks for Winshock vulnerability. It tests for the absence of a lot of ciphers, some TLS extensions and ec curves which were introduced later in Windows. In the end the server banner is being looked at. .PP -\f[CR]\-4, \-\-rc4, \-\-appelbaum\f[R] Checks which RC4 stream ciphers -are being offered. +\f[V]--rc4, --appelbaum\f[R] Checks which RC4 stream ciphers are being +offered. .SS OUTPUT OPTIONS -\f[CR]\-q, \-\-quiet\f[R] Normally testssl.sh displays a banner on -stdout with several version information, usage rights and a warning. +.PP +\f[V]-q, --quiet\f[R] Normally testssl.sh displays a banner on stdout +with several version information, usage rights and a warning. This option suppresses it. Please note that by choosing this option you acknowledge usage terms and the warning normally appearing in the banner. .PP -\f[CR]\-\-wide\f[R] Except the \[lq]each cipher output\[rq] all tests +\f[V]--wide\f[R] Except the \[lq]each cipher output\[rq] all tests displays the single cipher name (scheme see below). This option enables testssl.sh to display also for the following sections the same output as for testing each ciphers: BEAST, FS, RC4. The client simulation has also a wide mode. The difference here is restricted to a column aligned output and a proper headline. -The environment variable \f[CR]WIDE\f[R] can be used instead. +The environment variable \f[V]WIDE\f[R] can be used instead. .PP -\f[CR]\-\-mapping \f[R] +\f[V]--mapping \f[R] .IP \[bu] 2 -\f[CR]openssl\f[R]: use the OpenSSL cipher suite name as the primary -name cipher suite name form (default), +\f[V]openssl\f[R]: use the OpenSSL cipher suite name as the primary name +cipher suite name form (default), .IP \[bu] 2 -\f[CR]iana\f[R]: use the IANA cipher suite name as the primary name +\f[V]iana\f[R]: use the IANA cipher suite name as the primary name cipher suite name form. .IP \[bu] 2 -\f[CR]no\-openssl\f[R]: don\[cq]t display the OpenSSL cipher suite name, +\f[V]no-openssl\f[R]: don\[cq]t display the OpenSSL cipher suite name, display IANA names only. .IP \[bu] 2 -\f[CR]no\-iana\f[R]: don\[cq]t display the IANA cipher suite name, -display OpenSSL names only. +\f[V]no-iana\f[R]: don\[cq]t display the IANA cipher suite name, display +OpenSSL names only. .PP -Please note that in testssl.sh 3.0 you can still use \f[CR]rfc\f[R] -instead of \f[CR]iana\f[R] and \f[CR]no\-rfc\f[R] instead of -\f[CR]no\-iana\f[R] but it\[cq]ll disappear after 3.0. +Please note that in testssl.sh 3.0 you can still use \f[V]rfc\f[R] +instead of \f[V]iana\f[R] and \f[V]no-rfc\f[R] instead of +\f[V]no-iana\f[R] but it\[cq]ll disappear after 3.0. .PP -\f[CR]\-\-show\-each\f[R] This is an option for all wide modes only: it +\f[V]--show-each\f[R] This is an option for all wide modes only: it displays all ciphers tested \[en] not only succeeded ones. -\f[CR]SHOW_EACH_C\f[R] is your friend if you prefer to set this via the +\f[V]SHOW_EACH_C\f[R] is your friend if you prefer to set this via the shell environment. .PP -\f[CR]\-\-color <0|1|2|3>\f[R] determines the use of colors on the -screen and in the log file: \f[CR]2\f[R] is the default and makes use of -ANSI and termcap escape codes on your terminal. -\f[CR]1\f[R] just uses non\-colored mark\-up like bold, italics, -underline, reverse. -\f[CR]0\f[R] means no mark\-up at all = no escape codes. +\f[V]--color <0|1|2|3>\f[R] determines the use of colors on the screen +and in the log file: \f[V]2\f[R] is the default and makes use of ANSI +and termcap escape codes on your terminal. +\f[V]1\f[R] just uses non-colored mark-up like bold, italics, underline, +reverse. +\f[V]0\f[R] means no mark-up at all = no escape codes. This is also what you want when you want a log file without any escape codes. -\f[CR]3\f[R] will color ciphers and EC according to an internal (not yet +\f[V]3\f[R] will color ciphers and EC according to an internal (not yet perfect) rating. -Setting the environment variable \f[CR]COLOR\f[R] to the value achieves +Setting the environment variable \f[V]COLOR\f[R] to the value achieves the same result. Please not that OpenBSD and early FreeBSD do not support italics. .PP -\f[CR]\-\-colorblind\f[R] Swaps green and blue colors in the output, so +\f[V]--colorblind\f[R] Swaps green and blue colors in the output, so that this percentage of folks (up to 8% of males, see https://en.wikipedia.org/wiki/Color_blindness) can distinguish those findings better. -\f[CR]COLORBLIND\f[R] is the according variable if you want to set this +\f[V]COLORBLIND\f[R] is the according variable if you want to set this in the environment. .PP -\f[CR]\-\-debug <0\-6>\f[R] This gives you additional output on the -screen (2\-6), only useful for debugging. -\f[CR]DEBUG\f[R] is the according environment variable which you can -use. +\f[V]--debug <0-6>\f[R] This gives you additional output on the screen +(2-6), only useful for debugging. +\f[V]DEBUG\f[R] is the according environment variable which you can use. There are six levels (0 is the default, thus it has no effect): .IP "1." 3 screen output normal but leaves useful debug output in @@ -815,19 +846,20 @@ display bytes received via sockets .IP "6." 3 whole 9 yards .PP -\f[CR]\-\-disable\-rating\f[R] disables rating. +\f[V]--disable-rating\f[R] disables rating. Rating automatically gets disabled, to not give a wrong or misleading grade, when not all required functions are executed (e.g when checking for a single vulnerabilities). .SS FILE OUTPUT OPTIONS -\f[CR]\-\-log, \-\-logging\f[R] Logs stdout also to -\f[CR]${NODE}\-p${port}${YYYYMMDD\-HHMM}.log\f[R] in current working +.PP +\f[V]--log, --logging\f[R] Logs stdout also to +\f[V]${NODE}-p${port}${YYYYMMDD-HHMM}.log\f[R] in current working directory of the shell. Depending on the color output option (see above) the output file will contain color and other markup escape codes, unless you specify -\f[CR]\-\-color 0\f[R] too. -\f[CR]cat\f[R] and \[en] if properly configured \f[CR]less\f[R] \[en] -will show the output properly formatted on your terminal. +\f[V]--color 0\f[R] too. +\f[V]cat\f[R] and \[en] if properly configured \f[V]less\f[R] \[en] will +show the output properly formatted on your terminal. The output shows a banner with the almost the same information as on the screen. In addition it shows the command line of the testssl.sh instance. @@ -835,12 +867,12 @@ Please note that the resulting log file is formatted according to the width of your screen while running testssl.sh. You can override the width with the environment variable TERM_WIDTH. .PP -\f[CR]\-\-logfile \f[R] or \f[CR]\-oL \f[R] Instead of -the previous option you may want to use this one if you want to log into -a directory or if you rather want to specify the log file name yourself. -If \f[CR]logfile\f[R] is a directory the output will put into -\f[CR]logfile/${NODE}\-p${port}${YYYYMMDD\-HHMM}.log\f[R]. -If \f[CR]logfile\f[R] is a file it will use that file name, an absolute +\f[V]--logfile \f[R] or \f[V]-oL \f[R] Instead of the +previous option you may want to use this one if you want to log into a +directory or if you rather want to specify the log file name yourself. +If \f[V]logfile\f[R] is a directory the output will put into +\f[V]logfile/${NODE}-p${port}${YYYYMMDD-HHMM}.log\f[R]. +If \f[V]logfile\f[R] is a file it will use that file name, an absolute path is also permitted here. LOGFILE is the variable you need to set if you prefer to work environment variables instead. @@ -848,30 +880,30 @@ Please note that the resulting log file is formatted according to the width of your screen while running testssl.sh. You can override the width with the environment variable TERM_WIDTH. .PP -\f[CR]\-\-json\f[R] Logs additionally to JSON file -\f[CR]${NODE}\-p${port}${YYYYMMDD\-HHMM}.json\f[R] in the current -working directory of the shell. -The resulting JSON file is opposed to \f[CR]\-\-json\-pretty\f[R] flat -\[en] which means each section is self contained and has an identifier -for each single check, the hostname/IP address, the port, severity and -the finding. +\f[V]--json\f[R] Logs additionally to JSON file +\f[V]${NODE}-p${port}${YYYYMMDD-HHMM}.json\f[R] in the current working +directory of the shell. +The resulting JSON file is opposed to \f[V]--json-pretty\f[R] flat \[en] +which means each section is self contained and has an identifier for +each single check, the hostname/IP address, the port, severity and the +finding. For vulnerabilities it may contain a CVE and CWE entry too. The output doesn\[cq]t contain a banner or a footer. .PP -\f[CR]\-\-jsonfile \f[R] or \f[CR]\-oj \f[R] Instead -of the previous option you may want to use this one if you want to log -the JSON out put into a directory or if you rather want to specify the -log file name yourself. -If \f[CR]jsonfile\f[R] is a directory the output will put into -\f[CR]logfile/${NODE}\-p${port}${YYYYMMDD\-HHMM}.json\f[R]. -If \f[CR]jsonfile\f[R] is a file it will use that file name, an absolute +\f[V]--jsonfile \f[R] or \f[V]-oj \f[R] Instead of +the previous option you may want to use this one if you want to log the +JSON out put into a directory or if you rather want to specify the log +file name yourself. +If \f[V]jsonfile\f[R] is a directory the output will put into +\f[V]logfile/${NODE}-p${port}${YYYYMMDD-HHMM}.json\f[R]. +If \f[V]jsonfile\f[R] is a file it will use that file name, an absolute path is also permitted here. .PP -\f[CR]\-\-json\-pretty\f[R] Logs additionally to JSON file -\f[CR]${NODE}\-p${port}${YYYYMMDD\-HHMM}.json\f[R] in the current -working directory of the shell. -The resulting JSON file is opposed to \f[CR]\-\-json\f[R] non\-flat -\[en] which means it is structured. +\f[V]--json-pretty\f[R] Logs additionally to JSON file +\f[V]${NODE}-p${port}${YYYYMMDD-HHMM}.json\f[R] in the current working +directory of the shell. +The resulting JSON file is opposed to \f[V]--json\f[R] non-flat \[en] +which means it is structured. The structure contains a header similar to the banner on the screen, including the command line, scan host, openssl binary used, testssl version and epoch of the start time. @@ -882,100 +914,97 @@ each single check, the severity and the finding. For vulnerabilities it may contain a CVE and CWE entry too. The footer lists the scan time in seconds. .PP -\f[CR]\-\-jsonfile\-pretty \f[R] or \f[CR]\-oJ \f[R] -Similar to the aforementioned \f[CR]\-\-jsonfile\f[R] or -\f[CR]\-\-logfile\f[R] it logs the output in pretty JSON format (see -\f[CR]\-\-json\-pretty\f[R]) into a file or a directory. -For further explanation see \f[CR]\-\-jsonfile\f[R] or -\f[CR]\-\-logfile\f[R]. +\f[V]--jsonfile-pretty \f[R] or \f[V]-oJ \f[R] +Similar to the aforementioned \f[V]--jsonfile\f[R] or +\f[V]--logfile\f[R] it logs the output in pretty JSON format (see +\f[V]--json-pretty\f[R]) into a file or a directory. +For further explanation see \f[V]--jsonfile\f[R] or \f[V]--logfile\f[R]. .PP -\f[CR]\-\-csv\f[R] Logs additionally to a CSV file -\f[CR]${NODE}\-p${port}${YYYYMMDD\-HHMM}.csv\f[R] in the current working +\f[V]--csv\f[R] Logs additionally to a CSV file +\f[V]${NODE}-p${port}${YYYYMMDD-HHMM}.csv\f[R] in the current working directory of the shell. The output contains a header with the keys, the values are the same as in the flat JSON format (identifier for each single check, the hostname/IP address, the port, severity, the finding and for vulnerabilities a CVE and CWE number). .PP -\f[CR]\-\-csvfile \f[R] or \f[CR]\-oC \f[R] Similar to -the aforementioned \f[CR]\-\-jsonfile\f[R] or \f[CR]\-\-logfile\f[R] it -logs the output in CSV format (see \f[CR]\-\-cvs\f[R]) additionally into -a file or a directory. -For further explanation see \f[CR]\-\-jsonfile\f[R] or -\f[CR]\-\-logfile\f[R]. +\f[V]--csvfile \f[R] or \f[V]-oC \f[R] Similar to the +aforementioned \f[V]--jsonfile\f[R] or \f[V]--logfile\f[R] it logs the +output in CSV format (see \f[V]--cvs\f[R]) additionally into a file or a +directory. +For further explanation see \f[V]--jsonfile\f[R] or \f[V]--logfile\f[R]. .PP -\f[CR]\-\-html\f[R] Logs additionally to an HTML file -\f[CR]${NODE}\-p${port}${YYYYMMDD\-HHMM}.html\f[R] in the current -working directory of the shell. +\f[V]--html\f[R] Logs additionally to an HTML file +\f[V]${NODE}-p${port}${YYYYMMDD-HHMM}.html\f[R] in the current working +directory of the shell. It contains a 1:1 output of the console. -In former versions there was a non\-native option to use \[lq]aha\[rq] +In former versions there was a non-native option to use \[lq]aha\[rq] (Ansi HTML Adapter: github.com/theZiz/aha) like -\f[CR]testssl.sh [options] | aha >output.html\f[R]. +\f[V]testssl.sh [options] | aha >output.html\f[R]. This is not necessary anymore. .PP -\f[CR]\-\-htmlfile \f[R] or \f[CR]\-oH \f[R] Similar -to the aforementioned \f[CR]\-\-jsonfile\f[R] or \f[CR]\-\-logfile\f[R] -it logs the output in HTML format (see \f[CR]\-\-html\f[R]) additionally -into a file or a directory. -For further explanation see \f[CR]\-\-jsonfile\f[R] or -\f[CR]\-\-logfile\f[R]. +\f[V]--htmlfile \f[R] or \f[V]-oH \f[R] Similar to +the aforementioned \f[V]--jsonfile\f[R] or \f[V]--logfile\f[R] it logs +the output in HTML format (see \f[V]--html\f[R]) additionally into a +file or a directory. +For further explanation see \f[V]--jsonfile\f[R] or \f[V]--logfile\f[R]. .PP -\f[CR]\-oA \f[R] / \f[CR]\-\-outFile \f[R] Similar -to nmap it does a file output to all available file formats: LOG, JSON +\f[V]-oA \f[R] / \f[V]--outFile \f[R] Similar to +nmap it does a file output to all available file formats: LOG, JSON pretty, CSV, HTML. -If the filename supplied is equal \f[CR]auto\f[R] the filename is +If the filename supplied is equal \f[V]auto\f[R] the filename is automatically generated using -`\f[I]N\f[R]\f[I]O\f[R]\f[I]D\f[R]\f[I]E\f[R] − \f[I]p\f[R]{port}\f[I]Y\f[R]\f[I]Y\f[R]\f[I]Y\f[R]\f[I]Y\f[R]\f[I]M\f[R]\f[I]M\f[R]\f[I]D\f[R]\f[I]D\f[R] − \f[I]H\f[R]\f[I]H\f[R]\f[I]M\f[R]\f[I]M\f[R].{EXT}' +`\f[I]N\f[R]\f[I]O\f[R]\f[I]D\f[R]\f[I]E\f[R]\[u2005]\[mi]\[u2005]\f[I]p\f[R]{port}\f[I]Y\f[R]\f[I]Y\f[R]\f[I]Y\f[R]\f[I]Y\f[R]\f[I]M\f[R]\f[I]M\f[R]\f[I]D\f[R]\f[I]D\f[R]\[u2005]\[mi]\[u2005]\f[I]H\f[R]\f[I]H\f[R]\f[I]M\f[R]\f[I]M\f[R].{EXT}' with the according extension. If a directory is provided all output files will put into -\f[CR]/${NODE}\-p${port}${YYYYMMDD\-HHMM}.{log,json,csv,html}\f[R]. +\f[V]/${NODE}-p${port}${YYYYMMDD-HHMM}.{log,json,csv,html}\f[R]. .PP -\f[CR]\-oa \f[R] / \f[CR]\-\-outfile \f[R] Does the -same as the previous option but uses flat JSON instead. +\f[V]-oa \f[R] / \f[V]--outfile \f[R] Does the same +as the previous option but uses flat JSON instead. .PP -\f[CR]\-\-hints\f[R] This option is not in use yet. +\f[V]--hints\f[R] This option is not in use yet. This option is meant to give hints how to fix a finding or at least a help to improve something. GIVE_HINTS is the environment variable for this. .PP -\f[CR]\-\-severity \f[R] For CSV and both JSON outputs this -will only add findings to the output file if a severity is equal or -higher than the \f[CR]severity\f[R] value specified. -Allowed are \f[CR]\f[R]. -WARN is another level which translates to a client\-side scanning error +\f[V]--severity \f[R] For CSV and both JSON outputs this will +only add findings to the output file if a severity is equal or higher +than the \f[V]severity\f[R] value specified. +Allowed are \f[V]\f[R]. +WARN is another level which translates to a client-side scanning error or problem. Thus you will always see them in a file if they occur. .PP -\f[CR]\-\-append\f[R] Normally, if an output file already exists and it -has a file size greater zero, testssl.sh will prompt you to manually -remove the file and exit with an error. -\f[CR]\-\-append\f[R] however will append to this file, without a -header. +\f[V]--append\f[R] Normally, if an output file already exists and it has +a file size greater zero, testssl.sh will prompt you to manually remove +the file and exit with an error. +\f[V]--append\f[R] however will append to this file, without a header. The environment variable APPEND does the same. Be careful using this switch/variable. A complementary option which overwrites an existing file doesn\[cq]t exist per design. .PP -\f[CR]\-\-overwrite\f[R] Normally, if an output file already exists and -it has a file size greater zero, testssl.sh will not allow you to -overwrite this file. +\f[V]--overwrite\f[R] Normally, if an output file already exists and it +has a file size greater zero, testssl.sh will not allow you to overwrite +this file. This option will do that \f[B]without any warning\f[R]. The environment variable OVERWRITE does the same. Be careful, you have been warned! .PP -\f[CR]\-\-outprefix \f[R] Prepend output filename prefix -before \f[CR]${NODE}\-\f[R]. +\f[V]--outprefix \f[R] Prepend output filename prefix +before \f[V]${NODE}-\f[R]. You can use as well the environment variable FNAME_PREFIX. Using this any output files will be named -\f[CR]\-${NODE}\-p${port}${YYYYMMDD\-HHMM}.\f[R] -when no file name of the respective output option was specified. -If you do not like the separator `\-' you can as well supply a -\f[CR]\f[R] ending in `.', \[cq]_\[cq] or `,'. -In this case or if you already supplied `\-' no additional `\-' will be -appended to \f[CR]\f[R]. +\f[V]-${NODE}-p${port}${YYYYMMDD-HHMM}.\f[R] when +no file name of the respective output option was specified. +If you do not like the separator `-' you can as well supply a +\f[V]\f[R] ending in `.', \[cq]_\[cq] or `,'. +In this case or if you already supplied `-' no additional `-' will be +appended to \f[V]\f[R]. .PP A few file output options can also be preset via environment variables. .SS COLOR RATINGS +.PP Testssl.sh makes use of (the eight) standard terminal colors. The color scheme is as follows: .IP \[bu] 2 @@ -998,7 +1027,7 @@ which otherwise results in a critical finding no color at places where also a finding can be expected: a finding on an info level .IP \[bu] 2 -cyan: currently only used for \f[CR]\-\-show\-each\f[R] or an additional +cyan: currently only used for \f[V]--show-each\f[R] or an additional hint .IP \[bu] 2 magenta: signals a warning condition, e.g.\ either a local lack of @@ -1010,8 +1039,8 @@ testssl.sh to quit .PP What is labeled as \[lq]light\[rq] above appears as such on the screen but is technically speaking \[lq]bold\[rq]. -Besides \f[CR]\-\-color=3\f[R] will color ciphers according to an -internal and rough rating. +Besides \f[V]--color=3\f[R] will color ciphers according to an internal +and rough rating. .PP Markup (without any color) is used in the following manner: .IP \[bu] 2 @@ -1019,33 +1048,34 @@ bold: for the name of the test .IP \[bu] 2 underline + bold: for the headline of each test section .IP \[bu] 2 -underline: for a sub\-headline +underline: for a sub-headline .IP \[bu] 2 italics: for strings just reflecting a value read from the server .SS TUNING via ENV variables and more options +.PP Except the environment variables mentioned above which can replace command line options here a some which cannot be set otherwise. Variables used for tuning are preset with reasonable values. \f[I]There should be no reason to change them\f[R] unless you use testssl.sh under special conditions. .IP \[bu] 2 -TERM_WIDTH is a variable which overrides the auto\-determined terminal +TERM_WIDTH is a variable which overrides the auto-determined terminal width size. Setting this variable normally only makes sense if you log the output to -a file using the \f[CR]\-\-log\f[R], \f[CR]\-\-logfile\f[R] or -\f[CR]\-oL\f[R] option. +a file using the \f[V]--log\f[R], \f[V]--logfile\f[R] or \f[V]-oL\f[R] +option. .IP \[bu] 2 DEBUG_ALLINONE / SETX: when setting one of those to true testssl.sh falls back to the standard bash behavior, i.e.\ calling -\f[CR]bash \-x testssl.sh\f[R] it displays the bash debugging output not -in an external file \f[CR]/tmp/testssl\-.log\f[R] +\f[V]bash -x testssl.sh\f[R] it displays the bash debugging output not +in an external file \f[V]/tmp/testssl-.log\f[R] .IP \[bu] 2 DEBUGTIME: Profiling option. When using bash\[cq]s debug mode and when this is set to true, it generates a separate text file with epoch times in -\f[CR]/tmp/testssl\-.time\f[R]. +\f[V]/tmp/testssl-.time\f[R]. They need to be concatenated by -\f[CR]paste /tmp/testssl\-.{time,log}\f[R] +\f[V]paste /tmp/testssl-.{time,log}\f[R] .IP \[bu] 2 EXPERIMENTAL=true is an option which is sometimes used in the development process to make testing easier. @@ -1116,7 +1146,7 @@ certificate expiration of a host, preset to 30 (days). For Let\[cq]s Encrypt this value will be divided internally by 2. .IP \[bu] 2 TESTSSL_INSTALL_DIR is the derived installation directory of testssl.sh. -Relatively to that the \f[CR]bin\f[R] and mandatory \f[CR]etc\f[R] +Relatively to that the \f[V]bin\f[R] and mandatory \f[V]etc\f[R] directory will be looked for. .IP \[bu] 2 CA_BUNDLES_PATH: If you have an own set of CA bundles or you want to @@ -1124,7 +1154,7 @@ point testssl.sh to a specific location of a CA bundle, you can use this variable to set the directory which testssl.sh will use. Please note that it overrides completely the builtin path of testssl.sh which means that you will only test against the bundles you point to. -Also you might want to use \f[CR]\[ti]/utils/create_ca_hashes.sh\f[R] to +Also you might want to use \f[V]\[ti]/utils/create_ca_hashes.sh\f[R] to create the hashes for HPKP. .IP \[bu] 2 MAX_SOCKET_FAIL: A number which tells testssl.sh how often a TCP socket @@ -1150,25 +1180,22 @@ make sense to continue\f[R]. .IP \[bu] 2 OPENSSL2 can be used to supply an alternative openssl version. This only makes sense if you want to amend the supplied version in -\f[CR]bin/\f[R] which lacks TLS 1.3 support with a version which doesn -not and is not in \f[CR]/usr/bin/openssl\f[R]. +\f[V]bin/\f[R] which lacks TLS 1.3 support with a version which doesn +not and is not in \f[V]/usr/bin/openssl\f[R]. .IP \[bu] 2 OSSL_SHORTCUT should be set to false when you run interactively and -don\[cq]t want to switch automatically to \f[CR]/usr/bin/openssl\f[R] -(\f[CR]OPENSSL2\f[R]) if you encounter a TLS 1.3\-only host. +don\[cq]t want to switch automatically to \f[V]/usr/bin/openssl\f[R] +(\f[V]OPENSSL2\f[R]) if you encounter a TLS 1.3-only host. .SS RATING -This program has a near\-complete implementation of SSL Labs\[cq]s `\c -.UR https://github.com/ssllabs/research/wiki/SSL-Server-Rating-Guide -SSL Server Rating Guide -.UE \c -'. .PP -This is \f[I]not\f[R] a 100% reimplementation of the \c -.UR https://www.ssllabs.com/ssltest/analyze.html -SSL Lab\[cq]s SSL Server Test -.UE \c -, but an implementation of the above rating specification, slight -discrepancies may occur. +This program has a near-complete implementation of SSL Labs\[cq]s `SSL +Server Rating +Guide (https://github.com/ssllabs/research/wiki/SSL-Server-Rating-Guide)'. +.PP +This is \f[I]not\f[R] a 100% reimplementation of the SSL Lab\[cq]s SSL +Server Test (https://www.ssllabs.com/ssltest/analyze.html), but an +implementation of the above rating specification, slight discrepancies +may occur. Please note that for now we stick to the SSL Labs rating as good as possible. We are not responsible for their rating. @@ -1179,68 +1206,75 @@ having good security! Don\[cq]t start a competition for the best grade, at least not without monitoring the client handshakes and not without adding a portion of good sense to it. -Please note STARTTLS always results in a grade cap to T. Anything else -would lead to a false sense of security. +Please note STARTTLS always results in a grade cap to T. +Anything else would lead to a false sense of security. Use TLS, see also RFC 8314. The security of STARTTLS is always client determined, i.e.\ checking the certificate which for SMTP port 25 is often enough not the case. -Also with DANE or MTA\-STS no one can test on the server side whether a +Also with DANE or MTA-STS no one can test on the server side whether a client makes use if it. .PP As of writing, these checks are missing: .IP \[bu] 2 -GOLDENDOODLE \- should be graded \f[B]F\f[R] if vulnerable +GOLDENDOODLE - should be graded \f[B]F\f[R] if vulnerable .IP \[bu] 2 -Insecure renegotiation \- should be graded \f[B]F\f[R] if vulnerable +Insecure renegotiation - should be graded \f[B]F\f[R] if vulnerable .IP \[bu] 2 -Padding oracle in AES\-NI CBC MAC check (CVE\-2016\-2107) \- should be +Padding oracle in AES-NI CBC MAC check (CVE-2016-2107) - should be graded \f[B]F\f[R] if vulnerable .IP \[bu] 2 -Sleeping POODLE \- should be graded \f[B]F\f[R] if vulnerable +Sleeping POODLE - should be graded \f[B]F\f[R] if vulnerable .IP \[bu] 2 -Zero Length Padding Oracle (CVE\-2019\-1559) \- should be graded +Zero Length Padding Oracle (CVE-2019-1559) - should be graded \f[B]F\f[R] if vulnerable .IP \[bu] 2 -Zombie POODLE \- should be graded \f[B]F\f[R] if vulnerable +Zombie POODLE - should be graded \f[B]F\f[R] if vulnerable .IP \[bu] 2 -All remaining old Symantec PKI certificates are distrusted \- should be +All remaining old Symantec PKI certificates are distrusted - should be graded \f[B]T\f[R] .IP \[bu] 2 -Symantec certificates issued before June 2016 are distrusted \- should -be graded \f[B]T\f[R] +Symantec certificates issued before June 2016 are distrusted - should be +graded \f[B]T\f[R] .IP \[bu] 2 -Anonymous key exchange \- should give \f[B]0\f[R] points in -\f[CR]set_key_str_score()\f[R] +Anonymous key exchange - should give \f[B]0\f[R] points in +\f[V]set_key_str_score()\f[R] .IP \[bu] 2 -Exportable key exchange \- should give \f[B]40\f[R] points in -\f[CR]set_key_str_score()\f[R] +Exportable key exchange - should give \f[B]40\f[R] points in +\f[V]set_key_str_score()\f[R] .IP \[bu] 2 -Weak key (Debian OpenSSL Flaw) \- should give \f[B]0\f[R] points in -\f[CR]set_key_str_score()\f[R] -.SS Implementing new grades caps or \-warnings +Weak key (Debian OpenSSL Flaw) - should give \f[B]0\f[R] points in +\f[V]set_key_str_score()\f[R] +.SS Implementing new grades caps or -warnings +.PP To implement a new grading cap, simply call the -\f[CR]set_grade_cap()\f[R] function, with the grade and a reason: +\f[V]set_grade_cap()\f[R] function, with the grade and a reason: .IP -.EX +.nf +\f[C] set_grade_cap \[dq]D\[dq] \[dq]Vulnerable to documentation\[dq] -.EE +\f[R] +.fi .PP To implement a new grade warning, simply call the -\f[CR]set_grade_warning()\f[R] function, with a message: +\f[V]set_grade_warning()\f[R] function, with a message: .IP -.EX +.nf +\f[C] set_grade_warning \[dq]Documentation is always right\[dq] -.EE +\f[R] +.fi .SS Implementing a new check which contains grade caps -When implementing a new check (be it vulnerability or not) that sets -grade caps, the \f[CR]set_rating_state()\f[R] has to be updated -(i.e.\ the \f[CR]$do_mycheck\f[R] variable\-name has to be added to the -loop, and \f[CR]$nr_enabled\f[R] if\-statement has to be incremented) .PP -The \f[CR]set_rating_state()\f[R] automatically disables rating, if all +When implementing a new check (be it vulnerability or not) that sets +grade caps, the \f[V]set_rating_state()\f[R] has to be updated +(i.e.\ the \f[V]$do_mycheck\f[R] variable-name has to be added to the +loop, and \f[V]$nr_enabled\f[R] if-statement has to be incremented) +.PP +The \f[V]set_rating_state()\f[R] automatically disables rating, if all the required checks are \f[I]not\f[R] enabled. This is to prevent giving out a misleading or wrong grade. .SS Implementing a new revision +.PP When a new revision of the rating specification comes around, the following has to be done: .IP \[bu] 2 @@ -1254,59 +1288,70 @@ Added to the above list of missing checks (if above is not possible) .IP \[bu] 2 New grade warnings has to be added wherever relevant .IP \[bu] 2 -The revision output in \f[CR]run_rating()\f[R] function has to updated +The revision output in \f[V]run_rating()\f[R] function has to updated .SS EXAMPLES .IP -.EX +.nf +\f[C] testssl.sh testssl.sh -.EE +\f[R] +.fi .PP does a default run on https://testssl.sh (protocols, standard cipher lists, server\[cq]s cipher preferences, forward secrecy, server defaults, vulnerabilities, client simulation, and rating. .IP -.EX +.nf +\f[C] testssl.sh testssl.net:443 -.EE +\f[R] +.fi .PP does the same default run as above with the subtle difference that testssl.net has two IPv4 addresses. Both are tested. .IP -.EX - testssl.sh \-\-ip=one \-\-wide https://testssl.net:443 -.EE +.nf +\f[C] + testssl.sh --ip=one --wide https://testssl.net:443 +\f[R] +.fi .PP does the same checks as above, with the difference that one IP address is being picked randomly. Displayed is everything where possible in wide format. .IP -.EX - testssl.sh \-6 https://testssl.net -.EE +.nf +\f[C] + testssl.sh -6 https://testssl.net +\f[R] +.fi .PP As opposed to the first example it also tests the IPv6 part \[en] supposed you have an IPv6 network and your openssl supports IPv6 (see above). .IP -.EX - testssl.sh \-t smtp smtp.gmail.com:25 -.EE +.nf +\f[C] + testssl.sh -t smtp smtp.gmail.com:25 +\f[R] +.fi .PP Checks are done via a STARTTLS handshake on the plain text port 25. It checks every IP on smtp.gmail.com. .IP -.EX - testssl.sh \-\-starttls=imap imap.gmx.net:143 -.EE +.nf +\f[C] + testssl.sh --starttls=imap imap.gmx.net:143 +\f[R] +.fi .PP does the same on the plain text IMAP port. .PP -Please note that for plain TLS\-encrypted ports you must not specify the +Please note that for plain TLS-encrypted ports you must not specify the protocol option when no STARTTLS handshake is offered: -\f[CR]testssl.sh smtp.gmail.com:465\f[R] just checks the encryption on -the SMTPS port, \f[CR]testssl.sh imap.gmx.net:993\f[R] on the IMAPS -port. +\f[V]testssl.sh smtp.gmail.com:465\f[R] just checks the encryption on +the SMTPS port, \f[V]testssl.sh imap.gmx.net:993\f[R] on the IMAPS port. Also MongoDB which provides TLS support without STARTTLS can be tested directly. .SS RFCs and other standards @@ -1325,7 +1370,7 @@ Transport Layer Security RFC 3207: SMTP Service Extension for Secure SMTP over Transport Layer Security .IP \[bu] 2 -RFC 3501: INTERNET MESSAGE ACCESS PROTOCOL \- VERSION 4rev1 +RFC 3501: INTERNET MESSAGE ACCESS PROTOCOL - VERSION 4rev1 .IP \[bu] 2 RFC 4346: The Transport Layer Security (TLS) Protocol Version 1.1 .IP \[bu] 2 @@ -1355,7 +1400,7 @@ RFC 6101: The Secure Sockets Layer (SSL) Protocol Version 3.0 .IP \[bu] 2 RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core .IP \[bu] 2 -RFC 6125: Domain\-Based Application Service Identity [..] +RFC 6125: Domain-Based Application Service Identity [..] .IP \[bu] 2 RFC 6797: HTTP Strict Transport Security (HSTS) .IP \[bu] 2 @@ -1376,10 +1421,10 @@ RFC 7465: Prohibiting RC4 Cipher Suites .IP \[bu] 2 RFC 7685: A Transport Layer Security (TLS) ClientHello Padding Extension .IP \[bu] 2 -RFC 7905: ChaCha20\-Poly1305 Cipher Suites for Transport Layer Security +RFC 7905: ChaCha20-Poly1305 Cipher Suites for Transport Layer Security (TLS) .IP \[bu] 2 -RFC 7919: Negotiated Finite Field Diffie\-Hellman Ephemeral Parameters +RFC 7919: Negotiated Finite Field Diffie-Hellman Ephemeral Parameters for Transport Layer Security .IP \[bu] 2 RFC 8143: Using Transport Layer Security (TLS) with Network News @@ -1390,9 +1435,9 @@ RFC 8446: The Transport Layer Security (TLS) Protocol Version 1.3 RFC 8701: Applying Generate Random Extensions And Sustain Extensibility (GREASE) to TLS Extensibility .IP \[bu] 2 -RFC 9000: QUIC: A UDP\-Based Multiplexed and Secure Transport +RFC 9000: QUIC: A UDP-Based Multiplexed and Secure Transport .IP \[bu] 2 -W3C CSP: Content Security Policy Level 1\-3 +W3C CSP: Content Security Policy Level 1-3 .IP \[bu] 2 TLSWG Draft: The Transport Layer Security (TLS) Protocol Version 1.3 .SS EXIT STATUS @@ -1406,7 +1451,7 @@ during run 1+n same as previous. The errors or ambiguous results are added, also per IP. .IP \[bu] 2 -50\-200 reserved for returning a vulnerability scoring for system +50-200 reserved for returning a vulnerability scoring for system monitoring or a CI tools .IP \[bu] 2 242 (ERR_CHILD) Child received a signal from master @@ -1435,26 +1480,29 @@ monitoring or a CI tools .IP \[bu] 2 255 (ERR_BASH) Bash version incorrect .SS FILES +.PP \f[B]etc/*pem\f[R] are the certificate stores from Apple, Linux, Mozilla Firefox, Windows and Java. .PP -\f[B]etc/client\-simulation.txt\f[R] contains client simulation data. +\f[B]etc/client-simulation.txt\f[R] contains client simulation data. .PP -\f[B]etc/cipher\-mapping.txt\f[R] provides a mandatory file with mapping +\f[B]etc/cipher-mapping.txt\f[R] provides a mandatory file with mapping from OpenSSL cipher suites names to the ones from IANA / used in the RFCs. .PP \f[B]etc/tls_data.txt\f[R] provides a mandatory file for ciphers (bash sockets) and key material. .SS AUTHORS +.PP Developed by Dirk Wetter, David Cooper and many others, see CREDITS.md . .SS COPYRIGHT -Copyright © 2012 Dirk Wetter. +.PP +Copyright \[co] 2012 Dirk Wetter. License GPLv2: Free Software Foundation, Inc. This is free software: you are free to change and redistribute it under the terms of the license, see LICENSE. .PP -Attribution is important for the future of this project \- also in the +Attribution is important for the future of this project - also in the internet. Thus if you\[cq]re offering a scanner based on testssl.sh as a public and/or paid service in the internet you are strongly encouraged to @@ -1465,13 +1513,16 @@ That helps us to get bugfixes, other feedback and more contributions. Usage WITHOUT ANY WARRANTY. USE at your OWN RISK! .SS LIMITATION +.PP All native Windows platforms emulating Linux are known to be slow. .SS BUGS +.PP Probably. Current known ones and interface for filing new ones: https://testssl.sh/bugs/ . .SS SEE ALSO -\f[CR]ciphers\f[R](1), \f[CR]openssl\f[R](1), \f[CR]s_client\f[R](1), -\f[CR]x509\f[R](1), \f[CR]verify\f[R](1), \f[CR]ocsp\f[R](1), -\f[CR]crl\f[R](1), \f[CR]bash\f[R](1) and the websites -https://testssl.sh/ and https://github.com/testssl/testssl.sh/ . +.PP +\f[V]ciphers\f[R](1), \f[V]openssl\f[R](1), \f[V]s_client\f[R](1), +\f[V]x509\f[R](1), \f[V]verify\f[R](1), \f[V]ocsp\f[R](1), +\f[V]crl\f[R](1), \f[V]bash\f[R](1) and the websites https://testssl.sh/ +and https://github.com/testssl/testssl.sh/ . diff --git a/doc/testssl.1.html b/doc/testssl.1.html index 589a305..f232ea0 100644 --- a/doc/testssl.1.html +++ b/doc/testssl.1.html @@ -99,6 +99,14 @@
  • client simulation

  • rating

  • +

    If a target FQDN has multiple IPv4 and/or multiple IPv6 + addresses, it scans all IPs with the specified options or using + the default run - unless specified otherwise, see + --ip, -4 and -6. IPv6 + connectivity is automagically checked. If there’s noch such + thing you will see a banner Testing all + IPv4 addresses and all IPv6 addresses will + appear in round brackets.

    OPTIONS AND PARAMETERS

    Options are either short or long options. Any long or short option requiring a value can be called with or without an equal @@ -216,15 +224,16 @@ will be made in the future as a best guess by testssl.sh. The same can be achieved by setting the environment variable WARNINGS.

    -

    --connect-timeout <seconds> This is useful +

    --socket-timeout <seconds> This is useful for socket TCP connections to a node. If the node does not complete a TCP handshake (e.g. because it is down or behind a firewall or there’s an IDS or a tarpit) testssl.sh may usually hang for around 2 minutes or even much more. This parameter instructs testssl.sh to wait at most seconds for the handshake to complete before giving up. This option only - works if your OS has a timeout binary installed. CONNECT_TIMEOUT - is the corresponding environment variable.

    + works if your OS has a timeout binary installed. SOCKET_TIMEOUT + is the corresponding environment variable. This doesn’t work on + Macs out of the box.

    --openssl-timeout <seconds> This is especially useful for all connects using openssl and practically useful for mass testing. It avoids the openssl connect to hang @@ -234,7 +243,8 @@ timeout binary installed. As there are different implementations of timeout: It automatically calls the binary with the right parameters. OPENSSL_TIMEOUT is the equivalent - environment variable.

    + environment variable. This doesn’t work on Macs out of the + box.

    --basicauth <user:pass> This can be set to provide HTTP basic auth credentials which are used during checks for security headers. BASICAUTH is the ENV variable you can use @@ -301,17 +311,15 @@ IGN_OCSP_PROXY=true has been supplied it will be tried directly. Authentication to the proxy is not supported, also no HTTPS or SOCKS proxy.

    -

    -6 does (also) IPv6 checks. Please note that - testssl.sh doesn’t perform checks on an IPv6 address - automatically, because of two reasons: testssl.sh does no - connectivity checks for IPv6 and it cannot determine reliably - whether the OpenSSL binary you’re using has IPv6 s_client - support. -6 assumes both is the case. If both - conditions are met and you in general prefer to test for IPv6 - branches as well you can add HAS_IPv6 to your shell - environment. Besides the OpenSSL binary supplied IPv6 is known - to work with vanilla OpenSSL >= 1.1.0 and older versions - >=1.0.2 in RHEL/CentOS/FC and Gentoo.

    +

    -6 scans only IPv6 addresses of the target. + Besides the OpenSSL binary supplied IPv6 is known to work with + vanilla OpenSSL >= 1.1.0 and older versions >=1.0.2 in + RHEL/CentOS/FC and Gentoo. Scans are somewhat in line with tools + like curl or wget, i.e. if there’s an IPv6 address of the target + which can be reached, it just uses them. If you don’t want this + behavior, you need to supply -4.

    +

    -4 scans only IPv4 addresses of the target, IPv6 + addresses of the target won’t be scanned.

    --ssl-native Instead of using a mixture of bash sockets and a few openssl s_client connects, testssl.sh uses the latter (almost) only. This is faster but provides less accurate @@ -649,7 +657,7 @@ vulnerability. It tests for the absence of a lot of ciphers, some TLS extensions and ec curves which were introduced later in Windows. In the end the server banner is being looked at.

    -

    -4, --rc4, --appelbaum Checks which RC4 stream +

    --rc4, --appelbaum Checks which RC4 stream ciphers are being offered.

    OUTPUT OPTIONS

    -q, --quiet Normally testssl.sh displays a diff --git a/doc/testssl.1.md b/doc/testssl.1.md index a9c057e..75835cd 100644 --- a/doc/testssl.1.md +++ b/doc/testssl.1.md @@ -36,7 +36,7 @@ linked OpenSSL binaries for major operating systems are supplied in `./bin/`. `testssl.sh URI` as the default invocation does the so-called default run which does a number of checks and puts out the results colorized (ANSI and termcap) on the screen. It does every check listed below except `-E` which are (order of appearance): -0) displays a banner (see below), does a DNS lookup also for further IP addresses and does for the returned IP address a reverse lookup. Last but not least a service check is being done. +0) displays a banner (see below), does a DNS lookup also for further IP addresses and does for the returned IP address a reverse lookup. Last but not least a service check is being done. 1) SSL/TLS protocol check @@ -58,6 +58,7 @@ linked OpenSSL binaries for major operating systems are supplied in `./bin/`. 10) rating +If a target FQDN has multiple IPv4 and/or multiple IPv6 addresses, it scans all IPs with the specified options or using the default run - unless specified otherwise, see `--ip`, `-4` and `-6`. IPv6 connectivity is automagically checked. If there's noch such thing you will see a banner *Testing all **IPv4** addresses* and all IPv6 addresses will appear in round brackets. ## OPTIONS AND PARAMETERS @@ -105,9 +106,9 @@ Please note that `fname` has to be in Unix format. DOS carriage returns won't be `--warnings `. The warnings parameter determines how testssl.sh will deal with situations where user input normally will be necessary. There are two options. `batch` doesn't wait for a confirming keypress when a client- or server-side problem is encountered. As of 3.0 it just then terminates the particular scan. This is automatically chosen for mass testing (`--file`). `off` just skips the warning, the confirmation but continues the scan, independent whether it makes sense or not. Please note that there are conflicts where testssl.sh will still ask for confirmation which are the ones which otherwise would have a drastic impact on the results. Almost any other decision will be made in the future as a best guess by testssl.sh. The same can be achieved by setting the environment variable `WARNINGS`. -`--connect-timeout ` This is useful for socket TCP connections to a node. If the node does not complete a TCP handshake (e.g. because it is down or behind a firewall or there's an IDS or a tarpit) testssl.sh may usually hang for around 2 minutes or even much more. This parameter instructs testssl.sh to wait at most `seconds` for the handshake to complete before giving up. This option only works if your OS has a timeout binary installed. CONNECT_TIMEOUT is the corresponding environment variable. +`--socket-timeout ` This is useful for socket TCP connections to a node. If the node does not complete a TCP handshake (e.g. because it is down or behind a firewall or there's an IDS or a tarpit) testssl.sh may usually hang for around 2 minutes or even much more. This parameter instructs testssl.sh to wait at most `seconds` for the handshake to complete before giving up. This option only works if your OS has a timeout binary installed. SOCKET_TIMEOUT is the corresponding environment variable. This doesn't work on Macs out of the box. -`--openssl-timeout ` This is especially useful for all connects using openssl and practically useful for mass testing. It avoids the openssl connect to hang for ~2 minutes. The expected parameter `seconds` instructs testssl.sh to wait before the openssl connect will be terminated. The option is only available if your OS has a timeout binary installed. As there are different implementations of `timeout`: It automatically calls the binary with the right parameters. OPENSSL_TIMEOUT is the equivalent environment variable. +`--openssl-timeout ` This is especially useful for all connects using openssl and practically useful for mass testing. It avoids the openssl connect to hang for ~2 minutes. The expected parameter `seconds` instructs testssl.sh to wait before the openssl connect will be terminated. The option is only available if your OS has a timeout binary installed. As there are different implementations of `timeout`: It automatically calls the binary with the right parameters. OPENSSL_TIMEOUT is the equivalent environment variable. This doesn't work on Macs out of the box. `--basicauth ` This can be set to provide HTTP basic auth credentials which are used during checks for security headers. BASICAUTH is the ENV variable you can use instead. @@ -124,11 +125,13 @@ The same can be achieved by setting the environment variable `WARNINGS`. `--mx ` tests all MX records (STARTTLS on port 25) from high to low priority, one after the other. -`--ip ` tests either the supplied IPv4 or IPv6 address instead of resolving host(s) in ``. IPv6 addresses need to be supplied in square brackets. `--ip=one` means: just test the first A record DNS returns (useful for multiple IPs). If `-6` and `--ip=one` was supplied an AAAA record will be picked if available. The ``--ip`` option might be also useful if you want to resolve the supplied hostname to a different IP, similar as if you would edit `/etc/hosts` or `/c/Windows/System32/drivers/etc/hosts`. `--ip=proxy` tries a DNS resolution via proxy. `--ip=proxy` plus `--nodns=min` is useful for situations with no local DNS as there'll be no DNS timeouts when trying to resolve CAA, TXT and MX records. +`--ip ` tests either the supplied IPv4 or IPv6 address instead of resolving host(s) in ``. IPv6 addresses need to be supplied in square brackets. `--ip=one` means: just test the first A record DNS returns (useful for multiple IPs). If `-6` and `--ip=one` was supplied an AAAA record will be picked if available. The `--ip` option might be also useful if you want to resolve the supplied hostname to a different IP, similar as if you would edit `/etc/hosts` or `/c/Windows/System32/drivers/etc/hosts`. `--ip=proxy` tries a DNS resolution via proxy. `--ip=proxy` plus `--nodns=min` is useful for situations with no local DNS as there'll be no DNS timeouts when trying to resolve CAA, TXT and MX records. `--proxy :` does ANY check via the specified proxy. `--proxy=auto` inherits the proxy setting from the environment. Any hostname supplied will be resolved to the first A record, if it does not exist the AAAA record is used. IPv4 and IPv6 addresses can be passed too, the latter *also* with square bracket notation. Please note that you need a newer OpenSSL or LibreSSL version for IPv6 proxy functionality. In addition if you want lookups via proxy you can specify `DNS_VIA_PROXY=true`. OCSP revocation checking (`-S --phone-out`) is not supported by OpenSSL via proxy. As supplying a proxy is an indicator for port 80 and 443 outgoing being blocked in your network an OCSP revocation check won't be performed. However if `IGN_OCSP_PROXY=true` has been supplied it will be tried directly. Authentication to the proxy is not supported, also no HTTPS or SOCKS proxy. -`-6` does (also) IPv6 checks. Please note that testssl.sh doesn't perform checks on an IPv6 address automatically, because of two reasons: testssl.sh does no connectivity checks for IPv6 and it cannot determine reliably whether the OpenSSL binary you're using has IPv6 s_client support. `-6` assumes both is the case. If both conditions are met and you in general prefer to test for IPv6 branches as well you can add `HAS_IPv6` to your shell environment. Besides the OpenSSL binary supplied IPv6 is known to work with vanilla OpenSSL >= 1.1.0 and older versions >=1.0.2 in RHEL/CentOS/FC and Gentoo. +`-6` scans only IPv6 addresses of the target. Besides the OpenSSL binary supplied IPv6 is known to work with vanilla OpenSSL >= 1.1.0 and older versions >=1.0.2 in RHEL/CentOS/FC and Gentoo. Scans are somewhat in line with tools like curl or wget, i.e. if there's an IPv6 address of the target which can be reached, it just uses them. If you don't want this behavior, you need to supply `-4.` + +`-4` scans only IPv4 addresses of the target, IPv6 addresses of the target won't be scanned. `--ssl-native` Instead of using a mixture of bash sockets and a few openssl s_client connects, testssl.sh uses the latter (almost) only. This is faster but provides less accurate results, especially for the client simulation and for cipher support. For all checks you will see a warning if testssl.sh cannot tell if a particular check cannot be performed. For some checks however you might end up getting false negatives without a warning. Thus it is not recommended to use. It should only be used if you prefer speed over accuracy or you know that your target has sufficient overlap with the protocols and cipher provided by your openssl binary. @@ -266,7 +269,7 @@ Also for multiple server certificates are being checked for as well as for the c `-WS, --winshock` Checks for Winshock vulnerability. It tests for the absence of a lot of ciphers, some TLS extensions and ec curves which were introduced later in Windows. In the end the server banner is being looked at. -`-4, --rc4, --appelbaum` Checks which RC4 stream ciphers are being offered. +`--rc4, --appelbaum` Checks which RC4 stream ciphers are being offered. ### OUTPUT OPTIONS diff --git a/testssl.sh b/testssl.sh index bb8318c..e362ad7 100755 --- a/testssl.sh +++ b/testssl.sh @@ -151,7 +151,7 @@ declare -a SKIP_TESTS=() # This array hold the checks t # Following variables make use of $ENV and can also be used like "= ./testssl.sh " declare -x OPENSSL OPENSSL_TIMEOUT=${OPENSSL_TIMEOUT:-""} # Default connect timeout with openssl before we call the server side unreachable -CONNECT_TIMEOUT=${CONNECT_TIMEOUT:-""} # Default connect timeout with sockets before we call the server side unreachable +SOCKET_TIMEOUT=${SOCKET_TIMEOUT:-""} # Default connect timeout with sockets before we call the server side unreachable PHONE_OUT=${PHONE_OUT:-false} # Whether testssl can retrieve CRLs and OCSP FAST_SOCKET=${FAST_SOCKET:-false} # EXPERIMENTAL feature to accelerate sockets -- DO NOT USE it for production COLOR=${COLOR:-2} # 3: Extra color (ciphers, curves), 2: Full color, 1: B/W only 0: No ESC at all @@ -186,7 +186,7 @@ OVERWRITE=${OVERWRITE:-false} # overwriting csv/json/html/log file [[ -z "$NODNS" ]] && declare NODNS # If unset it does all DNS lookups per default. "min" only for hosts or "none" at all NXDNS=${NXDNS:-invalid.} # For WSL this helps avoiding DNS requests to "invalid." which windows seem to handle delayed NXCONNECT="" # needed when when need to test capabilities of the openssl binary -HAS_IPv6=${HAS_IPv6:-false} # if you have OpenSSL with IPv6 support AND IPv6 networking set it to yes +IPv6_OK=false # Determines later whether there's IPv6 connectivity for the user or not ALL_CLIENTS=${ALL_CLIENTS:-false} # do you want to run all client simulation form all clients supplied by SSLlabs? OFFENSIVE=${OFFENSIVE:-true} # do you want to include offensive vulnerability tests which may cause blocking by an IDS? ADDTL_CA_FILES="${ADDTL_CA_FILES:-""}" # single file with a CA in PEM format or comma separated lists of them @@ -391,8 +391,8 @@ NODE="" NODEIP="" rDNS="" CORRECT_SPACES="" # Used for IPv6 and proper output formatting -IPADDRs="" -IP46ADDRs="" +IPADDRs2CHECK="" # Contains all IP addresses to test +IPADDRs2SHOW="" # ... those are the ones to be displayed LOCAL_A=false # Does the $NODEIP come from /etc/hosts? LOCAL_AAAA=false # Does the IPv6 IP come from /etc/hosts? XMPP_HOST="" @@ -1339,7 +1339,7 @@ fileout_pretty_json_banner() { if ! "$do_mass_testing"; then [[ -z "$NODE" ]] && parse_hn_port "${URI}" - # NODE, URL_PATH, PORT, IPADDR and IP46ADDR is set now --> wrong place + # NODE, URL_PATH, PORT, IPADDR and IPADDRs2SHOW is set now --> wrong place target="$NODE" $do_mx_all_ips && target="$URI" fi @@ -1470,7 +1470,7 @@ json_header() { elif "$do_mx_all_ips"; then fname_prefix="${FNAME_PREFIX}mx-${URI}" else - # ensure NODE, URL_PATH, PORT, IPADDR and IP46ADDR are set + # ensure NODE, URL_PATH, PORT, IPADDR and IPADDRs2SHOW are set ! "$filename_provided" && [[ -z "$NODE" ]] && parse_hn_port "${URI}" fname_prefix="${FNAME_PREFIX}${NODE}_p${PORT}" fi @@ -1518,7 +1518,7 @@ csv_header() { elif "$do_mx_all_ips"; then fname_prefix="${FNAME_PREFIX}mx-${URI}" else - # ensure NODE, URL_PATH, PORT, IPADDR and IP46ADDR are set + # ensure NODE, URL_PATH, PORT, IPADDR and IPADDRs2SHOW are set ! "$filename_provided" && [[ -z "$NODE" ]] && parse_hn_port "${URI}" fname_prefix="${FNAME_PREFIX}${NODE}_p${PORT}" fi @@ -1575,7 +1575,7 @@ html_header() { elif "$do_mx_all_ips"; then fname_prefix="${FNAME_PREFIX}mx-${URI}" else - # ensure NODE, URL_PATH, PORT, IPADDR and IP46ADDR are set + # ensure NODE, URL_PATH, PORT, IPADDR and IPADDRs2SHOW are set ! "$filename_provided" && [[ -z "$NODE" ]] && parse_hn_port "${URI}" fname_prefix="${FNAME_PREFIX}${NODE}_p${PORT}" fi @@ -12153,12 +12153,14 @@ fd_socket() { break fi done - # For the following execs: 2>/dev/null would remove a potential error message, but disables debugging. - # First we check whether a socket connect timeout was specified. We exec the connect in a subshell, - # then we'll see whether we can connect. If not we take the emergency exit. If we're still alive we'll + # For the following exec commands: 2>/dev/null would remove a potential error message, but would disable + # debugging. + # First we check whether a socket timeout was specified. We exec the connect in a subshell, + # and see whether. If not we take the emergency exit: fatal() in connectivity_problem. + # Otherwise (no socket timeout) OR when we survived that we do that without subshell. # proceed with the "usual case", see below. - elif [[ -n "$CONNECT_TIMEOUT" ]]; then - if ! $TIMEOUT_CMD $CONNECT_TIMEOUT bash -c "exec 5<>/dev/tcp/$nodeip/$PORT"; then + elif [[ -n "$SOCKET_TIMEOUT" ]]; then + if ! $TIMEOUT_CMD $SOCKET_TIMEOUT bash -c "exec 5<>/dev/tcp/$nodeip/$PORT"; then ((NR_SOCKET_FAIL++)) connectivity_problem $NR_SOCKET_FAIL $MAX_SOCKET_FAIL "TCP connect problem" "repeated TCP connect problems (connect timeout), giving up" outln @@ -21190,7 +21192,7 @@ find_openssl_binary() { $OPENSSL verify -trusted_first &1 | grep -q '^usage' || TRUSTED1ST="-trusted_first" - if [[ -n "$CONNECT_TIMEOUT" ]] || [[ -n "$OPENSSL_TIMEOUT" ]]; then + if [[ -n "$SOCKET_TIMEOUT" ]] || [[ -n "$OPENSSL_TIMEOUT" ]]; then # We don't set a general timeout as we might not have "timeout" installed and we only # do what is instructed. Thus we check first what the command line params were, # then we proceed @@ -21203,8 +21205,7 @@ find_openssl_binary() { fi else TIMEOUT_CMD="" - outln - fatal "You specified a connect or openssl timeout but the binary \"timeout\" couldn't be found " $ERR_RESOURCE + fatal "You specified a socket or openssl timeout but the binary \"timeout\" couldn't be found " $ERR_RESOURCE fi fi @@ -21366,7 +21367,7 @@ help() { Text format 2: nmap output in greppable format (-oG), 1 port per line allowed --mode Mass testing to be done serial (default) or parallel (--parallel is shortcut for the latter) --warnings "batch" doesn't continue when a testing error is encountered, off continues and skips warnings - --connect-timeout useful to avoid hangers. Max to wait for the TCP socket connect to return + --socket-timeout useful to avoid hangers. Max to wait for the TCP connect to get ACKed --openssl-timeout useful to avoid hangers. Max to wait before openssl connect will be terminated single check as ("$PROG_NAME URI" does everything except -E and -g): @@ -21402,7 +21403,7 @@ single check as ("$PROG_NAME URI" does everything except -E and -g): -F, --freak tests for FREAK vulnerability -J, --logjam tests for LOGJAM vulnerability -D, --drown tests for DROWN vulnerability - -4, --rc4, --appelbaum which RC4 ciphers are being offered? + --rc4, --appelbaum which RC4 ciphers are being offered? tuning / connect options (most also can be preset via environment variables): -9, --full includes tests for implementation bugs and cipher per protocol (could disappear) @@ -21411,7 +21412,8 @@ tuning / connect options (most also can be preset via environment variables): --ssl-native use OpenSSL where sockets are normally used. Faster but inaccurate, avoid it if possible --openssl use this openssl binary (default: look in \$PATH, \$RUN_DIR of $PROG_NAME) --proxy (experimental) proxy connects via , auto: values from \$env (\$http(s)_proxy) - -6 also use IPv6. Works only with supporting OpenSSL version and IPv6 connectivity + -4 Scan IPv4 only + -6 Scan IPv6 only. Works only with supporting OpenSSL version and IPv6 connectivity --ip a) tests the supplied v4 or v6 address instead of resolving host(s) in URI b) "one" means: just test the first DNS returns (useful for multiple IPs) c) "proxy" means: dns resolution via proxy. Needed when host has no DNS. @@ -21528,7 +21530,6 @@ OPENSSL2_HAS_CHACHA20: $OPENSSL2_HAS_CHACHA20 OPENSSL2_HAS_AES128_GCM: $OPENSSL2_HAS_AES128_GCM OPENSSL2_HAS_AES256_GCM: $OPENSSL2_HAS_AES256_GCM -HAS_IPv6: $HAS_IPv6 HAS_SSL2: $HAS_SSL2 HAS_SSL3: $HAS_SSL3 HAS_TLS1: $HAS_TLS1 @@ -21610,12 +21611,13 @@ CLIENT_MIN_FS: $CLIENT_MIN_FS DAYS2WARN1: $DAYS2WARN1 DAYS2WARN2: $DAYS2WARN2 -HEADER_MAXSLEEP: $HEADER_MAXSLEEP +IPv6_OK: $IPv6_OK MAX_WAITSOCK: $MAX_WAITSOCK HEARTBLEED_MAX_WAITSOCK: $HEARTBLEED_MAX_WAITSOCK CCS_MAX_WAITSOCK: $CCS_MAX_WAITSOCK USLEEP_SND $USLEEP_SND USLEEP_REC $USLEEP_REC +HEADER_MAXSLEEP: $HEADER_MAXSLEEP SOCAT: $SOCAT @@ -22305,6 +22307,7 @@ get_mx_record() { # arg1: domain / hostname. Returned will be the TXT record as a string which can be multilined # (one entry per line), for e.g. non-MTA-STS records. # Is supposed to be used by MTA STS in the future like get_txt_record _mta-sts.DOMAIN.TLD +# get_txt_record() { local record="" local saved_openssl_conf="$OPENSSL_CONF" @@ -22330,27 +22333,75 @@ get_txt_record() { } +# This is to check whether we have IPv6 connectivity +# arg1: IPv6 address to check +# +# sets IPv6_OK if it works -- or not +# +shouldwedo_ipv6() { + local i=0 -# set IPADDRs and IP46ADDRs + "$do_ipv4_only" && return 0 + while true; do + bash -c "exec 5<>/dev/tcp/$1/$PORT" &>/dev/null + if [[ $? -eq 0 ]]; then + IPv6_OK=true + break + fi + sleep 1 + ((i++)) + [[ $i -ge $MAX_SOCKET_FAIL ]] && break + done + if ! "$IPv6_OK"; then + if "$do_ipv6_only"; then + connectivity_problem $i $MAX_SOCKET_FAIL "IPv6 connect problem" "repeated IPv6 connect problems when IPv6-only scan requested" + else + IPv6_OK=false + fi + fi +} + + +# set IPADDRs2CHECK and IPADDRs2SHOW # determine_ip_addresses() { local ip4="" local ip6="" - ip4="$(get_a_record "$NODE")" - ip6="$(get_aaaa_record "$NODE")" - IP46ADDRs=$(newline_to_spaces "$ip4 $ip6") + # first, try to get IP addresses from /etc/hosts + # Local_A[AAA] is for our UI + ip4=$(get_local_a "$NODE") + if [[ -n "$ip4" ]]; then + LOCAL_A=true + else + ip4="$(get_a_record "$NODE")" + fi + ip6=$(get_local_aaaa "$NODE") + if [[ -n "$ip6" ]]; then + LOCAL_AAAA=true + else + ip6=$(get_aaaa_record "$NODE") + fi + IPADDRs2SHOW=$(newline_to_spaces "$ip4 $ip6") + + if [[ -n "$ip6" ]]; then + # sets IPv6_OK + shouldwedo_ipv6 $(head -1 <<< "$ip6") + fi if [[ -n "$CMDLINE_IP" ]]; then # command line has supplied an IP address or "one" if [[ "$CMDLINE_IP" == one ]]; then - # use first IPv6 or IPv4 address - if "$HAS_IPv6" && [[ -n "$ip6" ]]; then + # use first IPv6 or IPv4 address when --ip=one + if "$do_ipv4_only"; then + CMDLINE_IP="$(head -1 <<< "$ip4")" + elif "$do_ipv6_only"; then CMDLINE_IP="$(head -1 <<< "$ip6")" else CMDLINE_IP="$(head -1 <<< "$ip4")" fi fi + # otherwise check what was specified with --ip= NODEIP="$CMDLINE_IP" if is_ipv4addr "$NODEIP"; then ip4="$NODEIP" @@ -22360,49 +22411,42 @@ determine_ip_addresses() { fatal "couldn't identify supplied \"CMDLINE_IP\"" $ERR_DNSLOOKUP fi elif is_ipv4addr "$NODE"; then - ip4="$NODE" # only an IPv4 address was supplied as an argument, no hostname + ip4="$NODE" # only a single IPv4 address was supplied as an argument, no hostname SNI="" # override Server Name Indication as we test the IP only + elif is_ipv6addr "$NODE"; then + ip6="$NODE" + SNI="" else - ip4=$(get_local_a "$NODE") # is there a local host entry? - if [[ -z "$ip4" ]]; then # empty: no (LOCAL_A is predefined as false) - ip4=$(get_a_record "$NODE") - else - LOCAL_A=true # we have the ip4 from local host entry and need to signal this to testssl - fi - # same now for ipv6 - ip6=$(get_local_aaaa "$NODE") - if [[ -z "$ip6" ]]; then - ip6=$(get_aaaa_record "$NODE") - else - LOCAL_AAAA=true # we have a local ipv6 entry and need to signal this to testssl - fi + : # standard case fi - # IPv6 only address - if [[ -z "$ip4" ]]; then - if "$HAS_IPv6"; then - IPADDRs=$(newline_to_spaces "$ip6") - IP46ADDRs="$IPADDRs" # IP46ADDRs are the ones to display, IPADDRs the ones to test + if "$do_ipv4_only"; then + if [[ -z "$ip4" ]]; then + fatal_cmd_line "No IPv4 addresses available, but IPv4-only scan requested" $ERR_CMDLINE fi + IPADDRs2CHECK=$(newline_to_spaces "$ip4") + elif "$do_ipv6_only"; then + if [[ -z "$ip6" ]]; then + fatal_cmd_line "No IPv6 addresses available, but IPv6-only scan requested" $ERR_CMDLINE + fi + if ! "$IPv6_OK"; then + fatal_cmd_line "IPv6 address cannot be reached" $ERR_RESOURCE + fi + IPADDRs2CHECK=$(newline_to_spaces "$ip6") else - if "$HAS_IPv6" && [[ -n "$ip6" ]]; then - if is_ipv6addr "$CMDLINE_IP"; then - IPADDRs=$(newline_to_spaces "$ip6") - else - IPADDRs=$(newline_to_spaces "$ip4 $ip6") - fi - else - IPADDRs=$(newline_to_spaces "$ip4") - fi + for addr in $IPADDRs2SHOW; do + is_ipv6addr $addr && ! "$IPv6_OK" && continue + [[ -z $IPADDRs2CHECK ]] && IPADDRs2CHECK="${addr}" || IPADDRs2CHECK="${IPADDRs2CHECK} ${addr}" + done fi - if [[ -z "$IPADDRs" ]]; then - if [[ -n "$ip6" ]]; then - fatal "Only IPv6 address(es) for \"$NODE\" available, maybe add \"-6\" to $0" $ERR_DNSLOOKUP - else - fatal "No IPv4/IPv6 address(es) for \"$NODE\" available" $ERR_DNSLOOKUP + # If scanning IPV6 doesn't work, put the address to show in round brackets to + # signal the user / UI that those won't be scanned. We don't do that for IPv4, yet + for addr in $IPADDRs2SHOW; do + if is_ipv6addr $addr && ! "$IPv6_OK" ; then + IPADDRs2SHOW=${IPADDRs2SHOW/$addr/($addr)} fi - fi - return 0 # IPADDR and IP46ADDR is set now + done + return 0 } determine_rdns() { @@ -22411,7 +22455,7 @@ determine_rdns() { [[ "$NODNS" == none ]] && rDNS="(instructed to skip DNS queries)" && return 0 # No DNS lookups at all [[ "$NODNS" == min ]] && rDNS="(instructed to minimize DNS queries)" && return 0 # PTR records were not asked for - local nodeip="$(tr -d '[]' <<< $NODEIP)" # for DNS we do not need the square brackets of IPv6 addresses + nodeip="$(tr -d '[]' <<< $NODEIP)" # for DNS we do not need the square brackets of IPv6 addresses OPENSSL_CONF="" # see https://github.com/testssl/testssl.sh/issues/134 if [[ "$NODE" == *.local ]]; then if "$HAS_DSCACHEUTIL"; then @@ -23001,7 +23045,7 @@ determine_optimal_proto() { fi elif "$all_failed"; then outln - if "$HAS_IPv6"; then + if "$IPv6_OK"; then pr_bold " Your $OPENSSL is not IPv6 aware, or $NODEIP:$PORT " fileout "$jsonID" "WARN" "Your $OPENSSL is not IPv6 aware, or $NODEIP:$PORT doesn't seem to be a TLS/SSL enabled server." else @@ -23231,10 +23275,10 @@ display_rdns_etc() { out " Via Proxy: $CORRECT_SPACES" outln "$PROXYIP:$PROXYPORT " fi - if [[ $(count_words "$IP46ADDRs") -gt 1 ]]; then + if [[ $(count_words "$IPADDRs2SHOW") -gt 1 ]]; then out " Further IP addresses: $CORRECT_SPACES" - for ip in $IP46ADDRs; do - if [[ "$ip" == "$NODEIP" ]] || [[ "[$ip]" == "$NODEIP" ]]; then + for ip in $IPADDRs2SHOW; do + if [[ "$ip" == $NODEIP ]] || [[ "[$ip]" == $NODEIP ]]; then continue else further_ip_addrs+="$ip " @@ -23317,28 +23361,27 @@ run_mx_all_ips() { pr_bold "Testing $word MX record (on port $mxport): " fi outln "$mxs" - [[ $mxport == 465 ]] && STARTTLS_PROTOCOL="" # no starttls for tcp 465, all other ports are starttls + [[ $mxport == 465 ]] && STARTTLS_PROTOCOL="" # no starttls for tcp 465, all other ports are starttls for mx in $mxs; do draw_line "-" $((TERM_WIDTH * 2 / 3)) outln parse_hn_port "$mx:$mxport" determine_ip_addresses || continue - if [[ $(count_words "$IPADDRs") -gt 1 ]]; then # we have more than one ipv4 address to check + if [[ $(count_words "$IPADDRs2CHECK") -gt 1 ]]; then # we have more than one ipv4 address to check MULTIPLE_CHECKS=true - if [[ "$HAS_IPv6" ]]; then - pr_bold "Testing all IP addresses (port $PORT): " - else + fi + if "$do_ipv4_only"; then pr_bold "Testing all IPv4 addresses (port $PORT): " - fi - outln "$IPADDRs" - for ip in $IPADDRs; do - NODEIP="$ip" - lets_roll "${STARTTLS_PROTOCOL}" - done + elif "$do_ipv6_only"; then + pr_bold "Testing all IPv6 addresses (port $PORT): " else - NODEIP="$IPADDRs" - lets_roll "${STARTTLS_PROTOCOL}" + pr_bold "Testing all IP addresses (port $PORT): " fi + outln "$IPADDRs2CHECK" + for ip in $IPADDRs2CHECK; do + NODEIP="$ip" + lets_roll "${STARTTLS_PROTOCOL}" + done ret=$(($? + ret)) done draw_line "-" $((TERM_WIDTH * 2 / 3)) @@ -24166,6 +24209,9 @@ initialize_globals() { do_display_only=false do_starttls=false do_rating=false + + do_ipv6_only=false + do_ipv4_only=false } @@ -24200,12 +24246,16 @@ set_scanning_defaults() { do_server_preference=true do_tls_fallback_scsv=true do_client_simulation=true + if "$OFFENSIVE"; then VULN_COUNT=18 else VULN_COUNT=14 fi do_rating=true + + do_ipv6_only=false + do_ipv4_only=false } # returns number of $do variables set = number of run_funcs() to perform @@ -24529,7 +24579,7 @@ parse_cmd_line() { do_winshock=true ((VULN_COUNT++)) ;; - -4|--rc4|--appelbaum) + --rc4|--appelbaum) do_rc4=true ((VULN_COUNT++)) ;; @@ -24855,8 +24905,8 @@ parse_cmd_line() { MTLS="$(parse_opt_equal_sign "$1" "$2")" [[ $? -eq 0 ]] && shift ;; - --connect-timeout|--connect-timeout=*) - CONNECT_TIMEOUT="$(parse_opt_equal_sign "$1" "$2")" + --socket-timeout|--socket-timeout=*--connect-timeout|--connect-timeout=*) + SOCKET_TIMEOUT="$(parse_opt_equal_sign "$1" "$2")" [[ $? -eq 0 ]] && shift ;; --mapping|--mapping=*) @@ -24878,8 +24928,9 @@ parse_cmd_line() { --phone-out) PHONE_OUT=true ;; - -6) # doesn't work automagically. My versions have -DOPENSSL_USE_IPV6, CentOS/RHEL/FC do not - HAS_IPv6=true + -4) do_ipv4_only=true + ;; + -6) do_ipv6_only=true ;; --has[-_]dhbits|--has[_-]dh[-_]bits) # Should work automagically. Helper switch for CentOS,RHEL+FC w openssl server temp key backport (version 1.0.1), see #190 @@ -24954,6 +25005,8 @@ parse_cmd_line() { ((VULN_COUNT++)) fi + "$do_ipv4_only" && "$do_ipv6_only" && fatal_cmd_line "-4 and -6 exclude each other" $ERR_CMDLINE + count_do_variables [[ $? -eq 0 ]] && set_scanning_defaults set_skip_tests @@ -24970,6 +25023,7 @@ parse_cmd_line() { # connect call from openssl needs ipv6 in square brackets +# nodeip_to_proper_ip6() { local len_nodeip=0 @@ -25035,6 +25089,7 @@ stopwatch() { # arg1(optional): "init" --> just initializing. Or: STARTTLS protocol +# lets_roll() { local -i ret=0 local section_number=0 @@ -25248,7 +25303,7 @@ lets_roll() { exit $? fi - [[ -z "$NODE" ]] && parse_hn_port "${URI}" # NODE, URL_PATH, PORT, IPADDRs and IP46ADDR is set now + [[ -z "$NODE" ]] && parse_hn_port "${URI}" # NODE, URL_PATH, PORT, IPADDRs2CHECK and IPADDRs2SHOW is set now prepare_logging if [[ -n "$PROXY" ]] && $DNS_VIA_PROXY; then @@ -25257,29 +25312,27 @@ lets_roll() { RET=$? else determine_ip_addresses - if [[ $(count_words "$IPADDRs") -gt 1 ]]; then # we have more than one ipv4 address to check + if [[ $(count_words "$IPADDRs2CHECK") -gt 1 ]]; then MULTIPLE_CHECKS=true - if [[ "$HAS_IPv6" ]]; then - pr_bold "Testing all IP addresses (port $PORT): " - else - pr_bold "Testing all IPv4 addresses (port $PORT): " - fi - outln "$IPADDRs" - for ip in $IPADDRs; do - draw_line "-" $((TERM_WIDTH * 2 / 3)) - outln - NODEIP="$ip" - lets_roll "${STARTTLS_PROTOCOL}" - RET=$((RET + $?)) # RET value per IP address - done + fi + if "$do_ipv4_only"; then + pr_bold "Testing all IPv4 addresses (port $PORT): " + elif "$do_ipv6_only"; then + pr_bold "Testing all IPv6 addresses (port $PORT): " + else + pr_bold "Testing all IP addresses (port $PORT): " + fi + outln "$IPADDRs2CHECK" + for ip in $IPADDRs2CHECK; do draw_line "-" $((TERM_WIDTH * 2 / 3)) outln - pr_bold "Done testing now all IP addresses (on port $PORT): "; outln "$IPADDRs" - else # Just 1x ip4v to check, applies also if CMDLINE_IP was supplied - NODEIP="$IPADDRs" + NODEIP="$ip" lets_roll "${STARTTLS_PROTOCOL}" - RET=$? - fi + RET=$((RET + $?)) # RET value per IP address + done + draw_line "-" $((TERM_WIDTH * 2 / 3)) + outln + pr_bold "Done testing now all IP addresses (on port $PORT): "; outln "$IPADDRs2CHECK" fi exit $RET