Commit Graph

3665 Commits

Author SHA1 Message Date
084990a890 docs --> doc
fix wrong dir for CI
2022-04-01 14:12:56 +02:00
2078ca52a8 Merge pull request #2134 from drwetter/2074_md_fixes.3.0
Implement fixes in documentation from #2074 (3.0)
2022-04-01 14:08:45 +02:00
61c4aa2cb7 Implement fixes in documentation from #2074 (3.0)
kudos @k0lter

  * numbering
  * some ticks / backticks
2022-04-01 14:03:06 +02:00
7733140e6e Merge pull request #2126 from drwetter/drwetter-patch-1
Remove reference to fixed 3.0.x version
2022-03-16 17:00:17 +01:00
9e14cbf255 Remove reference to fixed 3.0.x version 2022-03-16 16:59:50 +01:00
21fdf5f2de Merge pull request #2121 from dcooper16/ffdhe_supported_groups
Add FFDHE groups to supported_groups
2022-03-09 22:08:44 +01:00
61bbfb4489 Add FFDHE groups to supported_groups
There is at least one server that will not negotiate TLS_DHE_* cipher suites with TLS 1.2 and below if the supported_groups extension is present but does not include any DH groups. This commit adds the DH groups that are currently in the TLS 1.3 ClientHello to the TLS 1.2 and earlier ClientHello.
2022-03-09 15:19:33 -05:00
5e9ee13780 Merge pull request #2119 from dcooper16/rsapss
Include RSA-PSS in ClientHello
2022-03-09 14:14:44 +01:00
f5e75054d3 Include RSA-PSS in ClientHello
This commit changes prepare_tls_clienthello() so that the RSA-PSS algorithms are offered in the signature algorithms extension of TLS 1.2 and below ClientHello messages.
2022-03-09 07:45:52 -05:00
5bd2952108 Merge pull request #2109 from drwetter/bump_version_3.0
Bump version in 3.0 branch
v3.0.7
2022-02-19 14:38:16 +01:00
06821e31ff Codespell 2022-02-19 14:37:14 +01:00
7729fd1267 Add a few items 2022-02-19 14:28:24 +01:00
c6dce9d8b3 Bump patch version number 2022-02-17 09:10:41 +01:00
f96df1138b Merge pull request #2107 from drwetter/fix_2096.3.0
Fix "ID resumption test failed" under Darwin (3.0)
2022-02-17 09:04:57 +01:00
93b9a37c0c Fix "ID resumption test failed" under Darwin (3.0)
Under Darwin using LibreSSL it was not possible to test for session
resumption by session ID.

This fixes the issue #2096 for 3.0 by checking not only the return value of the
s_client hello but also whether a probable certificate is being returned.
2022-02-16 23:18:04 +01:00
de0f4f7a7e Merge pull request #2104 from drwetter/fix_2103
Fix JSON output bc of missing locale in alpine (3.0)
2022-02-16 12:18:26 +01:00
c511319683 Fix JSON output bc of missing locale in alpine (3.0)
It is now being tested whether the binary locale exists and
there's a global introduced for that.

Also there's no fileout warning at this early stage anymore
as it leads to non-valid JSON
2022-02-16 10:45:12 +01:00
a385339b10 Merge pull request #2102 from drwetter/fix_2100_3.0
Fix locale error message when en_US.UTF-8 isn't available (3.0)
2022-02-15 11:10:53 +01:00
f872bd5e3e fix typo 2022-02-14 19:54:08 +01:00
f149c7450a Fix locale error message when en_US.UTF-8 isn't available (3.0)
Therefore a new global function was declared checking whether any of
the known locales work on the client without seeting them.
C / POSIX should work as well for LC_COLLATE.

This fixes #2100 for 3.0 .
2022-02-14 19:52:14 +01:00
8b2fae0e3b Merge pull request #2095 from drwetter/fix_2052.Darwin.3.0
Fix Darwin / LibreSSL startup problem (3.0)
2022-02-02 13:34:38 +01:00
37c6d78bfa Fix Darwin / LibreSSL startup problem (3.0)
This PR addresses a bug where a user encountered the question "The results
might look ok but they could be nonsense. Really proceed".

That happened under Darwin and probably some LibreSSL versions when
checking some hosts. sclient_auth() returned 1 indicating no SSL/TLS
handshake could be established.

This PR modifies sclient_auth() so that in those cases 0 is returned by
skipping the check for the session ID. As NO_SSL_SESSIONID needs to
be set when there's no session ID. This is done separately.

This fixes #2052 for 3.0
2022-02-02 12:20:06 +01:00
1809595576 Merge pull request #2082 from dcooper16/sclient_dev_null_30
Send /dev/null to s_client
2022-01-06 21:19:00 +01:00
a51dfcc498 Send /dev/null to s_client
As discussed in #2079, this commit adds "</dev/null" to calls "$OPENSSL s_client" that are intended to test whether a certain option is supported. This is done to prevent hanging in the case that the option is supported, a TLS server happens to be listening on the port to which s_client tries to connect, and the connection is successful.
2022-01-06 08:23:20 -05:00
82f64a376a Merge pull request #2068 from drwetter/polish+fixhttpclockskew_3.0
Backport HTTP 'Age' header field
2021-12-10 17:43:10 +01:00
fab42dd477 Backport HTTP 'Age' header field
See #2032 / #2067, kudos @Wahnes. This is a backport for 3.0

    Currently, when "HTTP clock skew" is calculated, this is taken to be the
    difference between the timestamp of the moment the HTTPS request was sent and
    the date given in the HTTP Date header. This does not yield valid results in
    case a HTTP cache is used, either on the client side or on the server side.
    According to the HTTP specs, the Date field will contain the timestamp the
    response was created, which may not be the timestamp the response was
    delivered.

    Consider the following example that queries the Varnish project's web server.
    Note that Varnish is a popular HTTP caching server, so HTTP caching will of
    course be used when serving HTTP responses from this project's web server.
    testssl.sh https://varnish-cache.org/ This will typically output a HTTP clock
    skew of some thousand seconds.

    The patch takes into account the HTTP Age header that caching servers add to
    the HTTP response to signal the response's freshness. As client-side caches
    normally do not cache HTTPS requests (except maybe for "enterprise" HTTP proxy
    caches that do MITM HTTPS proxying), this is mostly targeted to HTTPS websites
    that employ server side HTTP caching.

    Addtional polishing:

    * address my comments in #2032
    * add JSON field HTTP_headerAge if they exists
    * output HTTP_AGE if it was detected
    * do stripping of line feeds closer to where variables were set
2021-12-10 15:27:43 +01:00
2cd0ab5b82 Merge pull request #2065 from dcooper16/fix_json_header_30
Fix JSON header in 3.0
2021-12-09 13:17:28 +01:00
9c0fac1790 Fix JSON header
This commit fixes an issue with the headers in the structured JSON output. If run_cipher_match() is performed the header that is used is "pretest" rather than "singleCipher".
2021-12-08 14:38:37 -05:00
bc203c5b4c Merge pull request #2062 from dcooper16/update_host_depended_vars_30
Update reset_hostdepended_vars()
2021-12-08 15:28:22 +01:00
bcc6178c57 Update reset_hostdepended_vars()
This commit adds several variables to reset_hostdepended_vars() that are not currently being reset for each host being tested, but that should be reset.
2021-12-08 09:16:55 -05:00
89bd8294e2 Merge pull request #2058 from mspncp/git-simplify-worktree-check-3.0
Simplify check for git working tree in 3.0
2021-12-07 08:55:24 +01:00
468ade5163 Simplify check for git working tree in 3.0
Sending the entire log to /dev/null is a rather expensive way of checking whether
we are inside a git working tree. Use `git rev-parse --is-inside-work-tree` instead.

(cherry picked from commit 1e3f932932)
2021-12-06 22:20:07 +01:00
6a00a6037c Merge pull request #2051 from dcooper16/fix2049_30
Fix #2049 in 3.0
2021-11-30 14:41:46 +01:00
6888045bc8 Fix #2049 in 3.0
This commit fixes #2049 by converting newline characters to spaces in JSON and CSV findings.

fileout() calls newline_to_spaces() on any $finding that is to be written to a JSON or CSV file. However, this only affects actual newline characters in the string, not escaped newline characters (i.e., "\n"). Escaped newline characters pass through this function unchanged, but then get converted to newline characters when they are written to the JSON and/or CSV files. This commit fixes the problem by also converting escaped newline characters ("\n") to spaces.
2021-11-30 07:29:24 -05:00
c076f5645b Merge pull request #2048 from drwetter/fix_badFileDescriptor_3.0
Fix for "Bad file descriptor" with --connect-timeout option (3.0)
2021-11-29 09:35:00 +01:00
4a02dcb767 Fix for "Bad file descriptor" with --connect-timeout option (3.0)
This fixes #1834 and #1435 for branch 3.0. (3.1dev: #2047)

The --connect-timeout option had the problem that under certain circumstances
like parallel mass scanning didn't work. The culprit was that a subshell command
was used to connect to the target but the file descriptor wasn't exported.

The PR changes the logic so that the connect pre-check is still done in a subshell
If this fails it proceeds with error handling if NR_SOCKET_FAIL is above threshold.
Otherwise it just connects again.
2021-11-28 18:21:43 +01:00
f5bd5d3eac Merge pull request #2045 from dcooper16/fix_sub_cipherlists_30
Fix sub_cipherlists() in 3.0
2021-11-23 10:00:01 +01:00
f7c9030364 Fix sub_cipherlists()
This commit fixes a bug in sub_cipherlists() when using sockets to test whether a server supports a set of ciphers with SSLv2. Code that is supposed to extract the list of SSLv2 ciphers to test for is incorrectly reading from the list of non-SSLv2 ciphers.
2021-11-22 12:29:51 -05:00
11325ff04e Merge pull request #2041 from dcooper16/ossl31_30
Support OpenSSL 3.0.1-dev and 3.1.0-dev
2021-11-11 17:02:23 +01:00
bc2ea32c32 Support OpenSSL 3.0.1-dev and 3.1.0-dev
Same as #2040, but for the 3.0 branch.
2021-11-10 09:16:46 -05:00
d43fa50022 Merge pull request #2027 from dcooper16/improve_cipher_pref_check_30
Improve cipher_pref_check() in 3.0
2021-10-27 21:03:19 +02:00
1e4dd4d1bf Improve cipher_pref_check()
Some servers are configured to prioritize ChaCha ciphers if those ciphers are preferred by the client, even if the server is generally configured to use the server's cipher preferences rather than the client's. As a result of this, if a ChaCha cipher appears in the ClientHello before a non-ChaCha cipher, the server may select the ChaCha cipher even if the server is configured to prefer the non-ChaCha cipher.

In a few cases, e.g., cloudflare.com for TLS 1.2, this affects the ordering of the ciphers presented by cipher_pref_check(). This PR fixes the problem by having cipher_pref_check() (and check_tls12_pref()) always place any ChaCha ciphers at the end of the cipher list in the ClientHello. This ensures that cipher_pref_check() presents the ciphers in the server's preference order.
2021-10-27 12:48:11 -04:00
aaf7248028 Merge pull request #2021 from drwetter/improve_precheck_curves_3.0
Improvement for testing curves with several openssl / libressl versions (3.0)
2021-10-26 12:00:06 +02:00
1b2903e7ac Improvement for testing curves with several openssl / libressl versions
As noted in #2016 the detection of curves in find_openssl_binary()
was not yet perfect.

This commit removes another connect call. Also it corrects the port statement
for LibreSSL-like pre-checks as port 0 generally seems to me better suited.
Inline documentation was added.

It worked so far with OpenSSL 1.0.2, 1.1.1 and 3.0 and LibreSSL 3.4.

This is for 3.0. Similar commit (a11bd1585e)
was for 3.1dev, see PR #2020 .
2021-10-24 22:01:08 +02:00
25a8579a5a Update ISSUE_TEMPLATE.md 2021-10-21 10:53:36 +02:00
0ac95be1fc Merge pull request #2018 from drwetter/cab_is4browsers_3.0
Add browser requirement for the entropy of cert serial (3.0)
2021-10-21 09:50:21 +02:00
a580c20434 Add browser requirement for the entropy of cert serial
see also https://github.com/drwetter/testssl.sh/issues/2013#issuecomment-947834789
2021-10-20 19:41:43 +02:00
3e68dbd8ac Merge pull request #2012 from drwetter/windows_dns_fix_3.0
Addressing lame DNS responses on WSL (3.0)
2021-10-20 08:59:20 +02:00
a3e589e331 Merge pull request #2015 from drwetter/fix_len_certserialnum_3.0
Check cert serial len + fix output when too big (3.0)
2021-10-20 08:58:25 +02:00
36f6093ca9 Check cert serial len + fix output when too big (3.0)
Same as #2014, this is for 3.0 though.

OpenSSL shows certificate serial numbers >35 with a LF (0A). Testssl.sh
just output that which makes JSON invalid and displays the LF in the terminal
too.

This PR fixes that (#2010) by adding text filters so that the
serial number is not a multiline string.

Also this PR introduces a new function: a size check of the cert serial.
Below 8 bytes the CAB Forum's lower limit is hit which says the entropy
from a CSPRNG should be at least 64 bits. It is assumed that below 8 bytes
length this requirement isn't possible to meet (needs to be clarified with
Shannon, 8 bytes seems to low to me).
The high threshold is according to RFC 5280, Section-4.1.2.2 .

See also #2013.

The output has changed, so that on the terminal the serial has one line,
SHA1 and SHA256 each one line. The new json key is "cert_serialNumberLen".
2021-10-19 20:27:43 +02:00