f l
This commit is contained in:
parent
64ab193d25
commit
aac3667247
File diff suppressed because it is too large
Load Diff
@ -19,20 +19,20 @@ print_2title "Internet Access?"
|
|||||||
TIMEOUT_INTERNET_SECONDS=5
|
TIMEOUT_INTERNET_SECONDS=5
|
||||||
|
|
||||||
if [ "$SUPERFAST" ]; then
|
if [ "$SUPERFAST" ]; then
|
||||||
TIMEOUT_INTERNET_SECONDS=2
|
TIMEOUT_INTERNET_SECONDS=2.5
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
# Run all checks in background
|
# Run all checks in background
|
||||||
check_tcp_80 2>/dev/null & pid1=$!
|
check_tcp_80 "$TIMEOUT_INTERNET_SECONDS" 2>/dev/null & pid1=$!
|
||||||
check_tcp_443 2>/dev/null & pid2=$!
|
check_tcp_443 "$TIMEOUT_INTERNET_SECONDS" 2>/dev/null & pid2=$!
|
||||||
check_icmp 2>/dev/null & pid3=$!
|
check_icmp "$TIMEOUT_INTERNET_SECONDS" 2>/dev/null & pid3=$!
|
||||||
check_dns 2>/dev/null & pid4=$!
|
check_dns "$TIMEOUT_INTERNET_SECONDS" 2>/dev/null & pid4=$!
|
||||||
|
|
||||||
# Kill all after 10 seconds
|
# Kill all after 10 seconds
|
||||||
(sleep $TIMEOUT_INTERNET_SECONDS && kill -9 $pid1 $pid2 $pid3 $pid4 2>/dev/null) &
|
(sleep $(( $TIMEOUT_INTERNET_SECONDS + 1 )) && kill -9 $pid1 $pid2 $pid3 $pid4 2>/dev/null) &
|
||||||
|
|
||||||
check_tcp_443_bin 2>/dev/null
|
check_tcp_443_bin $TIMEOUT_INTERNET_SECONDS 2>/dev/null
|
||||||
tcp443_bin_status=$?
|
tcp443_bin_status=$?
|
||||||
|
|
||||||
wait $pid1 $pid2 $pid3 $pid4 2>/dev/null
|
wait $pid1 $pid2 $pid3 $pid4 2>/dev/null
|
||||||
|
@ -8,25 +8,19 @@
|
|||||||
# Functions Used:
|
# Functions Used:
|
||||||
# Global Variables:
|
# Global Variables:
|
||||||
# Initial Functions:
|
# Initial Functions:
|
||||||
# Generated Global Variables: $pid, $pids
|
# Generated Global Variables: $TIMEOUT_INTERNET_SECONDS_DNS, $local_pid
|
||||||
# Fat linpeas: 0
|
# Fat linpeas: 0
|
||||||
# Small linpeas: 1
|
# Small linpeas: 1
|
||||||
|
|
||||||
|
|
||||||
check_dns(){
|
check_dns(){
|
||||||
|
local TIMEOUT_INTERNET_SECONDS_DNS=$1
|
||||||
if ! [ -f "/bin/bash" ]; then
|
if ! [ -f "/bin/bash" ]; then
|
||||||
echo " /bin/bash not found"
|
echo " /bin/bash not found"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
/bin/bash -c '
|
# example.com
|
||||||
for ip in 1.1.1.1 8.8.8.8 ; do
|
(bash -c '((( echo cfc9 0100 0001 0000 0000 0000 0a64 7563 6b64 7563 6b67 6f03 636f 6d00 0001 0001 | xxd -p -r >&3; dd bs=9000 count=1 <&3 2>/dev/null | xxd ) 3>/dev/udp/1.1.1.1/53 && echo "DNS accessible") | grep "accessible" && exit 0 ) 2>/dev/null || echo "DNS is not accessible"') & local_pid=$!
|
||||||
(( echo cfc9 0100 0001 0000 0000 0000 0a64 7563 6b64 7563 6b67 6f03 636f 6d00 0001 0001 | xxd -p -r >&3; dd bs=9000 count=1 <&3 2>/dev/null | xxd ) 3>/dev/udp/$ip/53 && echo "DNS available" && exit 0) &
|
|
||||||
pids+=($!)
|
sleep $TIMEOUT_INTERNET_SECONDS_DNS && kill -9 $local_pid 2>/dev/null && echo "DNS is not accessible"
|
||||||
done
|
|
||||||
for pid in ${pids[@]}; do
|
|
||||||
wait $pid && exit 0
|
|
||||||
done
|
|
||||||
echo "DNS not available"
|
|
||||||
' 2>/dev/null | grep "available" || echo "DNS not available"
|
|
||||||
}
|
}
|
@ -8,11 +8,20 @@
|
|||||||
# Functions Used:
|
# Functions Used:
|
||||||
# Global Variables:
|
# Global Variables:
|
||||||
# Initial Functions:
|
# Initial Functions:
|
||||||
# Generated Global Variables:
|
# Generated Global Variables: $TIMEOUT_INTERNET_SECONDS_ICMP, $local_pid
|
||||||
# Fat linpeas: 0
|
# Fat linpeas: 0
|
||||||
# Small linpeas: 1
|
# Small linpeas: 1
|
||||||
|
|
||||||
|
|
||||||
check_icmp(){
|
check_icmp(){
|
||||||
(ping -c 1 1.1.1.1 | grep -E "1 received|1 packets received" && echo "Ping is available" || echo "Ping is not available" 2>/dev/null) | grep -i "available"
|
local TIMEOUT_INTERNET_SECONDS_ICMP=$1
|
||||||
|
if ! [ "$(command -v ping 2>/dev/null || echo -n '')" ]; then
|
||||||
|
echo " ping not found"
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
|
# example.com
|
||||||
|
((ping -c 1 1.1.1.1 2>/dev/null | grep -Ei "1 received|1 packets received" && echo "ICMP is accessible" || echo "ICMP is not accessible" 2>/dev/null) | grep "accessible" && exit 0 ) 2>/dev/null || echo "ICMP is not accessible" & local_pid=$!
|
||||||
|
|
||||||
|
sleep $TIMEOUT_INTERNET_SECONDS_ICMP && kill -9 $local_pid 2>/dev/null && echo "ICMP is not accessible"
|
||||||
}
|
}
|
@ -8,30 +8,21 @@
|
|||||||
# Functions Used:
|
# Functions Used:
|
||||||
# Global Variables:
|
# Global Variables:
|
||||||
# Initial Functions:
|
# Initial Functions:
|
||||||
# Generated Global Variables: $pid, $pids
|
# Generated Global Variables: $local_pid, $TIMEOUT_INTERNET_SECONDS_443
|
||||||
# Fat linpeas: 0
|
# Fat linpeas: 0
|
||||||
# Small linpeas: 1
|
# Small linpeas: 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
check_tcp_443(){
|
check_tcp_443(){
|
||||||
|
local TIMEOUT_INTERNET_SECONDS_443=$1
|
||||||
if ! [ -f "/bin/bash" ]; then
|
if ! [ -f "/bin/bash" ]; then
|
||||||
echo " /bin/bash not found"
|
echo " /bin/bash not found"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
/bin/bash -c '
|
# example.com
|
||||||
for ip in 1.1.1.1; do
|
(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=$!
|
||||||
(echo >/dev/tcp/$ip/443 && echo "Port 443 is accessible" && exit 0) &
|
|
||||||
pids+=($!)
|
sleep $TIMEOUT_INTERNET_SECONDS_443 && kill -9 $local_pid 2>/dev/null && echo "Port 443 is not accessible"
|
||||||
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"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,16 +8,17 @@
|
|||||||
# Functions Used:
|
# Functions Used:
|
||||||
# Global Variables:
|
# Global Variables:
|
||||||
# Initial Functions:
|
# Initial Functions:
|
||||||
# Generated Global Variables: $url_lambda
|
# Generated Global Variables: $url_lambda, $TIMEOUT_INTERNET_SECONDS_443_BIN
|
||||||
# Fat linpeas: 0
|
# Fat linpeas: 0
|
||||||
# Small linpeas: 1
|
# Small linpeas: 1
|
||||||
|
|
||||||
|
|
||||||
check_tcp_443_bin () {
|
check_tcp_443_bin () {
|
||||||
|
local TIMEOUT_INTERNET_SECONDS_443_BIN=$1
|
||||||
local url_lambda="https://2e6ppt7izvuv66qmx2r3et2ufi0mxwqs.lambda-url.us-east-1.on.aws/"
|
local url_lambda="https://2e6ppt7izvuv66qmx2r3et2ufi0mxwqs.lambda-url.us-east-1.on.aws/"
|
||||||
|
|
||||||
if command -v curl >/dev/null 2>&1; then
|
if command -v curl >/dev/null 2>&1; then
|
||||||
if curl -s --connect-timeout 5 "$url_lambda" \
|
if curl -s --connect-timeout $TIMEOUT_INTERNET_SECONDS_443_BIN "$url_lambda" \
|
||||||
-H "User-Agent: linpeas" -H "Content-Type: application/json" >/dev/null 2>&1
|
-H "User-Agent: linpeas" -H "Content-Type: application/json" >/dev/null 2>&1
|
||||||
then
|
then
|
||||||
echo "Port 443 is accessible with curl"
|
echo "Port 443 is accessible with curl"
|
||||||
@ -28,7 +29,7 @@ check_tcp_443_bin () {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
elif command -v wget >/dev/null 2>&1; then
|
elif command -v wget >/dev/null 2>&1; then
|
||||||
if wget -q --timeout=5 -O - "$url_lambda" \
|
if wget -q --timeout=$TIMEOUT_INTERNET_SECONDS_443_BIN -O - "$url_lambda" \
|
||||||
--header "User-Agent: linpeas" -H "Content-Type: application/json" >/dev/null 2>&1
|
--header "User-Agent: linpeas" -H "Content-Type: application/json" >/dev/null 2>&1
|
||||||
then
|
then
|
||||||
echo "Port 443 is accessible with wget"
|
echo "Port 443 is accessible with wget"
|
||||||
|
@ -8,25 +8,21 @@
|
|||||||
# Functions Used:
|
# Functions Used:
|
||||||
# Global Variables:
|
# Global Variables:
|
||||||
# Initial Functions:
|
# Initial Functions:
|
||||||
# Generated Global Variables: $pid, $pids
|
# Generated Global Variables: $local_pid, $TIMEOUT_INTERNET_SECONDS_80
|
||||||
# Fat linpeas: 0
|
# Fat linpeas: 0
|
||||||
# Small linpeas: 1
|
# Small linpeas: 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
check_tcp_80(){
|
check_tcp_80(){
|
||||||
|
local TIMEOUT_INTERNET_SECONDS_80=$1
|
||||||
if ! [ -f "/bin/bash" ]; then
|
if ! [ -f "/bin/bash" ]; then
|
||||||
echo " /bin/bash not found"
|
echo " /bin/bash not found"
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
/bin/bash -c '
|
# example.com
|
||||||
for ip in 1.1.1.1; do
|
(bash -c '(echo >/dev/tcp/104.18.74.230/80 2>/dev/null && echo "Port 80 is accessible" && exit 0) 2>/dev/null || echo "Port 80 is not accessible"') & local_pid=$!
|
||||||
(echo >/dev/tcp/$ip/80 && echo "Port 80 is accessible" && exit 0) &
|
|
||||||
pids+=($!)
|
sleep $TIMEOUT_INTERNET_SECONDS_80 && kill -9 $local_pid 2>/dev/null && echo "Port 80 is not accessible"
|
||||||
done
|
|
||||||
for pid in ${pids[@]}; do
|
|
||||||
wait $pid && exit 0
|
|
||||||
done
|
|
||||||
echo "Port 80 is not accessible"
|
|
||||||
' 2>/dev/null | grep "accessible"
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user