Last active
December 2, 2023 10:20
-
-
Save sayantanHack/0b07a9db661c73f9c93bebcf7ecc69b7 to your computer and use it in GitHub Desktop.
This will get all IPs available in the same Subnet. You have to provide upto 3rd octate
This file contains 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
#!/bin/bash | |
if [ "$1" == "" ] | |
then | |
echo "Usage: ./ipfinder.sh [network IP]" | |
echo "Example: ./ipfinder.sh 192.168.0" | |
else | |
for ip in `seq 1 254`; do | |
ping -c 1 $1.$ip | grep "64 byte" | cut -d " " -f 4 | sed 's/.$//' & | |
done | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You have to provide upto 3rd octate.
./ipfinder.sh 192.168.0