mirror of
https://github.com/drwetter/testssl.sh.git
synced 2025-01-06 00:39:44 +01:00
Introducing 3 hexdump commands
`hexdump -C` is used in verbose mode to see what is going on. Unfortunately, it's not possible to get more than 16 columns `hexdump -ve '16/1 "%02x " " \n"'` is used to analyse the reply given by the server. There is no offset and no human readable character output `hexdump -ve '1/1 "%.2x"'` is used to generate a pure hexadecimal stream of data
This commit is contained in:
parent
3785ddb48b
commit
7289d49f6c
14
testssl.sh
14
testssl.sh
@ -81,8 +81,9 @@ 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
|
# The various hexdump commands we need to replace xdd
|
||||||
HEXDUMP=(hexdump -ve '"%07_ax " 16/2 "%06o " " \n"')
|
HEXDUMPVIEW=(hexdump -C) # This is used in verbose mode to see what's going on
|
||||||
HEXDUMPPLAIN=(hexdump -ve '30/1 "%.2x" "\n"')
|
HEXDUMP=(hexdump -ve '16/1 "%02x " " \n"') # This is used to analyse the reply
|
||||||
|
HEXDUMPPLAIN=(hexdump -ve '1/1 "%.2x"') # Replaces both xxd -p and tr -cd '[:print:]'
|
||||||
|
|
||||||
go2_column() { $ECHO "\033[${1}G"; }
|
go2_column() { $ECHO "\033[${1}G"; }
|
||||||
|
|
||||||
@ -1044,7 +1045,7 @@ ccs_injection(){
|
|||||||
|
|
||||||
if [ $VERBOSE -eq 1 ]; then
|
if [ $VERBOSE -eq 1 ]; then
|
||||||
outln "\n server hello:"
|
outln "\n server hello:"
|
||||||
echo "$SOCKREPLY" | "${HEXDUMP[@]}" | head -20
|
echo "$SOCKREPLY" | "${HEXDUMPVIEW[@]}" | head -20
|
||||||
outln "[...]"
|
outln "[...]"
|
||||||
outln "payload with TLS version $tls_hexcode:"
|
outln "payload with TLS version $tls_hexcode:"
|
||||||
fi
|
fi
|
||||||
@ -1056,7 +1057,7 @@ ccs_injection(){
|
|||||||
|
|
||||||
if [ $VERBOSE -eq 1 ]; then
|
if [ $VERBOSE -eq 1 ]; then
|
||||||
outln "\n reply: "
|
outln "\n reply: "
|
||||||
echo "$SOCKREPLY" | "${HEXDUMP[@]}"
|
echo "$SOCKREPLY" | "${HEXDUMPVIEW[@]}"
|
||||||
outln
|
outln
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -1159,7 +1160,7 @@ heartbleed(){
|
|||||||
|
|
||||||
if [ $VERBOSE -eq 1 ]; then
|
if [ $VERBOSE -eq 1 ]; then
|
||||||
outln "\n server hello:"
|
outln "\n server hello:"
|
||||||
echo "$SOCKREPLY" | "${HEXDUMP[@]}" | head -20
|
echo "$SOCKREPLY" | "${HEXDUMPVIEW[@]}" | head -20
|
||||||
outln "[...]"
|
outln "[...]"
|
||||||
outln " sending payload with TLS version $tls_hexcode:"
|
outln " sending payload with TLS version $tls_hexcode:"
|
||||||
fi
|
fi
|
||||||
@ -1170,11 +1171,10 @@ heartbleed(){
|
|||||||
|
|
||||||
if [ $VERBOSE -eq 1 ]; then
|
if [ $VERBOSE -eq 1 ]; then
|
||||||
outln "\n heartbleed reply: "
|
outln "\n heartbleed reply: "
|
||||||
echo "$SOCKREPLY" | "${HEXDUMP[@]}"
|
echo "$SOCKREPLY" | "${HEXDUMPVIEW[@]}"
|
||||||
outln
|
outln
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# iS - Does this need to be a different hexdump command?
|
|
||||||
lines_returned=`echo "$SOCKREPLY" | "${HEXDUMP[@]}" | wc -l`
|
lines_returned=`echo "$SOCKREPLY" | "${HEXDUMP[@]}" | wc -l`
|
||||||
if [ $lines_returned -gt 1 ]; then
|
if [ $lines_returned -gt 1 ]; then
|
||||||
red "VULNERABLE"
|
red "VULNERABLE"
|
||||||
|
Loading…
Reference in New Issue
Block a user