This commit is contained in:
carlospolop
2025-05-25 08:15:48 +02:00
parent 64ab193d25
commit aac3667247
7 changed files with 1381 additions and 53 deletions

View File

@@ -8,30 +8,21 @@
# Functions Used:
# Global Variables:
# Initial Functions:
# Generated Global Variables: $pid, $pids
# Generated Global Variables: $local_pid, $TIMEOUT_INTERNET_SECONDS_443
# Fat linpeas: 0
# Small linpeas: 1
check_tcp_443(){
local TIMEOUT_INTERNET_SECONDS_443=$1
if ! [ -f "/bin/bash" ]; then
echo " /bin/bash not found"
return
fi
/bin/bash -c '
for ip in 1.1.1.1; do
(echo >/dev/tcp/$ip/443 && echo "Port 443 is accessible" && exit 0) &
pids+=($!)
done
for pid in ${pids[@]}; do
wait $pid && exit 0
done
echo "Port 443 is not accessible"
' 2>/dev/null | grep "accessible" || echo "Port 443 is not accessible"
# example.com
(bash -c '(echo >/dev/tcp/104.18.74.230/443 2>/dev/null && echo "Port 443 is accessible" && exit 0) 2>/dev/null || echo "Port 443 is not accessible"') & local_pid=$!
sleep $TIMEOUT_INTERNET_SECONDS_443 && kill -9 $local_pid 2>/dev/null && echo "Port 443 is not accessible"
}