From 2362cd8745f6a13637ae2bbb2fc71ca8326be6e4 Mon Sep 17 00:00:00 2001 From: Dirk Date: Fri, 1 Jul 2016 12:03:46 +0200 Subject: [PATCH 1/6] wording for GOST sig algos and keys --- testssl.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/testssl.sh b/testssl.sh index 73836a5..eee727a 100755 --- a/testssl.sh +++ b/testssl.sh @@ -3913,7 +3913,7 @@ certificate_info() { ;; *) out "$cert_sig_algo (" - pr_warning "FIXME: is unknown" + pr_warning "FIXME: can't tell whether this is good or not" outln ")" fileout "${json_prefix}algorithm" "DEBUG" "Signature Algorithm: $sign_algo" ;; @@ -3983,7 +3983,7 @@ certificate_info() { fi else out "$cert_keysize bits (" - pr_warning "FIXME: can't tell whether this is good here or not" + pr_warning "FIXME: can't tell whether this is good or not" outln ")" fileout "${json_prefix}key_size" "WARN" "Server keys $cert_keysize bits (unknown signature algorithm)" fi @@ -8148,4 +8148,4 @@ fi exit $? -# $Id: testssl.sh,v 1.509 2016/06/28 10:21:48 dirkw Exp $ +# $Id: testssl.sh,v 1.510 2016/07/01 10:03:44 dirkw Exp $ From 0d2797e5a0c84b339ae1ba1c0ccc5a8d70f11a33 Mon Sep 17 00:00:00 2001 From: Dirk Wetter Date: Fri, 1 Jul 2016 14:58:54 +0200 Subject: [PATCH 2/6] travis ci icon --- Readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/Readme.md b/Readme.md index e44643d..3b16045 100644 --- a/Readme.md +++ b/Readme.md @@ -1,6 +1,7 @@ ## Intro +[![Build Status](https://travis-ci.org/drwetter/testssl.sh.svg?branch=master)](https://travis-ci.org/drwetter/testssl.sh) [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/drwetter/testssl.sh?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) `testssl.sh` is a free command line tool which checks a server's service on From 32f249b0c20c129d83ddcf171334bced4843a881 Mon Sep 17 00:00:00 2001 From: Dirk Date: Fri, 1 Jul 2016 18:26:05 +0200 Subject: [PATCH 3/6] enabling sockets for client testing per default #375 --- testssl.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/testssl.sh b/testssl.sh index eee727a..457cad3 100755 --- a/testssl.sh +++ b/testssl.sh @@ -2009,7 +2009,7 @@ run_client_simulation() { local name tls proto cipher local using_sockets=true - if $SSL_NATIVE || [[ -n "$STARTTLS" ]] || ! $EXPERIMENTAL; then + if $SSL_NATIVE || [[ -n "$STARTTLS" ]]; then using_sockets=false fi @@ -8148,4 +8148,4 @@ fi exit $? -# $Id: testssl.sh,v 1.510 2016/07/01 10:03:44 dirkw Exp $ +# $Id: testssl.sh,v 1.511 2016/07/01 16:26:03 dirkw Exp $ From d5242c255e54a3bafe5a39f2aacc443b4260942d Mon Sep 17 00:00:00 2001 From: Dirk Date: Sun, 3 Jul 2016 21:45:49 +0200 Subject: [PATCH 4/6] FIX #384 --- testssl.sh | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/testssl.sh b/testssl.sh index 457cad3..36d2cad 100755 --- a/testssl.sh +++ b/testssl.sh @@ -170,10 +170,12 @@ USLEEP_SND=${USLEEP_SND:-0.1} # sleep time for general socket send USLEEP_REC=${USLEEP_REC:-0.2} # sleep time for general socket receive HSTS_MIN=${HSTS_MIN:-179} # >179 days is ok for HSTS HPKP_MIN=${HPKP_MIN:-30} # >=30 days should be ok for HPKP_MIN, practical hints? -readonly CLIENT_MIN_PFS=5 # number of ciphers needed to run a test for PFS DAYS2WARN1=${DAYS2WARN1:-60} # days to warn before cert expires, threshold 1 DAYS2WARN2=${DAYS2WARN2:-30} # days to warn before cert expires, threshold 2 VULN_THRESHLD=${VULN_THRESHLD:-1} # if vulnerabilities to check >$VULN_THRESHLD we DON'T show a separate header line in the output each vuln. check +readonly CLIENT_MIN_PFS=5 # number of ciphers needed to run a test for PFS + # generated from 'kEECDH:kEDH:!aNULL:!eNULL:!DES:!3DES:!RC4' with openssl 1.0.2i and openssl 1.1.0 +readonly ROBUST_PFS_CIPHERS="DHE-DSS-AES128-GCM-SHA256:DHE-DSS-AES128-SHA256:DHE-DSS-AES128-SHA:DHE-DSS-AES256-GCM-SHA384:DHE-DSS-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-DSS-CAMELLIA128-SHA256:DHE-DSS-CAMELLIA128-SHA:DHE-DSS-CAMELLIA256-SHA256:DHE-DSS-CAMELLIA256-SHA:DHE-DSS-SEED-SHA:DHE-RSA-AES128-CCM8:DHE-RSA-AES128-CCM:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-CCM8:DHE-RSA-AES256-CCM:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-CAMELLIA128-SHA256:DHE-RSA-CAMELLIA128-SHA:DHE-RSA-CAMELLIA256-SHA256:DHE-RSA-CAMELLIA256-SHA:DHE-RSA-CHACHA20-POLY1305-OLD:DHE-RSA-CHACHA20-POLY1305:DHE-RSA-SEED-SHA:ECDHE-ECDSA-AES128-CCM8:ECDHE-ECDSA-AES128-CCM:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-ECDSA-AES256-CCM8:ECDHE-ECDSA-AES256-CCM:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-ECDSA-CAMELLIA128-SHA256:ECDHE-ECDSA-CAMELLIA256-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305-OLD:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-RSA-CAMELLIA128-SHA256:ECDHE-RSA-CAMELLIA256-SHA384:ECDHE-RSA-CHACHA20-POLY1305-OLD:ECDHE-RSA-CHACHA20-POLY1305" HAD_SLEPT=0 CAPATH="${CAPATH:-/etc/ssl/certs/}" # Does nothing yet (FC has only a CA bundle per default, ==> openssl version -d) @@ -4379,18 +4381,13 @@ run_server_defaults() { done } -# http://www.heise.de/security/artikel/Forward-Secrecy-testen-und-einrichten-1932806.html run_pfs() { local -i sclient_success local pfs_offered=false local tmpfile local dhlen local hexcode dash pfs_cipher sslvers kx auth enc mac - # https://community.qualys.com/blogs/securitylabs/2013/08/05/configuring-apache-nginx-and-openssl-for-forward-secrecy -- but with RC4: - #local pfs_ciphers='EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA256 EECDH+aRSA+SHA256 EECDH+aRSA+RC4 EDH+aRSA EECDH RC4 !RC4-SHA !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS:@STRENGTH' - #w/o RC4: - #local pfs_ciphers='EECDH+ECDSA+AESGCM EECDH+aRSA+AESGCM EECDH+ECDSA+SHA256 EECDH+aRSA+SHA256 EDH+aRSA EECDH !RC4-SHA !aNULL !eNULL !LOW !3DES !MD5 !EXP !PSK !SRP !DSS:@STRENGTH' - local pfs_cipher_list="ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-CAMELLIA256-SHA256:DHE-RSA-CAMELLIA256-SHA:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-CAMELLIA256-SHA384:ECDHE-ECDSA-CAMELLIA256-SHA384:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-ECDSA-CAMELLIA128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-CAMELLIA128-SHA256:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-CAMELLIA128-SHA256:DHE-RSA-SEED-SHA:DHE-RSA-CAMELLIA128-SHA:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA" + local pfs_cipher_list="$ROBUST_PFS_CIPHERS" local -i nr_supported_ciphers=0 local pfs_ciphers @@ -4410,7 +4407,7 @@ run_pfs() { return 1 fi - $OPENSSL s_client -cipher 'ECDH:DH' $STARTTLS $BUGS -connect $NODEIP:$PORT $PROXY $SNI >$TMPFILE 2>$ERRFILE $TMPFILE 2>$ERRFILE Date: Sun, 3 Jul 2016 22:35:21 +0200 Subject: [PATCH 5/6] updating neat_list() to be faster and more compatible to openssl 1.1.0 with new chacha/poly ciphers --- testssl.sh | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/testssl.sh b/testssl.sh index 36d2cad..2f8d0a8 100755 --- a/testssl.sh +++ b/testssl.sh @@ -83,7 +83,7 @@ readonly PS4='${LINENO}> ${FUNCNAME[0]:+${FUNCNAME[0]}(): }' # make sure that temporary files are cleaned up after use in ANY case trap "cleanup" QUIT EXIT -readonly VERSION="2.7dev" +readonly VERSION="2.8rc1" readonly SWCONTACT="dirk aet testssl dot sh" egrep -q "dev|rc" <<< "$VERSION" && \ SWURL="https://testssl.sh/dev/" || @@ -1535,9 +1535,13 @@ neat_list(){ kx="${3//Kx=/}" enc="${4//Enc=/}" - strength=$(sed -e 's/.*(//' -e 's/)//' <<< "$enc") # strength = encryption bits - strength="${strength//ChaCha20-Poly1305/ly1305}" - enc=$(sed -e 's/(.*)//g' -e 's/ChaCha20-Poly1305/ChaCha20-Po/g' <<< "$enc") # workaround for empty bits ChaCha20-Poly1305 + strength="${enc//\)/}" # retrieve (). first remove traling ")" + strength="${strength#*\(}" # exfiltrate (VAL + enc="${enc%%\(*}" + + enc="${enc//POLY1305/}" # remove POLY1305 + enc="${enc//\//}" # remove "/" + echo "$export" | grep -iq export && strength="$strength,exp" #printf -- "%q" "$kx" | xxd | head -1 @@ -8145,4 +8149,4 @@ fi exit $? -# $Id: testssl.sh,v 1.512 2016/07/03 19:45:48 dirkw Exp $ +# $Id: testssl.sh,v 1.513 2016/07/03 20:35:20 dirkw Exp $ From f01bff973ae2474c6e6f749b22998b3ea3ca097b Mon Sep 17 00:00:00 2001 From: Dirk Date: Mon, 4 Jul 2016 13:59:39 +0200 Subject: [PATCH 6/6] renamed function, better banner for logging --- testssl.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/testssl.sh b/testssl.sh index 2f8d0a8..5c09ad7 100755 --- a/testssl.sh +++ b/testssl.sh @@ -6620,7 +6620,7 @@ find_openssl_binary() { return 0 } -openssl_age() { +check4openssl_oldfarts() { case "$OSSL_VER" in 0.9.7*|0.9.6*|0.9.5*) # 0.9.5a was latest in 0.9.5 an released 2000/4/1, that'll NOT suffice for this test @@ -7006,7 +7006,9 @@ prepare_logging() { fi >$LOGFILE outln "## Scan started as: \"$PROG_NAME $CMDLINE\"" >>${LOGFILE} - outln "## ($VERSION ${GIT_REL_SHORT:-$CVS_REL_SHORT} from $REL_DATE, at $HNAME:$OPENSSL_LOCATION)\n" >>${LOGFILE} + outln "## at $HNAME:$OPENSSL_LOCATION" >>${LOGFILE} + outln "## version testssl: $VERSION ${GIT_REL_SHORT:-$CVS_REL_SHORT} from $REL_DATE" >>${LOGFILE} + outln "## version openssl: \"$OSSL_VER\" from \"$OSSL_BUILD_DATE\")\n" >>${LOGFILE} exec > >(tee -a ${LOGFILE}) # not decided yet. Maybe good to have a separate file or none at all #exec 2> >(tee -a ${LOGFILE} >&2) @@ -8091,7 +8093,7 @@ find_openssl_binary maketempf mybanner check_proxy -openssl_age +check4openssl_oldfarts # TODO: it is ugly to have those two vars here --> main() ret=0 @@ -8149,4 +8151,4 @@ fi exit $? -# $Id: testssl.sh,v 1.513 2016/07/03 20:35:20 dirkw Exp $ +# $Id: testssl.sh,v 1.514 2016/07/04 11:59:38 dirkw Exp $