mirror of
				https://github.com/drwetter/testssl.sh.git
				synced 2025-10-30 21:35:26 +01:00 
			
		
		
		
	Merge branch '3.2' into diffing_openssls
This commit is contained in:
		| @@ -1,6 +1,6 @@ | ||||
| #!/usr/bin/env perl | ||||
|  | ||||
| # disabled as IPv6 is not supported by Travis, see https://github.com/drwetter/testssl.sh/issues/1177 | ||||
| # disabled as IPv6 wasn't supported by Travis CI and isn't by GH action, see https://github.com/testssl/testssl.sh/issues/1177 | ||||
|  | ||||
| # Just a functional test, whether there are any problems on the client side | ||||
| # Probably we could also inspect the JSON for any problems for | ||||
|   | ||||
| @@ -3,11 +3,10 @@ | ||||
| # Baseline diff test against testssl.sh (csv output) | ||||
| # | ||||
| # We don't use a full run yet and only the certificate section. | ||||
| # There we would need to blacklist at least: | ||||
| # There we would need to blacklist more, like: | ||||
| # cert_serialNumber, cert_fingerprintSHA1, cert_fingerprintSHA256, cert | ||||
| # cert_expirationStatus, cert_notBefore, cert_notAfter, cert_caIssuers, intermediate_cert | ||||
| # | ||||
| # help is appreciated here | ||||
|  | ||||
| use strict; | ||||
| use Test::More; | ||||
| @@ -16,55 +15,54 @@ use Text::Diff; | ||||
|  | ||||
| my $tests = 0; | ||||
| my $prg="./testssl.sh"; | ||||
| my $master_socket_csv="./t/baseline_data/default_testssl.csvfile"; | ||||
| my $socket_csv="tmp.csv"; | ||||
| my $check2run="-p -s -P --fs -h -U -c -q --ip=one --color 0 --csvfile $socket_csv"; | ||||
| #my $check2run="-p --color 0 --csvfile $socket_csv"; | ||||
| my $baseline_csv="./t/baseline_data/default_testssl.csvfile"; | ||||
| my $cat_csv="tmp.csv"; | ||||
| my $check2run="-p -s -P --fs -h -U -c -q --ip=one --color 0 --csvfile $cat_csv"; | ||||
| my $uri="testssl.sh"; | ||||
| my $diff=""; | ||||
|  | ||||
| die "Unable to open $prg" unless -f $prg; | ||||
| die "Unable to open $master_socket_csv" unless -f $master_socket_csv; | ||||
|  | ||||
| die "Unable to open $baseline_csv" unless -f $baseline_csv; | ||||
|  | ||||
| # Provide proper start conditions | ||||
| unlink "tmp.csv"; | ||||
| unlink $cat_csv; | ||||
|  | ||||
| # Title | ||||
| printf "\n%s\n", "Diff unit test IPv4 against \"$uri\""; | ||||
| my @args=("$prg", "$check2run", "$uri", "2>&1"); | ||||
|  | ||||
| #1 run | ||||
| `$prg $check2run $uri 2>&1`; | ||||
| printf "\n%s\n", "Diff unit test (IPv4) against \"$uri\""; | ||||
| printf "@args\n"; | ||||
| system("@args") == 0 | ||||
|      or die ("FAILED: \"@args\" "); | ||||
|  | ||||
| $diff = diff $socket_csv, $master_socket_csv; | ||||
|  | ||||
| $socket_csv=`cat tmp.csv`; | ||||
| $master_socket_csv=`cat $master_socket_csv`; | ||||
| $cat_csv=`cat $cat_csv`; | ||||
| $baseline_csv=`cat $baseline_csv`; | ||||
|  | ||||
| # Filter for changes that are allowed to occur | ||||
| $socket_csv=~ s/HTTP_clock_skew.*\n//g; | ||||
| $master_socket_csv=~ s/HTTP_clock_skew.*\n//g; | ||||
|  | ||||
| # DROWN | ||||
| $socket_csv=~ s/censys.io.*\n//g; | ||||
| $master_socket_csv=~ s/censys.io.*\n//g; | ||||
| $cat_csv      =~ s/HTTP_clock_skew.*\n//g; | ||||
| $baseline_csv =~ s/HTTP_clock_skew.*\n//g; | ||||
|  | ||||
| # HTTP time | ||||
| $socket_csv=~ s/HTTP_headerTime.*\n//g; | ||||
| $master_socket_csv=~ s/HTTP_headerTime.*\n//g; | ||||
| $cat_csv      =~ s/HTTP_headerTime.*\n//g; | ||||
| $baseline_csv =~ s/HTTP_headerTime.*\n//g; | ||||
|  | ||||
| # Compare the differences to the master file -- and print differences if there were detected. | ||||
| # DROWN | ||||
| $cat_csv      =~ s/censys.io.*\n//g; | ||||
| $baseline_csv =~ s/censys.io.*\n//g; | ||||
|  | ||||
| $diff = diff \$cat_csv, \$baseline_csv; | ||||
|  | ||||
| # Compare the differences to the baseline file -- and print differences if there were detected. | ||||
| # | ||||
| cmp_ok($socket_csv, "eq", $master_socket_csv, "Check whether CSV output matches master file from $uri") or | ||||
| ok($cat_csv eq $baseline_csv, "Check whether CSV output matches baseline file from $uri") or | ||||
|      diag ("\n%s\n", "$diff"); | ||||
|  | ||||
| $tests++; | ||||
|  | ||||
| unlink "tmp.csv"; | ||||
|  | ||||
| $tests++; | ||||
| done_testing($tests); | ||||
| printf "\n"; | ||||
|  | ||||
|  | ||||
| #  vim:ts=5:sw=5:expandtab | ||||
| # vim:ts=5:sw=5:expandtab | ||||
|  | ||||
|   | ||||
| @@ -70,7 +70,7 @@ | ||||
| "FS_TLS13_sig_algs","testssl.sh/81.169.166.184","443","INFO","RSA-PSS-RSAE+SHA256 RSA-PSS-RSAE+SHA384 RSA-PSS-RSAE+SHA512","","" | ||||
| "HTTP_status_code","testssl.sh/81.169.166.184","443","INFO","200 OK ('/')","","" | ||||
| "HTTP_clock_skew","testssl.sh/81.169.166.184","443","INFO","0 seconds from localtime","","" | ||||
| "HTTP_headerTime","testssl.sh/81.169.166.184","443","INFO","1654006271","","" | ||||
| "HTTP_headerTime","testssl.sh/81.169.166.184","443","INFO","1737570310","","" | ||||
| "HSTS_time","testssl.sh/81.169.166.184","443","OK","362 days (=31337000 seconds) > 15552000 seconds","","" | ||||
| "HSTS_subdomains","testssl.sh/81.169.166.184","443","INFO","only for this domain","","" | ||||
| "HSTS_preload","testssl.sh/81.169.166.184","443","INFO","domain is NOT marked for preloading","","" | ||||
| @@ -81,6 +81,8 @@ | ||||
| "X-Frame-Options","testssl.sh/81.169.166.184","443","OK","DENY","","" | ||||
| "X-Content-Type-Options","testssl.sh/81.169.166.184","443","OK","nosniff","","" | ||||
| "Content-Security-Policy","testssl.sh/81.169.166.184","443","OK","script-src 'unsafe-inline'; style-src 'unsafe-inline' 'self'; object-src 'self'; base-uri 'none'; form-action 'none'; img-src 'self' ; default-src 'self'; frame-ancestors 'self'; upgrade-insecure-requests;","","" | ||||
| "Cross-Origin-Opener-Policy","testssl.sh/81.169.166.184","443","INFO","same-origin-allow-popups","","" | ||||
| "Cross-Origin-Resource-Policy","testssl.sh/81.169.166.184","443","INFO","same-site","","" | ||||
| "banner_reverseproxy","testssl.sh/81.169.166.184","443","INFO","--","","CWE-200" | ||||
| "heartbleed","testssl.sh/81.169.166.184","443","OK","not vulnerable, no heartbeat extension","CVE-2014-0160","CWE-119" | ||||
| "CCS","testssl.sh/81.169.166.184","443","OK","not vulnerable","CVE-2014-0224","CWE-310" | ||||
| @@ -95,7 +97,7 @@ | ||||
| "SWEET32","testssl.sh/81.169.166.184","443","OK","not vulnerable","CVE-2016-2183 CVE-2016-6329","CWE-327" | ||||
| "FREAK","testssl.sh/81.169.166.184","443","OK","not vulnerable","CVE-2015-0204","CWE-310" | ||||
| "DROWN","testssl.sh/81.169.166.184","443","OK","not vulnerable on this host and port","CVE-2016-0800 CVE-2016-0703","CWE-310" | ||||
| "DROWN_hint","testssl.sh/81.169.166.184","443","INFO","Make sure you don't use this certificate elsewhere with SSLv2 enabled services, see https://search.censys.io/search?resource=hosts&virtual_hosts=INCLUDE&q=31B44391529821C6A77F3C78B02D716A07F99B8FDB342BF5A78F263C25375968","CVE-2016-0800 CVE-2016-0703","CWE-310" | ||||
| "DROWN_hint","testssl.sh/81.169.166.184","443","INFO","Make sure you don't use this certificate elsewhere with SSLv2 enabled services, see https://search.censys.io/search?resource=hosts&virtual_hosts=INCLUDE&q=5B4BC205947AED96ECB1879F2668F7F69D696C143BA8D1C69DBB4DC873C92AE9","CVE-2016-0800 CVE-2016-0703","CWE-310" | ||||
| "LOGJAM","testssl.sh/81.169.166.184","443","OK","not vulnerable, no DH EXPORT ciphers,","CVE-2015-4000","CWE-310" | ||||
| "LOGJAM-common_primes","testssl.sh/81.169.166.184","443","OK","--","CVE-2015-4000","CWE-310" | ||||
| "BEAST_CBC_TLS1","testssl.sh/81.169.166.184","443","MEDIUM","ECDHE-RSA-AES256-SHA ECDHE-RSA-AES128-SHA DHE-RSA-CAMELLIA256-SHA DHE-RSA-CAMELLIA128-SHA DHE-RSA-AES256-SHA DHE-RSA-AES128-SHA AES256-SHA","CVE-2011-3389","CWE-20" | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Dirk
					Dirk