Commit Graph
100 Commits
Author SHA1 Message Date
Dirk Wetter 6bd0d9eba0 Add prototype for STARTTLS+ LDAP via sockets
See #1258

To do:
* more robustness. At least the success value from the response need to be retrieved and checked via starttls_io().
* double check the pre-handshake before the OID whether it's correct for every case
* documentation
* inline help

It seems to work though against db.debian.org
2022-04-01 12:45:59 +02:00
Dirk WetterandGitHub 4a358e0489 Merge pull request #2081 from dcooper16/sclient_dev_null
Send /dev/null to s_client
2022-01-06 21:17:40 +01:00
Dirk WetterandGitHub e35f0e8ed7 Merge pull request #2078 from drwetter/feature_dig_2077
Add +search to dig
2022-01-03 17:50:21 +01:00
Dirk Wetter c573984340 Add +search to dig
... for all forward + non-mdns lookups.

This might help to avoid supplying domain names to local hosts (they would need
to have a valid certificate for the short DNS name then).

Fixes #2077
2022-01-03 16:44:09 +01:00
Dirk WetterandGitHub 3827521698 Merge pull request #2075 from drwetter/drwetter-patch-1
again wide screen mode for HTML
2021-12-27 17:11:36 +01:00
Dirk WetterandGitHub 1012a28958 again wide screen mode for HTML
see discussion on #2072
2021-12-27 17:09:59 +01:00
Dirk WetterandGitHub 9d37365a0d Merge pull request #2072 from k0lter/3.1dev
Add sieve protocol support when using STARTTLS
2021-12-27 17:07:10 +01:00
Dirk WetterandGitHub 35ddd91813 Merge pull request #2073 from drwetter/dependabot/github_actions/docker/login-action-1.12.0
Bump docker/login-action from 1.10.0 to 1.12.0
2021-12-21 10:54:58 +01:00
Dirk WetterandGitHub 2201a28070 Merge pull request #2069 from h3xx/refactor-strip_quote
Refactor strip_quote to use bash replacements instead of sed
2021-12-13 18:24:34 +01:00
Dirk WetterandGitHub c1e5ad82c1 Merge pull request #2070 from drwetter/gha_actions_improve
Also run GHA for PRs
2021-12-13 18:19:49 +01:00
Dirk WetterandGitHub 6da72bcfd7 Merge pull request #2067 from drwetter/polish_fixhttpclockskew
Consider HTTP 'Age' header field when calculating HTTP clock skew
2021-12-10 20:16:28 +01:00
Dirk Wetter fc06fcee56 fix travis 2021-12-10 18:26:03 +01:00
Dirk Wetter 7974e57688 add extra line for Age 2021-12-10 16:06:26 +01:00
Dirk Wetter 18f3ad7c31 fix travis 2021-12-10 15:58:10 +01:00
Dirk Wetter e871bd0911 Polish PR #2032 + Additions
* address my comments
* add json fields HTTP_headerTime + 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 14:27:30 +01:00
Dirk Wetter d6398c3167 Merge branch 'fixhttpclockskew' of https://github.com/Wahnes/testssl.sh into Wahnes-fixhttpclockskew 2021-12-10 12:06:19 +01:00
Dirk WetterandGitHub 2dce751bfa Merge pull request #2055 from dcooper16/fix2053
Fix #2053
2021-12-09 17:03:57 +01:00
Dirk WetterandGitHub 0118603401 Merge pull request #2064 from dcooper16/fix_json_headers
Fix JSON section headers
2021-12-09 13:16:50 +01:00
Dirk WetterandGitHub beac382673 Merge pull request #2063 from dcooper16/keyopts
Document $keyopts
2021-12-08 19:29:40 +01:00
Dirk WetterandGitHub dc782a895c Merge pull request #2059 from dcooper16/simplify_git_rel
Simplify extracting Git information
2021-12-08 11:50:55 +01:00
Dirk WetterandGitHub 187854bd60 Merge pull request #2061 from dcooper16/update_reset_hostdepended_vars
Update reset_hostdepended_vars()
2021-12-08 11:49:10 +01:00
Dirk WetterandGitHub 04b7e1e7c3 Merge pull request #2060 from dcooper16/shellcheck
Fix some Shellcheck issues
2021-12-07 20:26:00 +01:00
Dirk WetterandGitHub 0eb73d949a Merge pull request #2056 from drwetter/update_ua_sneaky
Update Firefox UA used in sneaky mode
2021-12-07 08:55:54 +01:00
Dirk WetterandGitHub 22272105c4 Merge pull request #2057 from mspncp/git-simplify-worktree-check
Simplify check for git working tree
2021-12-06 18:35:24 +01:00
Dirk Wetter 914dde501a Update Firefox UA used in sneaky mode
From FF 52 to FF 94.

Also one double quote was removed
2021-12-03 13:15:13 +01:00
Dirk WetterandGitHub f6571c7c76 Merge pull request #2050 from dcooper16/fix2049
Fix #2049
2021-11-30 11:19:44 +01:00
Dirk WetterandGitHub b40d38fc37 Merge pull request #2047 from drwetter/fix_badFileDescriptor
Fix for "Bad file descriptor" with --connect-timeout option
2021-11-28 18:11:36 +01:00
Dirk aca75822c1 Fix for "Bad file descriptor" with --connect-timeout option
This fixes #1834 and #1435.

The --connect-timeout option had the problem that under certain circumstances
like parallel mass scanning it 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 commit changes tha logic so that this connect is still done in a subshell
as a pre-check if it's possible to connect. If this fails it proceeds with
error handling if NR_SOCKET_FAIL is above threshold. Otherwsie it just connects
again.

When testing of the alexa 500 it worked for me(tm). It would be great if others
can give it a try.
2021-11-26 17:24:02 +01:00
Dirk WetterandGitHub f253920e92 Merge pull request #2044 from dcooper16/fix_sub_cipherlists
Fix sub_cipherlists()
2021-11-23 09:59:41 +01:00
Dirk WetterandGitHub 7e7458bff0 Merge pull request #2043 from dcooper16/shellcheck
Fix some Shellcheck issues
2021-11-16 17:28:14 +01:00
Dirk WetterandGitHub 92a0da1d75 Merge pull request #2042 from dcooper16/check_file_permissions
Check file permissions on ./testssl.sh
2021-11-16 17:25:38 +01:00
Dirk WetterandGitHub 1b11575c28 Merge pull request #2040 from dcooper16/ossl31
Support OpenSSL 3.0.1-dev and 3.1.0-dev
2021-11-10 08:12:30 +01:00
Dirk WetterandGitHub 883d7bd237 Merge pull request #2039 from dcooper16/fix_debugme1_redirect
Fix calls to debugme1() with redirects
2021-11-10 08:09:22 +01:00
Dirk WetterandGitHub b7d6b7ca7b Merge pull request #2034 from magnuslarsen/3.1dev
[Rating] Fix cipher rating, and add penalty for weak ciphers
2021-11-06 12:20:18 +01:00
Dirk WetterandGitHub 75dd8fc89b Merge pull request #2031 from dcooper16/fix2030
Fix 2030
2021-10-29 09:14:27 +02:00
Dirk WetterandGitHub b00e065546 Merge pull request #2028 from dcooper16/prioritize_chacha
Fix #1733
2021-10-28 09:09:53 +02:00
Dirk WetterandGitHub 1dc858dc90 Merge pull request #2026 from dcooper16/speedup_cipher_pref_check
Speedup cipher_pref_check()
2021-10-27 10:04:13 +02:00
Dirk WetterandGitHub 6f6eec25c1 Merge pull request #2025 from dcooper16/remove_extra_colon
Remove extra colon
2021-10-27 10:02:47 +02:00
Dirk WetterandGitHub dc074ebdf1 Merge pull request #2024 from dcooper16/improve_cipher_pref_check
Improve cipher_pref_check()
2021-10-26 20:40:58 +02:00
Dirk WetterandGitHub 1a66155c4a Merge pull request #2022 from dcooper16/fix_s_client_options
Fix s_client_options()
2021-10-25 19:02:07 +02:00
Dirk WetterandGitHub e36cfffb2c Merge pull request #2020 from drwetter/improve_precheck_curves
Improve precheck for curves
2021-10-23 23:02:21 +02:00
Dirk Wetter 31162d2320 typo / wording 2021-10-23 18:40:29 +02:00
Dirk Wetter a11bd1585e Improvement for testing curves with several openssl / libressl versions
As noted in #2016 the detection of curves in find_openssl_binary()
copuld be improved.

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 needs to be backported to 3.0.
2021-10-23 18:38:04 +02:00
Dirk WetterandGitHub 6251a6c1d6 Merge pull request #2016 from drwetter/fix_double_ports
Fix double ports statement
2021-10-23 16:02:04 +02:00
Dirk WetterandGitHub 82fc8e7431 Update feature_request.md 2021-10-21 11:01:13 +02:00
Dirk WetterandGitHub d5e761e9e9 Update bug_report.md 2021-10-21 11:00:44 +02:00
Dirk WetterandGitHub 93c1180f9d Update feature_request.md 2021-10-21 10:56:27 +02:00
Dirk WetterandGitHub ff919df2e0 Update bug_report.md 2021-10-21 10:52:34 +02:00
Dirk WetterandGitHub 489b63e9dd Merge pull request #2017 from drwetter/cab_is4browsers
Add browser requirement for the entropy of cert serial
2021-10-21 09:51:00 +02:00
Dirk Wetter 110d1aa73c Add browser requirement for the entropy of cert serial 2021-10-20 19:26:23 +02:00
Dirk Wetter 3140352b0c Fix double ports statement
In order to be in line with 3.0 this adds a statement to avoid double port
statements for WSL users in a precheck condition

   $OPENSSL s_client -groups $curve -connect 127.0.0.1:0:8443

This commit changes that to $OPENSSL s_client -groups $curve -connect 127.0.0.1:8443
which could cause a delay for WSL users and needs further investigation.

Not clear why port 8443 was chosen.
2021-10-20 09:01:09 +02:00
Dirk WetterandGitHub 79df758023 Merge pull request #2014 from drwetter/fix_len_certserialnum
Check cert serial len + fix output when too big
2021-10-20 08:58:46 +02:00
Dirk Wetter 2edfa57eaa Check cert serial len + fix output when too big
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 commit fixes that (#2010) by adding filters so that the
serialnumber is not a multiline string.

Also this commit 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 19:42:12 +02:00
Dirk WetterandGitHub 9683af44a2 Merge pull request #1988 from drwetter/windows_dns_fix
Addressing lame DNS responses on WSL
2021-10-18 16:52:35 +02:00
Dirk WetterandGitHub d496c0d44b Merge pull request #2002 from smokris/1995-trusted-first
In determine_trust(), use the OpenSSL '-trusted_first' flag to ignore the now-expired DST Root CA X3 root certificate
2021-10-07 18:03:20 +02:00
Dirk WetterandGitHub d720720150 Merge pull request #2005 from drwetter/fix_1992_certificateIssuerName
Fix invalid JSON when certificate issuer contains non-ASCII chars
2021-10-03 19:52:35 +02:00
Dirk a5aa3a4bbf Fix invalid JSON when certificate issuer contains non-ASCII chars
Changed printf %s to printf %b which cause now to output
UTF-8 correctly.

See #1992
2021-10-03 18:19:24 +02:00
Dirk Wetter b6b5a67b92 Save # of connects / WSL uses 127.0.0.1:0 by default
In order to save time and to spare WSL users lame DNS lookups
I removed a couple of connect calls from 14 to 4:

$OPENSSL s_client -ssl2 -connect invalid.
-->
OPENSSL s_client -ssl2

NXCONNECT to localhost IP and port 0 is now the default when WSL
is detected. Not sure whether this is working under all circumstances,
so this needs some testing.
2021-10-02 15:25:42 +02:00
Dirk WetterandGitHub 068e07c52c Merge pull request #1997 from mig5/fix-letsencrypt-remove-dst-root-x3-ca-cert
Remove the expired DST Root CA X3 cert from all trust stores, and ensure Mozilla's is up to date (fixes ISRG X1 alternate path)
2021-10-02 08:38:34 +02:00
Dirk WetterandGitHub bab14124c1 Merge pull request #2001 from drwetter/revert-1998-1995-trusted-first
Revert "In determine_trust(), use the OpenSSL '-trusted_first' flag to ignore the now-expired DST Root CA X3 root certificate"
2021-10-02 08:34:07 +02:00
Dirk WetterandGitHub e874c1013b Revert "In determine_trust(), use the OpenSSL '-trusted_first' flag to ignore the now-expired DST Root CA X3 root certificate" 2021-10-02 08:33:39 +02:00
Dirk WetterandGitHub 624e934f77 Merge pull request #1998 from smokris/1995-trusted-first
In determine_trust(), use the OpenSSL '-trusted_first' flag to ignore the now-expired DST Root CA X3 root certificate
2021-10-02 08:33:03 +02:00
Dirk WetterandGitHub 667c6e698c Merge pull request #1996 from dcooper16/fix_md_formatting
Update testssl.1.md
2021-10-01 18:02:03 +02:00
Dirk WetterandGitHub b8bff805f7 Merge pull request #1991 from klaernie/contenttype
fix html output content type header
2021-09-24 14:21:04 +02:00
Dirk WetterandGitHub ae21ef7eab Merge pull request #1987 from drwetter/fix_1982_kali.cnf
Fix #1982: Newer openssl.cnf break openssl detection
2021-09-15 11:19:05 +02:00
Dirk Wetter fe6c22f7fd Addressing lame DNS responses on WSL (WIP)
This commit provides a global variable to the RFC 6761 use of "invalid."
which WSL clients doen't seem to handle very well, see #1738, #1812.

With this commit it e.g. is possible to use

     NXCONNECT=localhost:0 ./testssl.sh <TARGET>

to save some time.

This commit will be amended later.
2021-09-15 09:53:20 +02:00
Dirk Wetter 2405176a26 Fix #1982: Newer openssl.cnf break openssl detection
Newer configuration files from openssl may include statements
which aren't compatible with our supplied old openssl version.
This commit adds an autodetection of such a file and uses a
openssl.cnf provided by this project then.
2021-09-15 09:31:03 +02:00
Dirk WetterandGitHub 3207357e8c Merge pull request #1985 from DimitriPapadopoulos/codespell
Typos found by codespell
2021-09-14 13:37:59 +02:00
Dirk WetterandGitHub 3dddcbf445 Merge pull request #1983 from drwetter/drwetter-patch-1
Update bug_report.md
2021-09-10 18:37:43 +02:00
Dirk WetterandGitHub 611754165f Merge pull request #1984 from drwetter/drwetter-patch-2
Update feature_request.md
2021-09-10 18:37:17 +02:00
Dirk WetterandGitHub 5fc23932ac Update feature_request.md 2021-09-10 18:37:02 +02:00
Dirk WetterandGitHub 2f173de7e0 Update bug_report.md 2021-09-10 18:33:39 +02:00
Dirk WetterandGitHub 1d4acd9027 Merge pull request #1981 from drwetter/fix_1978
Fix minor inconsistency in description of cipher categories
2021-09-10 08:09:21 +02:00
Dirk 529e9da823 Fix GHA (starttls nntp)
using another IP
2021-09-09 23:17:09 +02:00
Dirk 15cfd849fe Replace --standard by --categories 2021-09-09 22:07:44 +02:00
Dirk 739f45015f Fix minor inconsistency in description of cipher categories
A longer while back the section ~ "Testing standard ciphers" was
renamed to "Testing cipher categories". However the internal help
didn't reflect that.

This fixes that, including an addtion to the documentation.

Note: the help still lists "-s --std, --standard" as a cmd line
switch.
2021-09-08 08:46:47 +02:00
Dirk WetterandGitHub 8f20d11830 Merge pull request #1976 from ap-wtioit/3.1dev-fix_dig_r_check
Fix dig -r check to only run if dig is available
2021-09-06 10:19:41 +02:00
Dirk WetterandGitHub 15e6fb4c9c Merge pull request #1975 from a1346054/fixes
WIP: Minor cleanup
2021-09-05 15:50:11 +02:00
Dirk WetterandGitHub 05ef9f91b6 Merge pull request #1972 from drwetter/fix_dig-r
Fix cases where dig -r wasn't working
2021-09-01 19:50:15 +02:00
Dirk bc742e0ea4 Amend previous commit
* add -q in grep statement to make sure the console stays clean
* redo check for noidnout by also using the help function of dig
2021-09-01 18:44:28 +02:00
Dirk f8a87315cf Fix cases where dig -r wasn't working
* the ignore ~/.digrc option from dig is now parsed from the builtin help
* there was a potential DNS call which is now avoided
* for +noidnout check however there's a call to invalid. added
* the OPENSSL_CONF="" in check_resolver_bins() was moved a few lines
  higher to avoid other errors in the terminal

Tested on (EOL) Ubuntu 14.04 which only has dig in an older version

See also #1950
2021-09-01 18:28:12 +02:00
Dirk WetterandGitHub ad3f7c3438 Merge pull request #1970 from drwetter/dependabot/github_actions/docker/build-push-action-2.7.0
Bump docker/build-push-action from 2.6.1 to 2.7.0
2021-08-30 10:19:39 +02:00
Dirk WetterandGitHub 9eaccee776 Merge pull request #1962 from dcooper16/fix1961
Fix #1961
2021-08-27 09:35:04 +02:00
Dirk WetterandGitHub be22ae2cf9 Merge pull request #1968 from jauderho/3.1dev
Add GH Action to build Docker images
2021-08-27 09:32:01 +02:00
Dirk WetterandGitHub f15da8d15d Merge pull request #1966 from drwetter/no_starttls
Add CVEs for No-STARTTLS vulnerability
2021-08-08 21:33:14 +02:00
Dirk aaf6409581 Add CVEs for No-STARTTLS vulnerability
In text output only the original one from Wietse Venema.
The other known so far in JSON/CSV
2021-08-08 21:30:35 +02:00
Dirk WetterandGitHub 89de30c867 Merge pull request #1965 from jauderho/gha_build_status
Update build status to reflect use of GHA
2021-08-08 14:00:14 +02:00
Dirk WetterandGitHub 77e47cadff Merge pull request #1963 from drwetter/fix_1956_3.1dev
Redirect debugme() outputs to stderr (3.1dev)
2021-08-07 16:18:43 +02:00
Dirk WetterandGitHub c1253f2cd0 Merge pull request #1953 from jauderho/3.1dev
Add Dependenbot checking for GitHub Actions
2021-08-07 16:17:33 +02:00
Dirk WetterandGitHub 7b0947c290 Merge pull request #1958 from dcooper16/use_all+
Use all+ in calls to tls_sockets()
2021-08-07 16:04:07 +02:00
Dirk 3f8c62dc41 Change debugme1 calls to include redirection from stderr back to stdout
The fact that debugme1() redirects to stderr and the calls to this functions
redo that is deliberately as in the future we might want to use debugme1
without redirection.
2021-08-07 15:26:51 +02:00
Dirk 4e01f86c99 Redirect debugme() outputs to stderr (3.1dev)
... to address #1956 and other places. Similar to #1957,
only for the 3.1dev rolling release branch.

Also it changes debugme1() back? to output debug
statements only when $DEBUG >= 1. Per default here
also stderr is used.
2021-08-07 15:20:09 +02:00
Dirk WetterandGitHub 1739ae1400 Merge pull request #1960 from dcooper16/certificate_compression
Check for RFC 8879 certificate compression
2021-08-05 16:51:03 +02:00
Dirk WetterandGitHub b603d57146 Merge pull request #1952 from drwetter/fix_1717
Look-ahead trick for -U --ids-friendly
2021-08-01 17:47:11 +02:00
Dirk WetterandGitHub a3ab6cd887 Merge pull request #1950 from drwetter/digrc
Ignore $HOME/.digrc
2021-07-31 18:49:57 +02:00
Dirk 6cf7521184 Look-ahead trick for -U --ids-friendly
If the order of the cmdline is '-U --ids-friendly' then we need to make sure we catch --ids-friendly. Normally we do not,
 see #1717. The following statement makes sure. In the do-while + case-esac loop  the check for --ids-friendly will be
executed again, but it does not hurt
2021-07-31 18:27:03 +02:00
Dirk 439aad1f22 Ignore $HOME/.digrc
Newer dig versions have an option to ignore $HOME/.digrc, older don't.

This commit adds a patch checking for the availability of such an option and
uses it by default. See #1894 .

If this option doesn't exist then still dig is used and can still lead to
wrong output. Unfortunately Debian-based distros are not very
good at this. Debian 10, Ubuntu 18.04 still use dig 9.11, whereas
Opensuse 15.2 has 9.16. Debian 11 and Ubuntu 20.04 use that too.
2021-07-31 15:14:22 +02:00
Dirk WetterandGitHub c40a3a7d02 Merge pull request #1946 from drwetter/noitalics4screen
Disable ANSI codes for italic when TERM == screen
2021-07-31 13:57:11 +02:00
Dirk 525a40a653 Disable ANSI codes for italic when TERM == screen
... otherwise it is being printed in reverse, see #1928.
2021-07-31 13:17:55 +02:00
Dirk WetterandGitHub 46862ecc84 Merge pull request #1945 from drwetter/alpine
Upgrade to alpine 3.13
2021-07-30 18:01:25 +02:00