Advertisement
AZZATSSINS_CYBERSERK

Ping sweep

Dec 23rd, 2019
256
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.42 KB | None | 0 0
  1. #!/bin/bash
  2. #Usage : bash file.sh 123.456.78
  3. #Cari IP yang aktif 1-255
  4.  
  5. if [ -z "$1" ]; then
  6.         echo ""
  7.     echo "[*] Please enter a valid base IP"
  8.         echo ""
  9.     exit 0
  10. fi
  11.  
  12. echo ""
  13. echo "[*] Listing live IPs"
  14. echo ""
  15.  
  16. for ip in $(seq 0 254); do
  17. ping -c 1 $1.$ip | grep "bytes from" | cut -d " " -f4 | cut -d ":" -f1 >> sweep.txt&
  18.  
  19. done
  20.  
  21. # Printing from text file for clean output
  22. cat sweep.txt
  23. rm sweep.txt
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement