Commit Graph
100 Commits
Author SHA1 Message Date
Dirk WetterandGitHub 4af901683a Merge pull request #1751 from tosticated/ssl_renego_mod
Modified ssl renegotiation attempts to be variable, default 6.
2020-10-20 21:00:02 +02:00
Dirk WetterandGitHub 1049fe2330 Merge pull request #1749 from definity/3.1dev
Update man pages and CHANGELOG
2020-10-20 11:34:39 +02:00
Dirk WetterandGitHub e51301d9ee Merge pull request #1748 from definity/3.1dev
Added support for custom user agent
2020-10-17 17:04:49 +02:00
Dirk WetterandGitHub b873441238 Merge pull request #1746 from horazont/feature/xmpp-sni
Force SNI to be the --xmpphost if passed
2020-10-16 09:34:45 +02:00
Dirk WetterandGitHub b4c9437e95 Merge pull request #1741 from drwetter/intermediate_cert_improvements
Intermediate cert improvements
2020-10-03 10:21:31 +02:00
Dirk 4ca4e075a2 Use test::diff so that errors are spotted better 2020-10-02 13:07:13 +02:00
Dirk c3f8207d93 Fix Travis + mv issuer line down
Travis failure was due to debug output in function which return a string.
The debug statement was removed, (stderr would have been choice \#2).

Issuer is heading now the intermediate certificate section, not
sure whethe this is redundant info.
2020-10-02 13:00:21 +02:00
Dirk d5a64ff4b6 Further improvements to intermediate certs
* reorder sequence of checks in certificate info so that the chain relevant points are closer
  together
* determine_cert_fingerprint_serial() doesn't need fil input anymore, thus removed that part
* cert_validityPeriod in JSON/CSV may lead to misunderstandings, thus renamed to cert_extlifeSpan
* reorganized loop for the intermediate certificate checks, so that also i is used and not the variable
  which defines the number of certificates, i.e. certificates_provided. In addition made the counting
  more hiuma friendly, which starts now at 1 instead of 0
2020-10-02 08:43:17 +02:00
Dirk a7bcf9ec7f Further improvements to certificate_info()
* add cn and issuer_CN to the output both on screen and file
* the severity rating for intermediates are just a shot (20/40 days) and
  deserve a second thought
* replace the expiry check by one test statement and make grep futile
* replace at some places "$openssl x509 -in $filename"  by  "$openssl x509 <<< $var"
* the thing with 25*60*60 was fie readability. When it's used >20 times it maybe is not
  (and maybe costs to much time) --> replaced by $secsaday
* adjusted the loop for bad ocsp check for readability
2020-10-01 17:49:14 +02:00
Dirk 67afa6c372 MOre points added to complete intermediate cert section
* UI feed back for expiration date of intermediates: 20 days: HIGH, 40 days: MEDIUM
* also in JSON/CSV
* list the end date of validity
* works for >1 intermediates too
* section moved to the end of certificate_info()
* renamed  <cert#${certificate_number}> --> <hostCert#${certificate_number}> to avoid coinfusion with intermediate certs
* removed blanks in return values of determine_dates_certificate
2020-10-01 00:13:31 +02:00
Dirk 5eee67291e Outsourcing of certificate date properties determination
determine_dates_certificate() is now determining the important dates
of a certificate passed via argument. It works of course for host and
any other certificates.
   Returning multiple parameters is being done via CSV and passed to a
read statement which seemed the best choice for bash.

ToDo:

* $expok is not set properly for intermediate certificates
* check if expired at least in the UI (JSON+CSV: echo the dates so far)
* for multiple host certificates the naming scheme (jsonID + intermediate
certnumnber kind of sucks:

          "id"           : "intermediate_cert_fingerprintSHA256 <cert#1> 1",
	  "id"           : "intermediate_cert_notAfter <cert#2> 1",

The whole thing is kind of hackish as the code has been historically grown.
At some certian point we may want to reconsider how we determine properties of
certificates in certificate_info()
2020-09-30 15:44:23 +02:00
Dirk b625df87c1 Move determination of fingerprint and serial to determine_cert_fingerprint_serial()
.. so that it can be used for other certificates than the host certificate
2020-09-28 20:38:37 +02:00
Dirk 9094665768 Start for improving handling of intermediate certs
See #1683, #1653,  #1004, #1264

* separate code for bad ocsp a bit
* output intermediate cert in json/csv
* replace sed statements from cert_fingerprint* and -serial by bash funcs
2020-09-28 20:17:11 +02:00
Dirk WetterandGitHub 3d07f55f56 Merge pull request #1731 from drwetter/winshock_cipher_improvements
Further robustness checks for winshock (#1719)
2020-09-22 17:35:31 +02:00
Dirk 3d22115d92 Fix travis
and remove some not needed quotes in RHS at double square brackets
2020-09-22 16:40:59 +02:00
Dirk 721d046a7f Add the $EXPERIMENTAL part to winshock
... when checking other services as HTTP or RDP
2020-09-22 15:24:41 +02:00
Dirk 7d8cf71a94 Further robustness check to winshock (#1719)
This commit adds

* a check for the elliptical curves
* and a check for TLS extensions

which will again reduces false positives.

Background:
* https://en.wikipedia.org/wiki/Comparison_of_TLS_implementations#Supported_elliptic_curves
* https://en.wikipedia.org/wiki/Comparison_of_TLS_implementations#Extensions

Also:

* Docu phrased more precise (we're not checking ciphers and
  HTTP Server banner only
* As a last resort we also take 'Microsoft-HTTPAPI/2.0' as a server header on the HTTPS branch
  and query the HTTP branch for Microsoft-IIS/8.x.
* $EXPERIMENTAL overrides some banner and service related checks. So that e.g. SMTP servers can also
  be checked. Last but bot least ist's a vulnerability of the TLS stack.

For better debugging we'll keep the TLS extensions and offered curves in a file.
Also it adds a debug1() function which may be needed on other occasions.

Also the output is better coded as we put "check patches locally to confirm"
into a variable.

There's still room for improvement:

* More extensions (see https://raw.githubusercontent.com/cisco/joy/master/doc/using-joy-fingerprinting-00.pdf)
* We could need a separate determine_curves() function, see #1730 as otherwise
  we can't use the curves in a non-default run.
2020-09-22 13:04:18 +02:00
Dirk WetterandGitHub 8d4042c6b6 Merge pull request #1726 from drwetter/fix_1725_SCIR
Fix Secure Client-Initiated Renegotiation false positive (3.1dev)
2020-09-16 20:13:10 +02:00
Dirk ade010d4e7 Fix Secure Client-Initiated Renegotiation false positive
Server side closed the connection but openssl retrieved
a zero exit code. In addition now we look for "closed"
and if that was returned from the server we label it
as not vulnerable.

This fixes #1725
2020-09-16 18:06:21 +02:00
Dirk WetterandGitHub d4a3a67f70 Merge pull request #1723 from drwetter/winshock_cipher_improvements
Add two ECDHE_RSA GCM ciphersuites to prevent FPs for winshock
2020-09-14 20:59:17 +02:00
Dirk 53bef583c6 add GCM in cipher description (debug info) 2020-09-14 19:33:07 +02:00
Dirk 772420cb42 Add two ECDHE_RSA GCM ciphersuites to prevent FPs for winshock
... they appeared later in SChannel, see

https://docs.microsoft.com/en-us/windows/win32/secauthn/cipher-suites-in-schannel
https://notsomany.com/2016/08/26/achieve-a-on-sslabs-iis-8-5-windows-2012-r2/

On famous false positive I discovered by accident was nvd.nist.gov (sigh).
2020-09-14 19:26:18 +02:00
Dirk WetterandGitHub e62a9b8446 Merge pull request #1721 from drwetter/run_ws_default_fix
Winshock should now run also per default
2020-09-09 15:30:05 +02:00
Dirk Wetter 2bdcdd5371 Winshock should now run also per default 2020-09-09 15:29:12 +02:00
Dirk WetterandGitHub 4a120d9a45 Merge pull request #1720 from drwetter/winshock_fingerprint_improvements
Remove false positive for winshock bc of wrong protocol
2020-09-09 13:22:07 +02:00
Dirk Wetter 023005f011 remove false positive for winshock bc of wrong protocol
Also a cipher exclusion list was added, see #1719
2020-09-09 12:15:23 +02:00
Dirk WetterandGitHub edf669711f Merge pull request #1718 from drwetter/winshock
New feature: winshock
2020-09-08 22:11:36 +02:00
Dirk Wetter 0e54075a6a Reverse double dash option for vulnerabilities (cmd line) 2020-09-08 22:09:57 +02:00
Dirk Wetter 1f8e65104c Add winshock to documentation 2020-09-08 22:08:05 +02:00
Dirk WetterandGitHub 794bbe30af Merge pull request #1710 from tosticated/3.1dev
Added check for certificate validity longer than 398 days
2020-09-08 15:37:07 +02:00
Dirk Wetter fe7b51a3e2 remove hint in winshock 2020-09-08 13:42:50 +02:00
Dirk Wetter a1a0605082 add winshock 2020-09-08 13:42:33 +02:00
Dirk Wetter a511da4ce8 New feature: winshock
This commit implements a detection of Winshock from 2014 (aka MS14-066, CVE-2014-6321).

It does that by analyzing
* the ciphers supported -- MS' rollup patch introduced new GCM ciphers
* AND grabbing the server banner which should match IIS 8.0 oder IIS 8.5

Admittedly this is not a strong detection. But it worked in the cases I tested
(no RDP  yet). The other known method remotely testing for it against IIS is
using a patched openssl binary (see https://github.com/drwetter/testssl.sh/issues/331#issuecomment-211534954)
-- the diff "jules" (hi) provided a while back. That seems to stem from securitysift
albeit his decription was not complete and he didn't provide a PoC (I've
seen also polarssl +  a little bit of python here: https://vimeo.com/112089813

The catch is securitysift's method, is not as trivial to implement and it dosses the
sass.exe process, see: http://www.securitysift.com/exploiting-ms14-066-cve-2014-6321-aka-winshock/.

* Todo: man page

This commit also removes -BB from the help. We haven't settled yet finally
where we go with short options for the cmd line for vulnerabilities. One
is for sure though: Using one letter uppercase doesn't scale. As winshock
can be executed with --WS and --winshock --BB brings that in line. For now
also -BB works (as -WS) but it isn't advertised anymore.
2020-09-08 12:37:50 +02:00
Dirk WetterandGitHub b6bab1e1b5 Merge pull request #1715 from drwetter/not_run_allciphers_et_al
Modify default for full 9 yrds run
2020-09-07 21:17:01 +02:00
Dirk Wetter e5d0b3eeac Modify default for full 9 yrds run
We don't need to execute run_cipher_per_proto() in addition here
2020-09-07 09:54:34 +02:00
Dirk WetterandGitHub d424b0c649 Merge pull request #1711 from dcooper16/fix1699
Fix #1699
2020-08-31 17:08:10 +02:00
Dirk WetterandGitHub 09fb279510 Merge pull request #1707 from geert-hendrickx-be/3.1dev
`hostname` is not defined by POSIX, use portable `uname -n` instead.
2020-08-26 18:59:43 +02:00
Dirk WetterandGitHub b4cbe7674a Merge pull request #1704 from drwetter/add_ca_dir
Allow dir with PEM files for --add-CA
2020-08-20 09:19:25 +02:00
Dirk Wetter ecc6cd8160 Allow dir with PEM files for --add-CA
Idea which popped up while following #1700
2020-08-18 21:52:59 +02:00
Dirk WetterandGitHub 565c93e53b Merge pull request #1703 from drwetter/rapydblok
Add https://inspect.rapydblok.com
2020-08-14 10:21:36 +02:00
Dirk WetterandGitHub 7830a22b27 Merge pull request #1702 from drwetter/unrecognized_option--version
Phrase cmd line option "--version" & friends as standalone
2020-08-14 10:20:48 +02:00
Dirk e76de12047 Add https://inspect.rapydblok.com
Fixes #1689
2020-08-13 20:58:15 +02:00
Dirk Wetter 1d954233bd Document is in utf-8
See #1701
2020-08-13 20:43:54 +02:00
Dirk Wetter 953e1bd0ff Phrase --version & friends as standalone
This PR fixes #1671.

Primarily there's now an additional case statement in the main while loop
which just calls fatal() when it detects --help -b --banner -v or --version.

The documentation was also updated to reflect that.

(Some grammar and other errors which I stumbled over were corrected too)
2020-08-13 20:41:57 +02:00
Dirk WetterandGitHub a2929211b2 Merge pull request #1697 from drwetter/no_starttls_detection2
Trying to address no STARTTLS offerings (2)
2020-08-11 16:27:24 +02:00
Dirk WetterandGitHub ee7a21ef76 Merge pull request #1698 from drwetter/mitigate_javastore4rating
Don't penalize rating for CAs which aren't in the Java store
2020-08-11 16:25:25 +02:00
Dirk Wetter 1915a7b624 STARTTLS 2020-08-11 15:41:20 +02:00
Dirk Wetter 4653613211 Add mitigate_javastore4rating 2020-08-11 15:36:43 +02:00
Dirk Wetter c4841c83eb Don't penalize rating for CAs which aren't in the Java store
This fixes #1648.

Java store doesn't seem to be as complete. No downgrading of trust rating
to T but we still need to raise a red flag for some Java clients
2020-08-11 15:30:53 +02:00
Dirk Wetter ac6b64ce36 Trying to address no STARTTLS offerings (2)
This PR will replace #1566. It addresses that if the server side doesn't show STARTTLS
testssl.sh should exit and label it accordingly (see #1536).

For this to achieve starttls_just_send() was were changed so that a return value from of 3
signals the STARTTLS pattern wasn't found is passed back to the parent fd_socket() whcih
will then act accordingly.

Also:
  * starttls_full_read() + starttls_just_send() were improved for readability and debugging.
  * The caller of starttls_full_read() + starttls_just_send() had redundant indentations which were moved to the callee
  * minor bugs were squashed (e.g. ``fd_socket()``'s return values =!0 always  were referring to STARTTLS also when no STARTTLS was requested)

This was tested (negative + test and positive) for FTP and SMTP which worked as expected. For POP, IMAP and NNTP it should work
accordingly but I had trouble finding a server whcih DID NOT support STARTTLS.

All other protocols basically should also cause testssl.sh to bail out but haven't been tested either. However
here starttls_io() won't return 3. It returns 1 in a case of problems. It uses NR_STARTTLS_FAIL. If it's encountered 2+
times that STARTTLS fails it early exists using fatal(). So we maybe want to consider changing starttls_io() in the future
to also use return 3 in the case STARTTLS is not offered.
2020-08-11 12:01:28 +02:00
Dirk WetterandGitHub 186dcfa735 Merge pull request #1696 from dcooper16/fewer_external_function_calls
Use fewer external function calls
2020-08-07 13:17:38 +02:00
Dirk WetterandGitHub d2a44122f2 Merge pull request #1693 from drwetter/more_verbose_starttls
Better debugging of STARTTLS commands
2020-08-04 22:12:36 +02:00
Dirk WetterandGitHub 2e6f912cef Merge pull request #1694 from dcooper16/alpn_grease
Align ALPN GREASE test with RFC 8701
2020-08-04 22:11:12 +02:00
Dirk WetterandGitHub 4da37d9ece Merge pull request #1695 from dcooper16/etls_ossl30
Update ETSI ETS test
2020-08-04 22:06:23 +02:00
Dirk e8a930088c Better debugging of STARTTLS commands
Improved:

* readability of my old code
* readability of debugging statements
* honor $SNEAKY for SMTP greeting
* hook (arg2 to starttls_smtp_dialog() ), if we plan to add / replace SMTP greeting at some point
2020-08-03 23:11:00 +02:00
Dirk WetterandGitHub c3fbc52c07 Merge pull request #1692 from dcooper16/grease_update
Update GREASE reference
2020-08-03 17:17:58 +02:00
Dirk WetterandGitHub 57c2ab1ba1 Merge pull request #1690 from a1346054/3.1dev
Fix minor spelling issue
2020-08-03 08:29:45 +02:00
Dirk WetterandGitHub 7f071ddbb9 Merge pull request #1688 from drwetter/squash_GOST_msg
Squash "No engine or GOST support via engine..."
2020-07-20 20:14:37 +02:00
Dirk 161567f9d2 add quotes 2020-07-20 20:13:41 +02:00
Dirk WetterandGitHub 43c62b13d9 Merge pull request #1687 from drwetter/polish_1686
Polish completion of json/csv output
2020-07-20 15:54:56 +02:00
Dirk a51a0a73a7 Squash "No engine or GOST support via engine..."
This is a legacy warning and seems only needed in a very few cases
whereas in other few cases we don't issue such warnings. So to be
consistent it's right to remove this message as it confuses users
unnecessarily,

It'll appear in debug mode though.

See https://github.com/drwetter/testssl.sh/issues/1119#issuecomment-656271849
2020-07-20 11:43:52 +02:00
Dirk 86c730b74e Polish completion of json/csv output
To be more consistent with the screen output:

* grade --> overall grade
* add rating doc url
2020-07-20 11:34:44 +02:00
Dirk WetterandGitHub 1f388d8b94 Merge pull request #1686 from magnuslarsen/3.1dev
[Rating] Added complete json/csv output
2020-07-20 11:28:35 +02:00
Dirk WetterandGitHub 00779eb639 Merge pull request #1685 from dcooper16/bad_ocsp
Check for bad OCSP intermediate certificates
2020-07-16 19:50:48 +02:00
Dirk WetterandGitHub 19f2c2872a Merge pull request #1680 from drwetter/badocspcert
Implementation of hanno's bad OCSP intermediate CA detector
2020-07-15 11:51:34 +02:00
Dirk d07d1f102e Works now
* open: generation of intermediate certificate files. We do that
  at several places. But for some reasons I do not understand currently
  we remove those files.
* we don't name the offending certificate
2020-07-14 23:42:06 +02:00
Dirk eb7b0c9644 add hash file 2020-07-14 22:26:23 +02:00
Dirk 903eeec97b Start of implementing of hanno's bad OCSP intermediate CA detector
see https://github.com/hannob/badocspcert
2020-07-14 22:23:11 +02:00
Dirk WetterandGitHub 41ac04ef27 Merge pull request #1677 from drwetter/breach2medium
Revised risk for BREACH --> medium
2020-07-10 19:56:53 +02:00
Dirk cec5726f30 Revised risk for BREACH --> medium 2020-07-10 19:52:47 +02:00
Dirk WetterandGitHub b941d7db4a Merge pull request #1674 from dcooper16/rate_ciphers_in_json
Include cipher quality in JSON and CSV
2020-07-10 12:34:06 +02:00
Dirk WetterandGitHub 6071ae9883 Merge pull request #1672 from dcooper16/fix_unrecognized_option
Fix printing of unrecognized option
2020-07-07 15:53:49 +02:00
Dirk WetterandGitHub d881140cac Merge pull request #1669 from dcooper16/separate_pr_cipher_quality
Separate pr_cipher_quality() into two functions
2020-07-07 08:36:31 +02:00
Dirk WetterandGitHub 9122ffec1d Merge pull request #1668 from drwetter/1657_polish
Polish STARTTLS rating output
2020-06-26 10:02:23 +02:00
Dirk Wetter 7c75993746 remove unused spaces var 2020-06-25 20:54:43 +02:00
Dirk Wetter 288223c707 Polish STARTTLS rating output
Moved the sentence ~i "A grade better than T would lead to a false sense of security"
to the documentation. No reason for excuses in the output. ;-) Explanation fits
better in the doc.

See also #1657
2020-06-25 20:47:51 +02:00
Dirk WetterandGitHub ae72592959 Merge pull request #1666 from dcooper16/fix1665
Fix #1665
2020-06-25 20:45:19 +02:00
Dirk WetterandGitHub b1f64a50df Merge pull request #1663 from dcooper16/fix1662
Fix #1662
2020-06-25 13:39:58 +02:00
Dirk Wetter b2d41330e0 port typo fixes to html and roff doc 2020-06-25 13:05:47 +02:00
Dirk WetterandGitHub 55f7f7d69a Merge pull request #1657 from magnuslarsen/3.1dev
[Rating] STARTTLS output styling
2020-06-24 09:51:21 +02:00
Dirk WetterandGitHub 3c30887f39 Merge pull request #1659 from csett86/wireshark-android-7-0
Add wiresharked Android 7.0 (native)
2020-06-24 09:49:24 +02:00
Dirk WetterandGitHub e9d6462ee9 Merge pull request #1656 from magnuslarsen/3.1dev
[Rating] Clearer grade cap reasons
2020-06-19 09:50:24 +02:00
Dirk WetterandGitHub d19aed2345 Merge pull request #1652 from dcooper16/fix_wildcard
Fix and enhance CN matching
2020-06-09 10:48:59 +02:00
Dirk WetterandGitHub 4f13298938 Merge pull request #1651 from dcooper16/missing_space
Fix missing spaces
2020-06-09 09:17:37 +02:00
Dirk WetterandGitHub 6a91dadb31 Merge pull request #1637 from magnuslarsen/3.1dev
[Rating] simple DH group length
2020-06-02 16:48:45 +02:00
Dirk WetterandGitHub 9a22e9af1a Merge pull request #1649 from dcooper16/SC2034
Fix Shellcheck SC2034 issues
2020-06-02 11:08:33 +02:00
Dirk WetterandGitHub 4f9c5158dc Merge pull request #1646 from drwetter/get_TXT_record
Add get_txt_record(), fix variable declaration in get_mx_record()
2020-05-25 21:31:18 +02:00
Dirk a4ae05c90c Add get_txt_record(), fix variable declaration in get_mx_record()
This commit adds a function for querying the TXT DNS record, so
that subsequently we'll can build on top of that a function for
checking MTA-STS, see #1073.

Also it modifies a local variable mxs in get_mx_record() which
was declared as mx but mxs was used. (That is pending an backport
to 3.0.)
2020-05-25 13:23:49 +02:00
Dirk WetterandGitHub e87880ee92 Merge pull request #1643 from dcooper16/EdDSA
Support EdDSA
2020-05-18 14:39:33 +02:00
Dirk WetterandGitHub 42386e512b Merge pull request #1642 from dcooper16/peer_signature_type
Extract server's signature algorithm
2020-05-16 12:46:55 +02:00
Dirk WetterandGitHub 2022754b4a Merge pull request #1636 from drwetter/breach_improvements
Improve compression detection for BREACH
2020-05-12 10:16:14 +02:00
Dirk WetterandGitHub 7fbb79b147 Merge pull request #1638 from dcooper16/fix_show_sigalgo
Fix $SHOW_SIGALGO
2020-05-12 10:13:22 +02:00
Dirk Wetter 78a95d73c8 Add BREACH extension 2020-05-11 14:07:02 +02:00
Dirk Wetter 25f87455a4 Amendment for compression detection (BREACH)
This commit saves more or less time for a detection of the compression.

First it assembles the GET command with all available compressions and send them all.
If the result is negative: we can just tell the finding and return. If it's
positive: We already have identified 1x compression. Then we cycle through the
remaining compressions with single GET requests.

In order to not duplicate code we introduced a helper function sub_breach_helper()
which takes care sending the request and analysis the result.

We treat now failed requests differently: When the first fails we don't
continue anymore.
2020-05-11 13:57:50 +02:00
Dirk Wetter 825cbf7b1d Improve compression detection for BREACH
This commit tries to enummerate through all possible compressions
instead of just raising the arm because of the first one detected.

As far as the performance is concerned there's room for improvements
which subsequent commits will address.
2020-05-11 10:41:48 +02:00
Dirk WetterandGitHub 78612c86a0 Merge pull request #1635 from drwetter/dockerfile+_31dev
Better Dockerfile: doesn't require "git clone"
2020-05-09 13:18:57 +02:00
Dirk d065bda3b8 Better Dockerfile: doesn't require "git clone"
.. see also #1559.

It "mkdirs" the needed etc and bin directories first, then copies
stuff over. It also reduces a few layers.

Also it corrects a mistake in the Readme.md (docker exec --> run)

Thanks for the discussion @Alex131089
2020-05-09 13:17:02 +02:00
Dirk WetterandGitHub bbd46b4e03 Merge pull request #1631 from dcooper16/has_sigalgs
Implement $HAS_SIGALGS
2020-05-09 10:38:03 +02:00
Dirk WetterandGitHub cc8a83ccc0 Merge pull request #1630 from dcooper16/cipher_pre_check_local_problem
Fix "local problem" output in ciher_pref_check()
2020-05-09 10:36:17 +02:00
Dirk WetterandGitHub 6897b4abeb Merge pull request #1632 from unit193/3.1dev
Fix a couple typos in the documentation.
2020-05-09 10:34:44 +02:00