mirror of
https://github.com/drwetter/testssl.sh.git
synced 2025-09-13 01:31:22 +02:00
Fix error message on UI when testing Opossum
As `wait_kill()` returns with 0 when a TCP reset is encountered and the process is not killed, we need to open the socket again in a sub shell. Which is safe in the foreground. If then the subshell returns with 0 we can safely connect to port 80.
This commit is contained in:
parent
ea3cc3789f
commit
e09d79aad9
@ -1942,6 +1942,10 @@ http_head_printf() {
|
|||||||
# This is a subshell, so fd 8 is not inherited
|
# This is a subshell, so fd 8 is not inherited
|
||||||
bash -c "exec 8<>/dev/tcp/$node/80" 2>/dev/null &
|
bash -c "exec 8<>/dev/tcp/$node/80" 2>/dev/null &
|
||||||
wait_kill $! $HEADER_MAXSLEEP
|
wait_kill $! $HEADER_MAXSLEEP
|
||||||
|
if [[ $? -ne 3 ]]; then
|
||||||
|
# process with pid !$ wasn't killed but was that a reject? So we try again
|
||||||
|
# to make sure there wasn't a TCP reset
|
||||||
|
bash -c "exec 8<>/dev/tcp/$node/80" 2>/dev/null
|
||||||
if [[ $? -eq 0 ]]; then
|
if [[ $? -eq 0 ]]; then
|
||||||
exec 33<>/dev/tcp/$node/80
|
exec 33<>/dev/tcp/$node/80
|
||||||
# not killed --> socket open. Now we connect to the virtual host "$node"
|
# not killed --> socket open. Now we connect to the virtual host "$node"
|
||||||
@ -1962,6 +1966,7 @@ http_head_printf() {
|
|||||||
fi
|
fi
|
||||||
exec 33<&-
|
exec 33<&-
|
||||||
exec 33>&-
|
exec 33>&-
|
||||||
|
fi
|
||||||
return $ret
|
return $ret
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user