Update run_nikto.sh
update ssl switch routine to correctly handle ssl connection establishment check
@@ -31,8 +31,8 @@ if [ "$5" ] && [ "$5" != "$ip" ]; then
fi
NIKTO_SSL=""
-SSL_HANDSHAKE_LINES=$(sleep 5 ; echo -e "^C" 2> /dev/null | openssl s_client -connect "$HOST_NAME":"$PORT" 2> /dev/null | wc -l)
-if [ "$SSL_HANDSHAKE_LINES" -gt 15 ]; then # SSL Handshake successful, proceed with nikto -ssl switch
+SSL_CONNECTION_LINES=$(sleep 5 ; echo -e "^C" 2> /dev/null | openssl s_client -connect "$HOST_NAME":"$PORT" -brief 2>&1 | grep "ESTABLISHED" | wc -l)
+if [ "$SSL_CONNECTION_LINES" -gt 0 ]; then # SSL connection successful, proceed with nikto -ssl switch
NIKTO_SSL="-ssl"
fi
