almost done, FILE OUTPUT OPTIONS is probably the last option before moving it to the main tree

Dirk 2017-06-28 21:09:38 +02:00
parent f02c4595a0
commit b269315cbb

@ -5,7 +5,7 @@
### SYNOPSIS
`testssl.sh [OPTIONS] < URI | --file FILE >`
`testssl.sh [OPTIONS] <URI>`, `testssl.sh [OPTIONS] --file <FILE>`
or
@ -19,7 +19,7 @@ The output rate findings by color (screen) or severity (file output) so that you
Except DNS lookups it doesn't use any third parties for checks, it's only you who sees the result and you also can use it internally on your LAN.
Portability is another core feature. testssl.sh runs under any Unix-like stack (Linux, *BSD, MacOS X, WSL=bash on Windows, Cygwin and MSYS2). `bash` (also version 3) is a prerequisite as well as standard utilities like awk, sed, tr and head. This can be of BSD, System 5 or GNU flavor whereas grep from System V is not yet supported.
It is out of the box pretty much portable: testssl.sh runs under any Unix-like stack (Linux, *BSD, MacOS X, WSL=bash on Windows, Cygwin and MSYS2). `bash` (also version 3) is a prerequisite as well as standard utilities like awk, sed, tr and head. This can be of BSD, System 5 or GNU flavor whereas grep from System V is not yet supported. Windows is known to be slow.
### GENERAL
@ -83,6 +83,8 @@ host.example.com:631
-t ftp 10.10.12.11:21
10.10.12.11:8443
```
Please note that `<fname>` has to be in Unix format. DOS carriage returns won't be accepted.
`--mode <serial|parallel>`. Mass testing to be done serial (default) or parallel (`--parallel `is shortcut for the latter, `--serial` 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 `MASS_TESTING_MODE` can be defined to be either equal `serial` or `parallel`.
@ -147,11 +149,12 @@ If the server provides no matching record in Subject Alternative Name (SAN) but
`-x <pattern>, --single-cipher <pattern>` tests matched `<pattern>` of ciphers against a server. Patterns are similar to `-V <pattern> , --local <pattern>`
`-h, --header, --headers` if the service is HTTP (either by detection or by enforcing via `--assume-http` it tests several HTTP headers like
`-h, --header, --headers` if the service is HTTP (either by detection or by enforcing via `--assume-http`. It tests several HTTP headers like
* HTTP Strict Transport Security (HSTS)
* HTTP Public Key Pinning (HPKP)
* Server banner
* HTTP date+time
* Application banner (PHP, RoR, OWA, SharePoint, Wordpress, etc)
* Reverse proxy headers
* Linux or other Unix vendor headers
@ -163,53 +166,56 @@ If the server provides no matching record in Subject Alternative Name (SAN) but
### VULNERABILITIES
(counter)
`-U, --vulnerable` Just tests all (following) vulnerabilities. The environment variable `VULN_THRESHLD` determines after which value a separate headline for each vulnerability is being displayed. Default is `1` which means if you check for two vulnerabilities, only the general headline for vulnerabilities section is displayed -- 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 vulnerabilty 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.
`-U, --vulnerable` Just tests all (following) vulnerabilities. The environment variable `VULN_THRESHLD` determines after which value a separate headline for each vulnerability is being displayed. Default is `1` which means if you check for two vulnerabilities, only the general headline for vulnerabilities section is displayed -- in addition to the vulnerability and the ersult.
`-H, --heartbleed` Checks for Heartbleed, a memory leakage in openssl. Unless the server side doesn'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 `HEARTBLEED_MAX_WAITSOCK`. 8 is the default (unit: seconds)
`-H, --heartbleed` tests for Heartbleed which is an openssl vulnerability. Unless the server side doesn'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 `HEARTBLEED_MAX_WAITSOCK`. 8 is the default (unit: seconds)
`-I, --ccs, --ccs-injection` 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 enviroment variable `CCS_MAX_WAITSOCK`
`-I, --ccs, --ccs-injection` tests 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 enviroment variable `CCS_MAX_WAITSOCK`
`-T, --ticketbleed` Checks for Ticketbleed memory leakage in BigIP loadbalancers
`-T, --ticketbleed` tests for Ticketbleed vulnerability in BigIP loadbalancers
`-R, --renegotiation` Tests renegotiation vulnerabilities. Currently there's a check for "Secure Renegotiation" and for "Secure Client-Initiated Renegotiation". Please be aware that vulnerable servers to the latter can likely be DoSed very easily (HTTP). A check for "Insecure Client-Initiated Renegotiation" is not yet implemented
`-R, --renegotiation` tests for renegotiation vulnerabilities. Currently there's a check for "Secure Renegotiation" and for "Secure Client-Initiated Renegotiation". Please be aware that vulnerable servers to the latter can likely be DoSed very easily (HTTP). A check for "Insecure Client-Initiated Renegotiation" is not yet implemented
`-C, --compression, --crime` Checks for CRIME ("Compression Ratio Info-leak Made Easy") vulnerability in TLS. CRIME in SPDY is not yet being checked for.
`-C, --compression, --crime` tests for CRIME ("Compression Ratio Info-leak Made Easy") vulnerability in TLS. CRIME in SPDY if offered is not yet being checked for.
`-B, --breach` Checks for BREACH ("Browser Reconnaissance and Exfiltration via Adaptive Compression of Hypertext") vulnerability. As for this vulnerabilty HTTP level compressoin is a prerequisite it'll be not tested if HTTP cannot be detected or the detection is not enforced via ``--assume-http`. Please note that only the URL supplied (normally "/" ) is being tested.
`-B, --breach` tests for BREACH ("Browser Reconnaissance and Exfiltration via Adaptive Compression of Hypertext") vulnerability. As for this vulnerabilty HTTP level compressoin is a prerequisite it'll be not tested if HTTP cannot be detected or the detection is not enforced via ``--assume-http`. Please note that only the URL supplied (normally "/" ) is being tested.
`-O, --poodle` Tests for SSL POODLE ("Padding Oracle On Downgraded Legacy Encryption") vulnerability. It basically checks for the existence of CBC ciphers in SSLv3.
`-O, --poodle` tests for SSL POODLE ("Padding Oracle On Downgraded Legacy Encryption") vulnerability. It basically checks for the existence of CBC ciphers in SSLv3.
`-Z, --tls-fallback` 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.
`-Z, --tls-fallback` checks TLS_FALLBACK_SCSV mitigation. It's a ciphersuite
`-W, --sweet32, Checks for vulnerabilty to SWEET32 by testing 64 bit block ciphers (3DES, RC2 and IDEA).
`-W, --sweet32, tests 64 bit block ciphers (3DES, RC2 and IDEA): SWEET32 vulnerability
`-A, --beast` Checks BEAST vulnerabilities in SSLv3 and TLSv1.0 by testing the usage of CBC ciphers.
`-A, --beast` tests for BEAST vulnerability
`-L, --lucky13` Checks for LUCKY13 vulnerability. It checks for the presence of CBC ciphers in all TLS versions.
`-L, --lucky13` tests for LUCKY13 vulnerability
`-F, --freak` Checks for FREAK vulnerability by testing for EXPORT RSA ciphers
`-F, --freak` tests for FREAK vulnerability
`-J, --logjam` Checks for LOGJAM vulnerability by checking for DH EXPORT ciphrs. It also checks for "common primes" which are preconfigured DH keys. DH keys =< 1024 Bit will be penalized
`-J, --logjam` tests for LOGJAM vulnerability and checks for "common primes" which are preconfigured DH keys. DH keys =< 1024 Bit will be penelized
`-D, --drown` Checks for DROWN vulnerability by checking whether the SSLv2 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't check for this but provides a helpful link @ censys.io which provides this service.
`-D, --drown` tests for DROWN vulnerability
`-f, --pfs, --fs,--nsa ` checks (perfect) forward secrecy settings
`-4, --rc4, --appelbaum` which RC4 ciphers are being offered?
`-f, --pfs, --fs,--nsa ` Checks robust (perfect) forward secrecy settings. "Robust" means -- as the headline says -- that ciphers having intrinsic severe weaknesses like "Null Authentication/Encryption, 3DES, RC4" won't be considered here. There shouldn't be the wrong impression that a secure key exchange has been taking place and everything is fine when in reality the encryption sucks. Also this section lists the available elliptical curves.
`-4, --rc4, --appelbaum` Checks which RC4 stream ciphers are being offered.
### OUTPUT OPTIONS
All output options can also be preset via environment variables.
--warnings <batch|off|false> "batch" doesn\'t wait for keypress, "off" or "false" skips connection warning
--openssl-timeout <seconds> useful to avoid hangers. <seconds> to wait before openssl connect will be terminated
--quiet don't output the banner. By doing this you acknowledge usage terms normally appearing in the banner
--wide wide output for tests like RC4, BEAST. PFS also with hexcode, kx, strength, RFC name
--show-each for wide outputs: display all ciphers tested -- not only succeeded ones
`--warnings <batch|off>` The warnings parameter determines how testssl.sh will deal with situations where user input will normally be necessary. There are a couple of options here. `batch` doesn\'t wait for a confirming keypress. This is automatically being chosen for mass testing (`--file`). `-false` just skips the warning AND the confirimation. Please note that there are conflicts where testssl.sh will still asking for confirmation. Those are ones which would have a drastic impact on the results.
The same can be achived by setting the environment variable `WARNINGS`.
`--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 for ~2 minutes. The expected parameter `<seconds>` instructs to wait before 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.
`-q, --quiet` Normally testssl.sh displays on stdout a banner with several version banner, usage rights and a warning. By using this option it'll be supressed. By chosing this option you acknowledge usage terms and the warning normally appearing in the banner.
`--wide` Except the "each cipher output" 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, PFS, 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 `WIDE` can be used instead.
`--mapping <openssl|rfc|no-openssl|no-rfc>`
@ -218,19 +224,34 @@ All output options can also be preset via environment variables.
* `no-openssl`: don't display the OpenSSL cipher suite name, display RFC names only.
* `no-rfc`: don't display the RFC cipher suite name, display OpenSSL names only
--color <0|1|2> 0: no escape or other codes, 1: b/w escape codes, 2: color (default)
`--colorblind` swaps green and blue colors in the output, so that this percentage of folks can distuingish those findings better
`--debug <0-6>`
`--show-each` This is an option for all wide modes -- i.e. per switch or the each cipher test: it displays all ciphers tested -- not only succeeded ones
0. none
1. screen output normal but debug output in temp files.
2. list more what\'s going on, lists some errors of connections
3. slight hexdumps + other info
`SHOW_EACH_C` is your friend if you prefer to set this via the shell environment.
`--color <0|1|2>` It determines the use of colors on the screen: `2` is the default and makes use of ANSI and termcap escape codes on your terminal. `1` just uses non-colored mark-up like bold, italics, underline, reverse. `0` means no mark-up at all = no escape codes.
Setting the environment varable `COLOR` achives the same result.
`--colorblind` 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 distuingish those findings better
`COLORBLIND` is the according variable if you want to set this in the environment
`--debug <0-6>` This gives you additional output on the screen (2-6), only useful for debugging:
0. none (default)
1. screen output normal but debug leaves output in /tmp/testssl.XXXXXX/ . The info about the excat directory is included in the screen output.
2. list more what\'s going on, e.g. lists some errors of connections and general debug statements
3. slightly more info: hexdumps + other info
4. display bytes sent via sockets
5. display bytes received via sockets
6. whole 9 yards
`DEBUG` is the according enviroment variable.
### FILE OUTPUT OPTIONS
A few file output options can also be preset via environment variables.
@ -293,6 +314,7 @@ does the same on the plain text IMAP port. Please note that for plain TLS-encryp
### RFCs and other standards
* RFC 2246: The TLS Protocol Version 1.0
* RFC 2818: HTTP Over TLS
* RFC 2595: Using TLS with IMAP, POP3 and ACAP
* RFC 3207: SMTP Service Extension for Secure SMTP over Transport Layer Security
* RFC 3501: INTERNET MESSAGE ACCESS PROTOCOL - VERSION 4rev1
@ -301,15 +323,20 @@ does the same on the plain text IMAP port. Please note that for plain TLS-encryp
* RFC 4492: Elliptic Curve Cryptography (ECC) Cipher Suites for Transport Layer Security (TLS)
* RFC 5077: Transport Layer Security (TLS) Session Resumption
* RFC 5246: The Transport Layer Security (TLS) Protocol Version 1.2
* RFC 5280: Internet X.509 Public Key Infrastructure Certificate and Certificate Revocation List (CRL) Profile
* RFC 5321: Simple Mail Transfer Protocol
* RFC 5746: Transport Layer Security (TLS) Renegotiation Indication Extension
* RFC 6066: Transport Layer Security (TLS) Extensions: Extension Definitions
* RFC 6101: The Secure Sockets Layer (SSL) Protocol Version 3.0
* RFC 6120: Extensible Messaging and Presence Protocol (XMPP): Core
* RFC 6125: Domain-Based Application Service Identity [..]
* RFC 6797: HTTP Strict Transport Security (HSTS)
* RFC 6961: The Transport Layer Security (TLS) Multiple Certificate Status Request Extension
* RFC 7469: Public Key Pinning Extension for HTTP (HPKP)
* RFC 7507: TLS Fallback Signaling Cipher Suite Value (SCSV) for Preventing Protocol Downgrade Attacks
* RFC 7627: Transport Layer Security (TLS) Session Hash and Extended Master Secret Extension
* RFC 7633: X.509v3 Transport Layer Security (TLS) Feature Extension
* RFC 7465: Prohibiting RC4 Cipher Suites
* RFC 7685: A Transport Layer Security (TLS) ClientHello Padding Extension
* RFC 7905: ChaCha20-Poly1305 Cipher Suites for Transport Layer Security (TLS)
* RFC 7919: Negotiated Finite Field Diffie-Hellman Ephemeral Parameters for Transport Layer Security