Commit Graph
100 Commits
Author SHA1 Message Date
Dirk 3e8d1983b3 reorder / rephrase some points 2020-01-20 12:49:49 +01:00
Dirk 2ea57f0701 Update attributions and Changes for release
If anything is missing or wrong please let us know or do a PR.

(This is until from earlier time to ~2018. >2019 need to follow)
2020-01-17 11:01:41 +01:00
Dirk WetterandGitHub 91e14a3840 Merge pull request #1452 from drwetter/add_1451
Last fine tuning for http basic auth
2020-01-16 16:34:09 +01:00
Dirk WetterandGitHub 0691dc1bf8 Merge pull request #1453 from mkauschi/add-cache-control-header-check
Check for the Cache-Control and Pragma header
2020-01-16 16:25:18 +01:00
Dirk Wetter 4603d924be Last fine tuning for http basic auth
* create roff file and HTML
* add hint to $ENV

Avoid 1x subshell

See #1451.
2020-01-16 14:29:53 +01:00
Dirk WetterandGitHub 700a727f3f Merge pull request #1451 from mkauschi/http-basic-auth-support
Add support for HTTP Basic Auth
2020-01-16 14:13:59 +01:00
Dirk WetterandGitHub 787e575085 Merge pull request #1450 from drwetter/826days_towarn
Add one second for 825 day validity test
2020-01-15 15:38:26 +01:00
Dirk Wetter 38a00f7170 Add one second for 825 day validity test
The CA browser form agreed on a validity period of 825 days or less
(https://cabforum.org/wp-content/uploads/CA-Browser-Forum-BR-1.5.3-redlined.pdf,
p4).

PR #1427 addressed that. However when an issuer signed/issued a certificate
with exactly 825 days, the check reported incorrectly that the life time
is too long.

This commit addressed that by adding a second to the calulation. Also the
output takes into account that it must be over ('>') 825 days, not '>='.
2020-01-15 15:32:32 +01:00
Dirk WetterandGitHub 520a4fbf75 Merge pull request #1449 from drwetter/pr_1070
Reimplement mitigation check (renegotiation->node.js)
2020-01-15 13:09:39 +01:00
Dirk Wetter 2ed317441f Reimplement mitigation check (renegotiation->node.js)
See #1070, kudos @poupas.

In addition it checks whether the first result was positive (in
terms of a finding). If so it does 4 rounds and checks the
result. So that other servers won't be penalized with 4 seconds.
2020-01-15 12:11:57 +01:00
Dirk WetterandGitHub 2a87f7505d Merge pull request #1445 from drwetter/alternative_temppath
Try temp file creation in a different location
2020-01-15 09:59:12 +01:00
Dirk Wetter 50ea6b1891 $PWD check : negate pattern + add $BASH_REMATCH 2020-01-14 22:52:47 +01:00
Dirk Wetter 50c9075ba8 Provide whitelist for $PWD
see #1445
2020-01-14 20:41:08 +01:00
Dirk WetterandGitHub e75ed94573 Merge pull request #1446 from dcooper16/add_missing_declarations
Add missing variable declarations
2020-01-14 20:17:07 +01:00
Dirk Wetter f0f8f3a318 Remove TEMPPATH, make sure PWD doesn't contain a blank 2020-01-14 20:09:46 +01:00
Dirk Wetter 8518284795 Try temp file creation in a different location
... if the standard directory /tmp is not allowed to write to.
As noted in #1273 this might be the case for Termux on Android.
2020-01-14 18:55:09 +01:00
Dirk WetterandGitHub 6378371baa Merge pull request #1443 from dcooper16/no_stdout
Don't write to /dev/stdout
2020-01-14 17:59:32 +01:00
Dirk WetterandGitHub be5a258383 Merge pull request #1441 from dcooper16/fix_run_server_preference
Fix run_server_preference() in --ssl-native mode
2020-01-13 17:41:02 +01:00
Dirk WetterandGitHub ddbfe2d79d Merge pull request #1440 from dcooper16/fix_client_sim
Fix Safari 13.0 Client Simulation
2020-01-13 17:14:43 +01:00
Dirk WetterandGitHub b8e2b35165 Merge pull request #1437 from drwetter/avoid_1435
Avoid conflict of parallel mass scanning + connect timeouts
2020-01-13 11:50:02 +01:00
Dirk Wetter 5c2a9772ea Avoid conflict of parallel mass scanning + connect timeouts
As stated in #1435 when specifying ``-connect-timeout=20`` AND
``--parallel`` there  asa problem with the file handles of child
processes (__testssl.sh: line 10454: 5: Bad file descriptor__).

This commit mitigates that in a sense that both switches can't
be used together. There's a check now in parse_cmd_line().

In addition it addresses a problem when fatal() is called and
e.g. JSON files haven't been created yet (error message ~
__testssl.sh: line 825: : No such file or directory__). It
introduces a global CMDLINE_PARSED which remembers the state
whether ``parse_cmd_line()`` has been fully executed or
not. Only when the former is the case it allows writing to files.
That implies that in main parse_cmd_line() has to be followed
by json_header() and similar.
2020-01-13 10:58:25 +01:00
Dirk WetterandGitHub c375403482 Merge pull request #1436 from drwetter/update_CAstores
Update CA stores
2020-01-11 16:00:16 +01:00
Dirk Wetter a244ef7990 Needed update after putting all CA store here 2020-01-11 11:45:27 +01:00
Dirk Wetter 88e670ab1f Update store
According to MS this is the latest which is from July 2019.
This is the biggest CA store (probably a lot of intermediate
certificates in there).

This was pulled from MS as described in the Readme.md . It
is exactly the same whether CertUtil will be run from Windows 7
(almost: RIP) or Windows 10.
2020-01-11 11:42:30 +01:00
Dirk 40155ed222 Update Java store
Other than before teh Java store was extracted directly from a keystore
from a Java JRE from https://jdk.java.net/.

The Debian keystore used previously used the certificates from the Debian
machine itself (installation script in ``/etc/ca-certificates/update.d/``.
Check with ``keytool -list -rfc -keystore /etc/ssl/certs/java/cacerts | grep -i 'alias'``

As a consequence this store contains less certificates:

etc/Java.pem:90
etc/Linux.pem:128

and needs some testing whether it really should be still included.
2020-01-10 09:17:57 +01:00
Dirk WetterandGitHub 0880e97ab0 Merge pull request #1432 from drwetter/fix_1429
Fix HTTP time for recent OpenBSD
2020-01-09 15:39:31 +01:00
Dirk WetterandGitHub b70407352d Merge branch '3.0' into fix_1429 2020-01-09 14:00:11 +01:00
Dirk Wetter 34784b6c6a Fix HTTP time for recent OpenBSD
See #1429.
OpenBSD 6.6 had an offset with the HTTP header time of  -3600 seconds.
This PR fixes that by adding the GMT time zone to parse_date()'s
HAS_FREEBSDDATE incarnation. That doesn't matter to FreeBSD.

Also now for older OpenBSDs the local and remote time are now
in the same format:

```
HTTP clock skew              remote: Thu, 09 Jan 2020 12:52:32 GMT
                             local:  Thu, 09 Jan 2020 12:52:02 GMT
``

so that a time difference is easier to spot.
2020-01-09 13:52:28 +01:00
Dirk Wetter 7341cac3c2 -add-ca amended 2020-01-09 10:34:07 +01:00
Dirk Wetter 3ff93b4fa6 Update for 3.0 2020-01-09 10:27:09 +01:00
Dirk WetterandGitHub 427341cc9b Merge pull request #1431 from drwetter/fix_1430
Fixes missing display of HTTP headers under OpenBSDs
2020-01-08 16:50:33 +01:00
Dirk Wetter 21f87d7266 Fixes missing display of HTTP headers under OpenBSDs
OpenBSD's grep seems to interpret "-w <EXPR>:" differently
than Linux or MacOSX/FreeBSD in a sense that this doesn't
matchs, see #1430.

This PR fixes that by squashing the w option in all occuorrences.

In addition it removes the SOCKETHEADER if-statement which was
introduced looking forward a while back. It's not happening soon
at least and the variable was not initialized either.
2020-01-08 15:51:21 +01:00
Dirk WetterandGitHub e319d6c01f Merge pull request #1428 from drwetter/correct_warningsoption
Remove --warnings=false from documenation
2020-01-08 14:33:37 +01:00
Dirk WetterandGitHub 256d4d32ab Merge pull request #1427 from drwetter/825_days
Check for certificates with a life time >825 days when issued after 2018/03/01
2020-01-08 14:31:19 +01:00
Dirk Wetter c228b578dd Remove --warnings=false from documenation
... and reorder manpages also so that --warnings, --connect-timeout
and --openssl-timeout appear in the "input parameter" section.

The HTML manpage looks in the diff view quite different as previously
another computer was used for converting the source format with ronn(1).

The manpage in (g)roff format was manually edited with .RE / .RS
for provide indented bulletpoints.

See also #1419
2020-01-08 14:24:41 +01:00
Dirk WetterandGitHub 25913cfa4f Merge pull request #1426 from drwetter/fix_1425
Fix bits errors in OpenBSDs
2020-01-08 11:43:07 +01:00
Dirk b2680db162 Finalize 825 day check, add more OpenBSD date improvements
* It'll be a warning now when a host certificate was issued after
  March 1st, 2018 which has a lifetime >825 days, independent
  whether it is an internal certificate or not. This can
  change later, as browsers treat those certificates different
  as "official ones"
* Still the 5 or 10 year threshold overrides this
* For older OpenBSDs there's now a better date format support
  used in the expiration and validity period of a host certificate.
  It mimics in bash the conversion of other date binaries. It is
  not accurate so it might be off a day or at maximum two, probably
  as a month has 30.42 days and not 30.
* The date output for OpenBSD is now in line with other OS. Previously
  we just echoed the lines in openssl x509 output whereas now we
  convert that
2020-01-08 11:23:11 +01:00
Dirk 554b49bc75 Add David's downgrade checks, Dirk's improvements for OpenBSD 2020-01-08 11:22:09 +01:00
Dirk Wetter 35e6adccc4 Fix bits errors in OpenBSDs
The expression 'grep -aw "Public-Key:"' hiccuped on the colon
under OpenBSD, so that any bitsize on a certificate had wrong
values, see #1425. (FreeBSD was fine)

This PR fixes that. It updates the expression by using awk and
bash internal functions.

The same problem occured in run_robot(). The strong typing of
pubkeybits had to be relaxed to a dynamic typing, unless we
choose to define a second string variable.
2020-01-08 10:56:45 +01:00
Dirk a42b98c0ff Save work
* old OpenBSD kinda works
* let's encrypt section moved so that OpenBSD can use it too

* Days are wrong
* Date format is not the same as with e.g. GNUdate (but should be)
* variables y m d not declared
* date warning for openbsd completely missing
2020-01-07 13:56:08 +01:00
Dirk 7ff4ebfc0c fix travis 2020-01-04 16:52:38 +01:00
Dirk e9108baf93 correct comment 2020-01-04 11:22:45 +01:00
Dirk c80a1307bf Detect 825 days threshold for certificates issued >2018/03/01
... as mentioned #1422

Open
* testing
* openbsd
2020-01-04 11:18:46 +01:00
Dirk WetterandGitHub 1fa0094b3b Merge pull request #1423 from fbacchella/3.0
cert_validityPeriod is wrong.
2020-01-04 10:41:47 +01:00
Dirk WetterandGitHub 1bc50bb7d3 Merge pull request #1421 from drwetter/fix_1418
Fix s_client capability test for LLMNR, add HAS_PKEY
2020-01-02 17:21:48 +01:00
Dirk WetterandGitHub f99959a228 Merge pull request #1420 from vitaliytv/patch-2
Dockerfile: Alpine 3.11
2020-01-02 17:03:11 +01:00
Dirk Wetter accdb3d4f6 Fix s_client capability tet for LLMNR, add HAS_PKEY
As noted in #1418 LLMNR (Link-Local Multicast Name Resolution)
resolution times out when using x as an argument to "-connect".

This commit fixes that by replacing "-connect x" by "-connect invalid."
which is supposedly also generally more "DNS query friendly", see
https://tools.ietf.org/html/rfc6761#section-6.4 .

In addition this commit adds a check in get_common_prime() whether
the openssl version used has pkey support. If not with old openssl
versions and previously testssl.sh terminated after presenting garbledoutput.
(This was found as tested how very old version of openssl versions
handle "-connect invalid.")
2020-01-02 16:16:54 +01:00
Dirk WetterandGitHub 45683f3452 Merge pull request #1378 from dcooper16/unsupported_ossl_protocols
Don't call s_client for unsupported protocol versions
2020-01-02 12:12:43 +01:00
Dirk WetterandGitHub fa5bb18d15 Merge pull request #1416 from drwetter/cipher-categories
Bring pr_cipher_quality() and run_cipherlists() in line
2019-12-24 11:47:41 +01:00
Dirk WetterandGitHub 9f58ba4733 Merge pull request #1417 from dcooper16/fix_tls13_key_derivation
Fix TLS 1.3 key derivation
2019-12-24 11:47:08 +01:00
Dirk Wetter 70112a989e Bring pr_cipher_quality() and run_cipherlists() in line
* Severity of RC4 in run_cipherlists() is now high as everywhere else
* Same for RC2 and DES. Only Export, NULL and ADH remain critical
* 3DES and IDEA in run_cipherlists() is now medium (see #1393)
* CBC3  SEED 3DES IDEA added in pr_cipher_quality()
* MD5 added to pr_cipher_quality() and labled as high
* double RC2 switch statemnet removed in pr_cipher_quality()
2019-12-22 14:41:39 +01:00
Dirk WetterandGitHub 710f915660 update version 2019-12-12 11:34:33 +01:00
Dirk WetterandGitHub db558de147 Merge pull request #1412 from drwetter/minor_code_improvements1
fix errorneous insertion
2019-12-11 22:22:35 +01:00
Dirk c960bd16f9 fix errorneous insertion 2019-12-11 22:20:58 +01:00
Dirk WetterandGitHub 9c2666a2d6 Merge pull request #1411 from drwetter/minor_code_improvements1
Minor internal code improvements
2019-12-11 22:10:07 +01:00
Dirk 849a41a371 Minor internal code improvements
* rename actually_supported_ciphers() to actually_supported_osslciphers()
* remove some redundant quotes at rhs of double brackets checks
2019-12-11 22:07:53 +01:00
Dirk WetterandGitHub 93a1d9441c Merge pull request #1410 from drwetter/drwetter-clpatch
Amend with log for upcoming rc6
2019-12-11 21:49:36 +01:00
Dirk WetterandGitHub 2b08b593a8 Amend with log for upcoming rc6 2019-12-11 21:49:23 +01:00
Dirk WetterandGitHub 442c728187 Merge pull request #1408 from drwetter/connect-timeout
Connect timeout
2019-12-10 21:55:02 +01:00
Dirk 055a2e9bb4 --connect-timeout finalized
* openssl timeout tested
* one openssl related error message fixed when timeout is used (timeout was included)
2019-12-10 21:02:32 +01:00
Dirk 3fdb5617db --connect-timeout 2019-12-10 20:44:55 +01:00
Dirk 20e77318ca Further improving socket connect timeout
* Handle case when "timeout" couldn't be found
* Proper error message when timeout requested but isn't available
* Fix errorneous message in help()
2019-12-10 13:18:45 +01:00
Dirk WetterandGitHub b38e433ec4 Merge pull request #1407 from drwetter/dockerIDcheck
Handle problem when pulling container fails
2019-12-09 11:04:17 +01:00
Dirk 8e02b4a261 Improvements to socket timeouts
* timeouts are not default anymore but need a cmdline param (or ENV param)
* check whether "timeout" exists

Also:
* allow OPENSSL_TIMEOUT to be passed via ENV similar to others
* replace timeout variable in run_robot() by robottimeout, to avoid
  misunderstandings by a human

ToDos: see inline. Mainly if timeout isn't available, testssl.sh doesn't
work.

Not to self: help function still says 60 second is default.
2019-12-09 10:47:58 +01:00
Dirk ce0be5fefc Handle problem when pulling fails
... when e.g. sitting in a German train with bad internet connection
2019-12-09 10:26:39 +01:00
Dirk Wetter b1f4713287 Merge branch '3.0' of https://github.com/goncalor/testssl.sh into goncalor-3.0 2019-12-06 16:29:45 +01:00
Dirk WetterandGitHub c5a13ed689 Merge pull request #1406 from drwetter/drwetter-patch-4
Upgrade to Alpine 3.10
2019-12-03 23:10:20 +01:00
Dirk WetterandGitHub 2cf8997635 Upgrade to Alpine 3.10 2019-12-03 23:10:06 +01:00
Dirk WetterandGitHub 37be442b2b Merge pull request #1405 from dcooper16/fix_http_header_formatting
Fix formatting of HTTP security headers
2019-12-03 23:04:32 +01:00
Dirk WetterandGitHub 9ee0feef3d Merge pull request #1403 from drwetter/drwetter-patch-3
simplify Dockerfile
2019-12-03 12:05:23 +01:00
Dirk WetterandGitHub c163f3ec99 simplify Dockerfile
.. according to  #1402 and #1142
2019-12-03 12:05:07 +01:00
Dirk WetterandGitHub 10fc1416b5 Merge pull request #1401 from drwetter/catch_someuser_errors
Catch user error using --json/--html and friends
2019-12-02 15:39:15 +01:00
Dirk Wetter 4c1bee181b Catch user error using --json/--html and friends
testssl.sh hiccups when a user supplied after --json*/--html/-csv
a filename instead of using the corresponding  --json*file/--htmlfile/-csvfile
arguments, see #1397.

This PR adresses that in a sense that it tries to detect to following
argument of --json*/--html/-csv. If that matches a suspected filename
it bails out using fatal().

This is not intended to be perfect (when the pattern doesn't match)
but catches the user error in an early stage. See also #1398
2019-12-02 15:32:06 +01:00
Dirk WetterandGitHub 58cfe1220b Merge pull request #1396 from dcooper16/align_cipher_rating_numbers
Align cipher rating numbers
2019-12-02 14:26:00 +01:00
Dirk WetterandGitHub b4f69fbdf6 Merge pull request #1400 from drwetter/drwetter-patch-2
Housekeeping
2019-11-27 09:50:02 +01:00
Dirk WetterandGitHub 8e563e5361 Housekeeping
* add --rm
* better description of output
2019-11-27 09:49:51 +01:00
Dirk WetterandGitHub 9ce04a6219 Merge pull request #1399 from max-wittig/patch-1
docs(readme): delete container after run
2019-11-27 09:35:47 +01:00
Dirk WetterandGitHub c645dc9f23 Merge pull request #1395 from drwetter/fix_get_caa
Fix getting CAA record
2019-11-24 20:33:52 +01:00
Dirk Wetter 61bd71bb14 Fix getting CAA record
This resolves a regression introduced with IDN support (see also #1370).

* in check_resolver_bins() the determination of HAS_DIG_NOIDNOUT=true was wrong
* in get_*_record() the check for the bool variable was wrong
* in get_*_record() we shouldn't use quotes as they might be expand to a quoted arg
2019-11-24 20:28:51 +01:00
Dirk WetterandGitHub 4eec2a0981 Merge pull request #1394 from drwetter/drwetter-postgres-gnmap
Fix #1392
2019-11-24 17:09:46 +01:00
Dirk WetterandGitHub 35da8c6fdf Fix #1392
... postgres command building in ``ports2starttls()`` was missing a space.
This is only used when a lookup is performed when supplying a gnmap file.
2019-11-24 17:09:21 +01:00
Dirk WetterandGitHub 32da607acb Merge pull request #1390 from dcooper16/fix_indentation
Fix indentation
2019-11-22 10:06:40 +01:00
Dirk WetterandGitHub c28777aa65 Merge pull request #1383 from szycha76/client-cert-support
Quick'n'dirty client certificate support for s_client
2019-11-21 12:53:51 +01:00
Dirk WetterandGitHub f50cf15bff Merge pull request #1387 from drwetter/polish_output_session_resump_client_auth
Add minor output polish for session resumption and client auth
2019-11-20 20:50:34 +01:00
Dirk Wetter 1366b187d0 Add minor output polish for session resumption and client auth
* remove 2x resumption
* [[ ${SESS_RESUMPTION[2]} =~ clientauth ]] isn't needed.
  otherwise fileout needs also to be changed
2019-11-20 20:47:13 +01:00
Dirk WetterandGitHub 9ce152ba43 Merge pull request #1386 from dcooper16/fix1385
Fix #1385
2019-11-20 20:37:02 +01:00
Dirk WetterandGitHub 1e268eca01 Merge pull request #1381 from drwetter/drwetter-patch-1
add </b>
2019-11-19 12:39:09 +01:00
Dirk WetterandGitHub dc658637a5 add </b>
.. so to speak in addition to #1376
2019-11-19 12:38:58 +01:00
Dirk WetterandGitHub 1c7fe03e20 Merge pull request #1376 from alexander-naumov/3.0
--html option looks like all others
2019-11-19 12:35:40 +01:00
Dirk WetterandGitHub f1677c087b Merge pull request #1380 from drwetter/modernize_isHTML_valid
Modernize 08_isHTML_valid.t a bit ...
2019-11-16 12:46:04 +01:00
Dirk Wetter c643860701 Modernize 08_isHTML_valid.t
and make it similar to 07_isJSON_valid.t or 20_baseline_ipv4_http.t
in terms of output and readability
2019-11-16 12:41:44 +01:00
Dirk WetterandGitHub 325c67d5ef Merge pull request #1379 from drwetter/ticketbleed_minorfix
Ticketbleed fix: shutting down the connection properly
2019-11-16 11:58:52 +01:00
Dirk Wetter 7747128c11 Ticketbleed fix: shutting down the connection properly
In cases where the probes for reading memory from the server side were not
successful (=not vulnerable) the TCP connection was not shut down properly --
leading to and undefined state and probably causing problems to a consecutive
check. The server side then assumably from time to time just didn't return
anything which caused a integration test (t/08_isHTML_valid.t) to fail
randomly.

This PR properly terminates the TCP socket connection. Also, as sending the
close notification before closing the socket was duplicated in testssl.sh
that went to a separate function.

See comment in #1375:
https://github.com/drwetter/testssl.sh/pull/1375#issuecomment-554424814
2019-11-16 11:48:22 +01:00
Dirk WetterandGitHub fbca5d1b3e Merge pull request #1375 from dcooper16/enhance_run_protocols_ssl_
Enhance run_protocols() in --ssl-native mode
2019-11-15 17:11:33 +01:00
Dirk WetterandGitHub 298628995e Merge pull request #1377 from dcooper16/new_ossl_versions
Support new OpenSSL/LibreSSL versions
2019-11-15 17:00:45 +01:00
Dirk WetterandGitHub 93169a3123 Merge pull request #1374 from a666/a666-fix-missing-negation
Fix missing negation in check_resolver_bins
2019-11-11 22:00:26 +01:00
Dirk WetterandGitHub 89dd26e043 Merge pull request #1373 from drwetter/cn+rsolver_fix
Move check_resolver_bins again, handle double CN
2019-11-10 12:55:38 +01:00
Dirk Wetter 90a1455570 Move check_resolver_bins again, handle double CN
When running in debugging mode, HAS_DIG and friends was
still false as check_resolver_bins() was called too late.
This amends basically bac0f66112 .

In cases where a certificate has two CNs, the output contained
a linefeed. This replaces the line feed by a space.
2019-11-10 12:52:12 +01:00
Dirk WetterandGitHub 5c39ceafe1 Merge pull request #1369 from dcooper16/run_protocols_ssl_native1
Fix issues with run_protocols() in --ssl-native mode
2019-11-09 19:57:03 +01:00
Dirk WetterandGitHub 29a2ecf88f Merge pull request #1372 from drwetter/resolverbin_earlier
Earlier initialisation of DNS HAS_* related vars
2019-11-09 19:42:14 +01:00