mirror of
https://github.com/drwetter/testssl.sh.git
synced 2025-01-07 09:10:57 +01:00
Replaced xxd with hexdump
This commit is contained in:
parent
fb40dad089
commit
73d70f403b
19
testssl.sh
19
testssl.sh
@ -80,6 +80,10 @@ NODEIP=""
|
|||||||
IPS=""
|
IPS=""
|
||||||
MAX_WAITSOCK=10 # waiting at max 10 seconds for socket reply
|
MAX_WAITSOCK=10 # waiting at max 10 seconds for socket reply
|
||||||
|
|
||||||
|
# The various hexdump commands we need to replace xdd
|
||||||
|
HEXDUMP=(hexdump -ve '"%07_ax " 16/2 "%06o " " \n"')
|
||||||
|
HEXDUMPPLAIN=(hexdump -ve '1/1 "%.2x"')
|
||||||
|
|
||||||
go2_column() { $ECHO "\033[${1}G"; }
|
go2_column() { $ECHO "\033[${1}G"; }
|
||||||
|
|
||||||
out() {
|
out() {
|
||||||
@ -1040,7 +1044,7 @@ ccs_injection(){
|
|||||||
|
|
||||||
if [ $VERBOSE -eq 1 ]; then
|
if [ $VERBOSE -eq 1 ]; then
|
||||||
outln "\n server hello:"
|
outln "\n server hello:"
|
||||||
echo "$SOCKREPLY" | xxd -c32 | head -20
|
echo "$SOCKREPLY" | "${HEXDUMP[@]}" | head -20
|
||||||
outln "[...]"
|
outln "[...]"
|
||||||
outln "payload with TLS version $tls_hexcode:"
|
outln "payload with TLS version $tls_hexcode:"
|
||||||
fi
|
fi
|
||||||
@ -1052,12 +1056,12 @@ ccs_injection(){
|
|||||||
|
|
||||||
if [ $VERBOSE -eq 1 ]; then
|
if [ $VERBOSE -eq 1 ]; then
|
||||||
outln "\n reply: "
|
outln "\n reply: "
|
||||||
echo "$SOCKREPLY" | xxd -c32
|
echo "$SOCKREPLY" | "${HEXDUMP[@]}"
|
||||||
outln
|
outln
|
||||||
fi
|
fi
|
||||||
|
|
||||||
reply_sanitized=`echo "$SOCKREPLY" | xxd -p | tr -cd '[:print:]' | sed 's/^..........//'`
|
reply_sanitized=`echo "$SOCKREPLY" | "${HEXDUMPPLAIN[@]}" | tr -cd '[:print:]' | sed 's/^..........//'`
|
||||||
lines=`echo "$SOCKREPLY" | xxd -c32 | wc -l`
|
lines=`echo "$SOCKREPLY" | "${HEXDUMP[@]}" | wc -l`
|
||||||
|
|
||||||
if [ "$reply_sanitized" == "0a" ] || [ "$lines" -gt 1 ] ; then
|
if [ "$reply_sanitized" == "0a" ] || [ "$lines" -gt 1 ] ; then
|
||||||
green "NOT vulnerable (ok)"
|
green "NOT vulnerable (ok)"
|
||||||
@ -1155,7 +1159,7 @@ heartbleed(){
|
|||||||
|
|
||||||
if [ $VERBOSE -eq 1 ]; then
|
if [ $VERBOSE -eq 1 ]; then
|
||||||
outln "\n server hello:"
|
outln "\n server hello:"
|
||||||
echo "$SOCKREPLY" | xxd -c32 | head -20
|
echo "$SOCKREPLY" | "${HEXDUMP[@]}" | head -20
|
||||||
outln "[...]"
|
outln "[...]"
|
||||||
outln " sending payload with TLS version $tls_hexcode:"
|
outln " sending payload with TLS version $tls_hexcode:"
|
||||||
fi
|
fi
|
||||||
@ -1166,11 +1170,12 @@ heartbleed(){
|
|||||||
|
|
||||||
if [ $VERBOSE -eq 1 ]; then
|
if [ $VERBOSE -eq 1 ]; then
|
||||||
outln "\n heartbleed reply: "
|
outln "\n heartbleed reply: "
|
||||||
echo "$SOCKREPLY" | xxd -c32
|
echo "$SOCKREPLY" | "${HEXDUMP[@]}"
|
||||||
outln
|
outln
|
||||||
fi
|
fi
|
||||||
|
|
||||||
lines_returned=`echo "$SOCKREPLY" | xxd | wc -l`
|
# iS - Does this need to be a different hexdump command?
|
||||||
|
lines_returned=`echo "$SOCKREPLY" | "${HEXDUMP[@]}" | wc -l`
|
||||||
if [ $lines_returned -gt 1 ]; then
|
if [ $lines_returned -gt 1 ]; then
|
||||||
red "VULNERABLE"
|
red "VULNERABLE"
|
||||||
ret=1
|
ret=1
|
||||||
|
Loading…
Reference in New Issue
Block a user