mirror of
https://github.com/drwetter/testssl.sh.git
synced 2025-01-08 09:40:57 +01:00
Test code for a HTTP GET request over sockets
It doesn't run per default and it doens't work yet. Just to share the idea.
This commit is contained in:
parent
7de93e26dc
commit
e02b313394
16
testssl.sh
16
testssl.sh
@ -1968,6 +1968,15 @@ run_http_header() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
[[ -z "$1" ]] && url="/" || url="$1"
|
[[ -z "$1" ]] && url="/" || url="$1"
|
||||||
|
if [[ "$SOCKETHEADER" == true ]]; then
|
||||||
|
# This is just for testing only. It doesn't work (yet)
|
||||||
|
tls_sockets "03" "$TLS12_CIPHER" "" "" "" false
|
||||||
|
debugme echo "--> $?"
|
||||||
|
printf -- "%b" "$GET_REQ11" >&5 # This GET request is not being logged on the server side --> probably we're still on the TLS layer
|
||||||
|
cat <&5 >$HEADERFILE
|
||||||
|
debugme xxd "$HEADERFILE" # 1503 -> TLS alert
|
||||||
|
close_socket
|
||||||
|
else
|
||||||
printf "$GET_REQ11" | $OPENSSL s_client $(s_client_options "$OPTIMAL_PROTO $BUGS -quiet -ign_eof -connect $NODEIP:$PORT $PROXY $SNI") >$HEADERFILE 2>$ERRFILE &
|
printf "$GET_REQ11" | $OPENSSL s_client $(s_client_options "$OPTIMAL_PROTO $BUGS -quiet -ign_eof -connect $NODEIP:$PORT $PROXY $SNI") >$HEADERFILE 2>$ERRFILE &
|
||||||
wait_kill $! $HEADER_MAXSLEEP
|
wait_kill $! $HEADER_MAXSLEEP
|
||||||
if [[ $? -eq 0 ]]; then
|
if [[ $? -eq 0 ]]; then
|
||||||
@ -1993,6 +2002,7 @@ run_http_header() {
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
fi
|
||||||
if [[ ! -s $HEADERFILE ]]; then
|
if [[ ! -s $HEADERFILE ]]; then
|
||||||
prln_warning " HTTP header reply empty"
|
prln_warning " HTTP header reply empty"
|
||||||
fileout "HTTP_status_code" "WARN" "HTTP header reply empty"
|
fileout "HTTP_status_code" "WARN" "HTTP header reply empty"
|
||||||
@ -12596,13 +12606,13 @@ tls_sockets() {
|
|||||||
local -i hello_done=0
|
local -i hello_done=0
|
||||||
local cipher="" key_and_iv="" decrypted_response
|
local cipher="" key_and_iv="" decrypted_response
|
||||||
|
|
||||||
[[ "$5" == "true" ]] && offer_compression=true
|
[[ "$5" == true ]] && offer_compression=true
|
||||||
[[ "$6" == "false" ]] && close_connection=false
|
[[ "$6" == false ]] && close_connection=false
|
||||||
tls_low_byte="$1"
|
tls_low_byte="$1"
|
||||||
if [[ -n "$2" ]]; then # use supplied string in arg2 if there is one
|
if [[ -n "$2" ]]; then # use supplied string in arg2 if there is one
|
||||||
cipher_list_2send="$2"
|
cipher_list_2send="$2"
|
||||||
else # otherwise use std ciphers then
|
else # otherwise use std ciphers then
|
||||||
if [[ "$tls_low_byte" == "03" ]]; then
|
if [[ "$tls_low_byte" == 03 ]]; then
|
||||||
cipher_list_2send="$TLS12_CIPHER"
|
cipher_list_2send="$TLS12_CIPHER"
|
||||||
else
|
else
|
||||||
cipher_list_2send="$TLS_CIPHER"
|
cipher_list_2send="$TLS_CIPHER"
|
||||||
|
Loading…
Reference in New Issue
Block a user