Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #Ping Sweep Script
- #by n1k0n
- echo "What is the subnet you would like to scan?(e.g. 192.168.1.0):"
- read SUBNET
- echo "Please Wait..........."
- SUB=$(echo $SUBNET | cut -d "." -f 1-3)
- echo "------------------------------------------------------------------" > sweep_$SUBNET.txt
- echo "@@ This is a ping sweep report for subnet $SUBNET @@" >> sweep_$SUBNET.txt
- echo "@@ Completed on" $(echo $(date)) " @@" >> sweep_$SUBNET.txt
- echo "------------------------------------------------------------------" >> sweep_$SUBNET.txt
- for hosts in $(seq 254);do
- TEMP=$(ping -c 1 $SUB.$hosts 2> /dev/null | grep "bytes from" | cut -d " " -f 4 | cut -d ":" -f 1)
- echo $TEMP
- echo $TEMP >> sweep_$SUBNET.txt
- done;
- clear
- echo "Ping Sweep report for $SUBNET saved to $(pwd)/sweep_$SUBNET.txt"
- echo "##################################################################"
- cat sweep_$SUBNET.txt
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement