From c370f2359bd1bf269db73b604b4882d6bfb6c63c Mon Sep 17 00:00:00 2001 From: David Cooper Date: Mon, 24 Jul 2017 11:26:18 -0400 Subject: [PATCH] Extract cipher suites from SSLv2 ClientHello --- testssl.sh | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/testssl.sh b/testssl.sh index 5e12514..9bdf3ff 100755 --- a/testssl.sh +++ b/testssl.sh @@ -3446,12 +3446,18 @@ client_simulation_sockets() { for (( i=0; i < len; i=i+2 )); do data+=", ${clienthello:i:2}" done - # Extact list of cipher suites - sid_len=4*$(hex2dec "${data:174:2}") - offset1=178+$sid_len - offset2=182+$sid_len - len=4*$(hex2dec "${data:offset1:2}${data:offset2:2}")-2 - offset1=186+$sid_len + if [[ "${1:0:4}" == "1603" ]]; then + # Extact list of cipher suites from SSLv3 or later ClientHello + sid_len=4*$(hex2dec "${data:174:2}") + offset1=178+$sid_len + offset2=182+$sid_len + len=4*$(hex2dec "${data:offset1:2}${data:offset2:2}")-2 + offset1=186+$sid_len + else + # Extact list of cipher suites from SSLv2 ClientHello + offset1=46 + len=4*$(hex2dec "${data:26:2}")-2 + fi code2network "$(tolower "${data:offset1:len}")" # convert CIPHER_SUITES to a "standardized" format cipher_list_2send="$NW_STR"