Advertisement
Fray117

IP SCANNER v.0.2

Mar 24th, 2018
215
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.89 KB | None | 0 0
  1. #! /bin/bash
  2. # Tool to enumerate hosts, and then portscan the results
  3. # Developed by Fray117
  4.  
  5. # TARGET
  6. echo "Enter the address range (192.168.x.x):"
  7. read target
  8.  
  9. #  OUTPUT
  10. echo "Enter a description for target:"
  11. read name
  12.  
  13. #Create scan results directory.
  14. mkdir $name
  15.  
  16. # START NMAP SCAN
  17. echo "*****************************"
  18. echo "* Starting Host Enumeration *"
  19. echo "*****************************"
  20. sudo nmap -sP $target | grep Host | awk -F" " '{ print $2 }' > ./$name/hosts.$name
  21.  
  22. echo "Scan Finished. Output saved as ./$name/hosts.$name"
  23.  
  24.    # START PORTSCAN
  25.    echo "******************"
  26.    echo "* SCANNING PORTS *"
  27.    echo "******************"
  28.    exec<./$name/hosts.$name
  29.    value=0
  30.    while read line
  31.    do
  32.             sudo nmap -sS $line > ./$name/$line.nmap
  33.         echo "$line.nmap written."
  34.    done
  35.  echo ""
  36.  echo "Portscans finished.  Output can be found in ./$name/"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement