Skip to content

Instantly share code, notes, and snippets.

@hging
hging / verify_google_ips.sh
Created May 4, 2023 10:21 — forked from oasisfeng/verify_google_ips.sh
Shell script to verify connectable Google IPs
#!/bin/bash
if [ $# -ne 1 ]; then
echo "Usage: $0 <IP>[/subnet]"
exit 1
fi
for ip in $(nmap -sL $1 | awk '/Nmap scan report/{print $NF}'); do {
ip=$(echo $ip | tr -d '()')
output=$(curl --connect-to :443:$ip:443 --connect-timeout 5 --verbose --head https://www.google.com.hk 2>&1)