From a98b67013a5b3be581dac6c20383fd4ef9af9997 Mon Sep 17 00:00:00 2001 From: Dirk Date: Thu, 11 Jun 2015 21:41:25 +0200 Subject: [PATCH] FIX #116 CRIME is lightred/litegreen as it is not that bad as ccs or heartbleed resorted some functions --- testssl.sh | 94 +++++++++++++++++++++++++++--------------------------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/testssl.sh b/testssl.sh index 96a4a21..dcd8ff2 100755 --- a/testssl.sh +++ b/testssl.sh @@ -1442,7 +1442,7 @@ server_defaults() { [ -z "$TLS_TIME" ] && tls_sockets "00" "$TLS_CIPHER" if [ -n "$TLS_TIME" ]; then - difftime=$(($TLS_NOW - $TLS_TIME)) + difftime=$(($TLS_TIME - $TLS_NOW)) if [[ "${#difftime}" -gt 5 ]]; then # openssl >= 1.0.1f fills this field with random values out " TLS timestamp: random values, no fingerprinting possible " @@ -1472,7 +1472,7 @@ server_defaults() { HTTP_TIME=$(date -j -f "%a, %d %b %Y %T %Z" "$HTTP_TIME" "+%s" 2>/dev/null) # the trailing \r confuses BSD flavors otherwise fi - difftime=$(($now - $HTTP_TIME)) + difftime=$(($HTTP_TIME - $now)) [[ $difftime != "-"* ]] && [[ $difftime != "0" ]] && difftime="+$difftime" out "$difftime sec from localtime"; else @@ -2509,12 +2509,12 @@ crime() { #STR=$($OPENSSL s_client $ADDCMD $STARTTLS -connect $NODEIP:$PORT $SNI 2>&1 $TMPFILE if grep -a Compression $TMPFILE | grep -aq NONE >/dev/null; then - pr_green "not vulnerable (OK)" + pr_litegreen "not vulnerable (OK)" [[ $SERVICE == "HTTP" ]] || out " (not using HTTP anyway)" ret=0 else if [[ $SERVICE == "HTTP" ]]; then - pr_red "VULNERABLE (NOT ok)" + pr_litered "VULNERABLE (NOT ok)" else pr_brown "VULNERABLE (NOT ok), but not using HTTP: probably no exploit known" fi @@ -2617,7 +2617,47 @@ EOF return $ret } -# Test for TLS_FALLBACK_SCSV +### two helper functions for vulnerabilities follow +count_ciphers() { + echo "$1" | sed 's/:/\n/g' | wc -l | sed 's/ //g' +} + +actually_supported_ciphers() { + $OPENSSL ciphers "$1" +} + + +# Padding Oracle On Downgraded Legacy Encryption, in a nutshell: don't use CBC Ciphers in SSLv3 +ssl_poodle() { + local ret + local cbc_ciphers + + [ $VULN_COUNT -le $VULN_THRESHLD ] && outln && pr_blue "--> Testing for SSLv3 POODLE (Padding Oracle On Downgraded Legacy Encryption)" && outln "\n" + pr_bold " POODLE, SSL"; out " (CVE-2014-3566) " + cbc_ciphers=$($OPENSSL ciphers -v 'ALL:eNULL' | awk '/CBC/ { print $1 }' | tr '\n' ':') +#FIXME: even with worst openssl client (FreeBSD9) we have 17 reasonable ciphers but is that enough to check?? + debugme echo $cbc_ciphers + $OPENSSL s_client -ssl3 $STARTTLS -cipher $cbc_ciphers -connect $NODEIP:$PORT $SNI &>$TMPFILE Testing for SSLv3 POODLE (Padding Oracle On Downgraded Legacy Encryption)" && outln "\n" - pr_bold " POODLE, SSL"; out " (CVE-2014-3566) " - cbc_ciphers=$($OPENSSL ciphers -v 'ALL:eNULL' | awk '/CBC/ { print $1 }' | tr '\n' ':') -#FIXME: even with worst openssl client (FreeBSD9) we have 17 reasonable ciphers but is that enough to check?? - debugme echo $cbc_ciphers - $OPENSSL s_client -ssl3 $STARTTLS -cipher $cbc_ciphers -connect $NODEIP:$PORT $SNI &>$TMPFILE $TMPFILE