Commit Graph

2855 Commits

Author SHA1 Message Date
Dirk
a1c67c0794 proper English 2024-09-07 16:03:53 +02:00
Dirk
f9edaa7fe1 Phrasing of STARTTLS grading improved
... a a comment added in the desciption.

Unfortunately I couldn't get the line wrapping working.
2024-09-07 15:51:12 +02:00
Dirk
3d2bd5020c fix spellcheck 2024-09-06 13:00:27 +02:00
Dirk
12bc15adc3 misc
- remove 1xLF in UI
- fix obsolete statment for OPENSSL2
2024-09-06 12:53:00 +02:00
Dirk
becd310390 Address open UI problems for TLS 1.3 only hosts
While in 3.2 there was only a hint how to deal with TLS 1.3 only hosts, a restart
with --openssl=/usr/bin/openssl or setting of OSSL_SHORTCUT-true was required.

This PR changes the behavior: if an openssl version can be found in /usr/bin/openssl
(or SUPPLIED via OPENSSL2=/home/version/ofopenssl testssl <cmdline>) which
supports TLS 1.3 it switches automatically and informs the user that it has done so.
   This message is asynchonous and is implemented with a new function check_msg()
and a global OPEN_MSG, so that we maintain the formatting. Otherwise it would have
appeared between rDNS and service detection. Now it's nicely after service detection.
2024-09-06 12:47:03 +02:00
Dirk Wetter
a20fd796e8 Merge pull request #2552 from drwetter/fix_2466
Trailing space after value in header is fine
2024-09-03 20:51:18 +02:00
Dirk Wetter
031c2a55ec Merge pull request #2553 from drwetter/noCtrlCharInHeader
Remove crtl chars from HTTP header
2024-09-03 20:50:18 +02:00
Dirk
2b36b33112 Remove crtl chars from HTTP header
... which fixes #2337
2024-09-03 19:24:46 +02:00
Dirk
30a33e9a6e Trailing space after value in header is fine
This fixes #2466.
2024-09-03 19:10:29 +02:00
Dirk
dbb8fc8013 Fix CI 2024-09-03 18:28:56 +02:00
Dirk
5a1fd2623f Improve banner (3.2)
... for readability and bugs to be filed (fixes #2506)

This PR defines a short string for the OpenSSL banner as some suppliers have made them (unnecessarily) long so that it won't fit nice in the banner anymore.

The banner also now omits the built line from openssl as for the user it is normally not important.
2024-09-03 15:40:55 +02:00
NaN
8a5d534b8a Update testssl.sh
Fix to be consistent in reporting (Not Ok) for ClientHello/ServerHello errors.
2024-08-23 14:19:09 -07:00
Dirk
dd66449a45 Fix IPv6 addresses
Local and ULA and more IPv6 adresses were incorrectly filtered by ``awk '/^[0-9]/ { print $1 }'``
which searches in the first term for only numeric values.

The PR adds a-f and fixes #2529 .
2024-07-22 21:07:50 +02:00
David Cooper
c72f4061b4 Fix #2502
This commit fixes #2502 in the 3.2 branch by checking that the key_share extension is at least 4 bytes long (8 in ASCII-HEX). These 4 bytes encode the group value (2 bytes) and the length of the key (2 bytes).
2024-06-13 05:53:50 -07:00
Dirk
5af152d575 Address overwrite option to --file/-iL with warnings off
When choosing --file or -iL warnings were set in any case to --batch which
needs e.g. crurrenly an interaction when do bacth scanning. This PR enables
to supply WARNINgs / --warnings =off before so that the intercation is mot
needed.

See also #2496.
2024-05-24 13:53:09 +02:00
Dirk
e49747ca14 Add / improve #2490 2024-04-26 16:29:43 +02:00
Dirk
a3d3133c59 Add / improve #2490 2024-04-26 16:10:03 +02:00
Jim
6d2aef5c7d Update testssl.sh
added new line character on line 17366
2024-04-24 15:47:34 -07:00
Emmanuel Fusté
6d80ec189f Small important fixes:
- In case of multiple IP testing, clear ERRFILE bettween runs
- Zero return value with server connection close should be taken into
  account in the looping logic case too. Add it.
- Break the wait loop in case of connection close for faster result.
- Ignore "notAfter" in the wait loop for expired certificates.
- Indentation and tab cleanup.

Tested on 57 url with previously suspicious results with success. No
regressions on 50 others.
2024-03-26 12:23:38 +01:00
Dirk Wetter
375ddf565c Merge pull request #2475 from Tazmaniac/renego_timing_fix2
Renego timing fix2
2024-03-14 13:57:53 +01:00
Maurizio S
a1dae24a20 Fix: modified mtls option location in s_client_options() and code cleanup 2024-03-09 09:21:50 +01:00
Emmanuel Fusté
426bfa6cd5 Fix the cleanup ... 2024-03-06 16:02:19 +01:00
Emmanuel Fusté
2824e347b4 Cleanup bash $(( )) arithmetic usage 2024-03-06 15:44:34 +01:00
Emmanuel Fusté
43e55617bb errorlog filtering fix
Filter out verify and deph lines to not reintrodure timing race
condition.
2024-03-06 14:53:34 +01:00
Emmanuel Fusté
91367caa71 Fix and optimisation
There is a race condition if openssl exit during a renego but after
the RENEGOTIATING printing.
In this case we could issue a R before the process exit and be blocked
in the waiting loop.
With the safety guards in place (loop count + timeout) this is harmless
but not optimal.
Fix this by:
- reordering the sleep vs echo to let the process exit and catch the
  pipe error more frequently.
- exit the while loop if RENEGOTIATING is not the last log line. We
  will catch the pipe error on the next for loop echo.
- correct the k variable initialisation
- correct the for (( ; ; )) variable $ convention usage
- reduce the while loop count limit to 120 to align with the global
  timeout
2024-03-06 13:57:21 +01:00
Emmanuel Fusté
35496e5c5f Clean up watchdog file logic 2024-03-04 19:16:48 +01:00
Emmanuel Fusté
81167dc908 Fixes:
- Add safety gards againts infinite sleep loop
- correct the for loop test
- reverse the watchdog file logic for sleep loop. No timing dependance.
2024-03-04 18:48:21 +01:00
Emmanuel Fusté
8627ba518f Kill the heuristic an count the real number of renegociations
The heuristic is too fragile and timing dependant.

- As for the initial TLS negociation, wait for the result of the
  renegociation request before sending the next one.
- Remove the result ratio calculation and message as we now reach the
  timeout in case of exponential backoff or connection hang.

This commit depend on the fix of the timeout, broken by the zombi fix.
2024-03-01 22:02:00 +01:00
Emmanuel Fusté
2bdbdec5d9 Do not wait on pid you are not a parent.
The zombi fix did too much modifications breaking the global time-out
function.
As the wait $pid failed, we no longer create the watchdog file.
Fix by reverting unnecessary changes.
2024-03-01 17:40:43 +01:00
Dirk
55ae9bf248 Polish PR2461 (mTLS) + label as beta
also revert #1383
2024-02-27 15:59:16 +01:00
Dirk Wetter
94ef475255 Merge pull request #2461 from akabe1/3.2
Add mTLS new feature to support scans with client authentication
2024-02-27 15:47:03 +01:00
Dirk Wetter
f84e8c05f5 Merge pull request #2470 from Tazmaniac/renego_timing_fix
Correct client_renego timing bug.
2024-02-21 17:17:51 +01:00
Emmanuel Fusté
af20952b86 Fix subshell killing to avoid zombies
Learned from the rest of the code ...
2024-02-19 16:19:23 +01:00
Emmanuel Fusté
6277613906 Usual spell fixes. 2024-02-13 15:41:35 +01:00
Emmanuel Fusté
4066766de5 MongoDB identification fix
The actual code grep for "MongoDB" keyword in the head of the HTTP
session.
In case of "compressed" HTML, a big page is on one line.
On a IT page, we could encounter the "MongoDB" keyword and
miss-identify the application protocol.

Fixed by matching on a longuer string taken from a live MogoDB
server.
2024-02-13 15:00:19 +01:00
Emmanuel Fusté
faae91edbc Correct client_renego timing bug.
OpenSSL will buffer only the first command till the establishment of the
session.
In case of slow session establishment, we could:
  * loose some renego trys missing proper mitigation implementation
  * loose some renego trys missing a real vulnerable host if 2/3 of the
    tries are lost during session establishment (very slow startup).

Wait for the session to be fully establised before starting the renego
loop.
2024-02-13 14:40:53 +01:00
Odinmylord
eb661dadb8 Add SNI to ticketbleed check 2024-02-08 15:01:12 +01:00
Maurizio S
ec4ceb2c20 Add mTLS feature
Added new feature to support mutual TLS via client certificate and private key, when a remote server requires client authentication.
2024-01-20 11:49:05 +01:00
Emmanuel Fusté
4cc02a63ef One more spell fix... 2024-01-19 17:09:44 +01:00
Emmanuel Fusté
02a3c2cc14 Fixed regression in printing results
And improve it with the effective number of renego before disconnection
as it is now tracked.
2024-01-19 16:22:50 +01:00
Dirk Wetter
ad04a90b2a Merge pull request #2459 from Tazmaniac/client-renego-fix
Secure Client-Initiated Renegotiation : fixes/enhancements
2024-01-18 18:37:58 +01:00
Emmanuel Fusté
67c362c89a One more spell fix 2024-01-15 10:07:09 +01:00
Emmanuel Fusté
de364b0c84 Introduce SSL_REGEG_WAIT and reduce wait to 0.25s
Reduce wait between reneg test to 0.25s. Still robust and accelerates
the test as now we do up to 10 renego tests.

With the global loop timeout, the backoff identification seem unneeded.
But if we switch to 0.25s, we no longuer trigger the global timeout so
it is still valuable.
Adjust write out messages as bash do not support floating point number
arithmetic.
2024-01-12 11:30:35 +01:00
Emmanuel Fusté
9b79e3917a Bump SSL_RENEG_ATTEMPTS=10 for Stormshield
Stormshield allows 9x and then blocks. So then 10x should be tested.
Example: https://ems.ocapiat.fr
2024-01-11 18:34:47 +01:00
Emmanuel Fusté
b793f54c3e Add timeout for the client initiated renego loop
Some site hang/block the connection after some renego reties
Example: https://feedback.amadeus.com

Hand written timeout logic because:
- we want to get the result of the command in case of normal exit
- we want to have working log fd redirection
- we want to known the timeout condition
2024-01-11 18:30:44 +01:00
Emmanuel Fusté
d30d8e09f2 tab/space corrections and "grep -ac" in place of "grep -a | wc -l" 2024-01-10 18:31:41 +01:00
Dirk Wetter
810e870d16 Merge pull request #2454 from Odinmylord/3.2
Make cert_keysize output consistent
2024-01-10 12:21:42 +01:00
Odinmylord
e404cf8bdb add utf8 support to intermediate cert names 2024-01-03 14:27:11 +01:00
Odinmylord
f4b1bb28a0 Update certificate_info function to include key algorithm in error messages 2024-01-02 14:06:18 +01:00
Dirk Wetter
3f9cc7b6a5 Merge pull request #1871 from dcooper16/quit_on_cmd_line_errors
Quit testssl.sh on all command line errors
2023-12-24 15:34:00 +01:00