Created
April 19, 2018 08:18
-
-
Save luca-m/3a5c7942392c5cb09b357e46c5bd19eb to your computer and use it in GitHub Desktop.
checkIPrange
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function checkIPrange(){ | |
START_IP=$(sipcalc $1 | grep "Usable range" | cut -f3 | tr "-" "\t" | cut -f2) | |
END_IP=$(sipcalc $1 | grep "Usable range" | cut -f3 | tr "-" "\t" | cut -f3) | |
echo "[+] Start: " $START_IP | |
echo "[+] End: " $END_IP | |
sudo systemctl start tor | |
proxychains -q curl -s https://check.torproject.org/ | grep "Congratulations. This browser is configured to use Tor" >/dev/null | |
if [ $? -ne 0 ]; then | |
echo "No Tor!" | |
return 1; | |
fi | |
REAL_IP=$(curl -s https://api.ipify.org) | |
TOR_IP=$(proxychains -q curl -s https://check.torproject.org/ | grep -oP '(?<=<strong>)\K[0-9\.]+(?=</strong>)') | |
echo "[+] Your real IP: " $REAL_IP | |
echo "[+] Your TOR IP: " $TOR_IP | |
echo "[+] executing: fping -s -g" $START_IP $END_IP "-r 1" | |
proxychains -q fping -s -g `echo "$START_IP" | sed -e 's/^[ \t]*//'` `echo "$END_IP" | sed -e 's/^[ \t]*//'` -r 1 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment