From 0282ae9209c9dab9bebbf4431cc41ccaa09b1ee8 Mon Sep 17 00:00:00 2001 From: Pepi Zawodsky Date: Sat, 8 Feb 2014 18:37:30 +0100 Subject: [PATCH] Added simple debug function --- cipherscan | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/cipherscan b/cipherscan index f738858..c6be697 100755 --- a/cipherscan +++ b/cipherscan @@ -10,7 +10,7 @@ BENCHMARKITER=30 OPENSSLBIN="$(dirname $0)/openssl" TIMEOUT=10 CIPHERSUITE="ALL:COMPLEMENTOFALL" - +DEBUG=0 VERBOSE=0 ALLCIPHERS=0 OUTPUTFORMAT="terminal" @@ -37,6 +37,7 @@ Use one of the options below: -a | --allciphers Test all known ciphers individually at the end. -b | --benchmark Activate benchmark mode. +-d | --debug Output ALL the information. -h | --help Shows this help text. -j | --json Output results in JSON format. -o | --openssl path/to/your/openssl binary you want to use. @@ -51,11 +52,16 @@ EXAMPLES: $0 -starttls xmpp jabber.ccc.de:5222 verbose() { - if [ $VERBOSE != 0 ];then + if [ $VERBOSE != 0 ]; then echo $@ fi } +debug(){ + if [ $DEBUG == 1 ]; then + echo Debug: "$@" + fi +} # Connect to a target host with the selected ciphersuite test_cipher_on_target() { @@ -226,6 +232,10 @@ do DOBENCHMARK=1 shift ;; + -d | --debug) + DEBUG=1 + shift + ;; --) # End of all options shift break @@ -270,15 +280,15 @@ if [ "$HOST" = "$PORT" ]; then PORT=443 fi -# echo host: $HOST -# echo port: $PORT +debug "host: $HOST" +debug "Port: $PORT" TARGET=$HOST:$PORT -# echo target: $TARGET +debug "target: $TARGET" SCLIENTARGS=$(sed -e s,${TEMPTARGET},,<<<"${@}") -# echo sclientargs: $SCLIENTARGS +debug "sclientargs: $SCLIENTARGS" cipherspref=();