Guest User

PortZ update2

a guest
Jul 19th, 2015
212
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/bash
  2.  
  3. ###Made by Appledash48 for all who wish to use it
  4.  
  5. ###Pause function
  6. function pause(){
  7.    read -sn 1 -p "Press any key to continue..."
  8. }
  9.  
  10. ###Hping caller
  11. function hping {
  12.  
  13.     clear
  14.     echo "Enter IP address to scan (will scan the subnet)"
  15.     echo "Example: google.com is 74.125.225.0"
  16.     read IPn
  17.     echo ""$IPn"? Okay."
  18.     echo
  19.  
  20.     echo "Enter port to be scanned"
  21.     echo "Example: 5505"
  22.     echo "Example2: To scan multiple ports, format it like this: 5505-6000"
  23.     read PORTn
  24.     echo ""$PORTn"? Okay."
  25.     echo
  26.  
  27.     echo "Enter packets to be sent"
  28.     read PACKETS
  29.     echo ""PACKETS" Okay"
  30.     echo
  31.  
  32.     echo "Scanning "$IPn" subnet for port "$PORTn" with "$PACKETS" packets. Is this correct? [Y/n]"
  33.     read param
  34.     if [[ $param = Y || $param = y ]] ; then
  35.     echo "Okay"
  36.     pause
  37.     echo
  38.         hping3 -c $PACKETS -S $IPn/24 -p PORTn > hpingscan
  39.         cat hpingscan
  40.     else hping
  41.     fi
  42. }
  43.  
  44. ###nmap caller
  45. function nmap {
  46.     clear
  47.     echo "Enter IP address to scan (will scan the subnet)"
  48.     echo "Example: google.com is 74.125.225.0"
  49.     read IP
  50.     echo ""$IP"? Okay."
  51.     echo
  52.  
  53.     echo "Enter port to be scanned"
  54.     echo "Example: 5505"
  55.     echo "Example2: To scan multiple ports, format it like this: 5505-6000"
  56.     read PORT
  57.     echo ""$PORT"? Okay."
  58.     echo
  59.  
  60.     echo "Scanning "$IP" subnet for port "$PORT" Is this correct? [Y/n]"
  61.     read param
  62.     if [[ $param = Y || $param = y ]] ; then
  63.     echo "Okay"
  64.     pause
  65.     echo
  66.         nmap -sT $IP/24 -p $PORT -oG ports
  67.  
  68.         cat ports | grep open > portsopen
  69.         cat portsopen | cut -f2 -d "." | cut -f1 -d "(" > portsvuln
  70.         less portsvuln
  71.     else nmap
  72.     fi
  73. }
  74.  
  75.  
  76. ###title caller
  77. function title {
  78.     clear
  79.     echo "+----+      +--+       +----+   ---+---      -----+"
  80.     echo "|    |     /  \     /      \     |           / "
  81.     echo "|   /     |    |   |             |          /  "
  82.     echo "|--+      |    |   |             |         /   "
  83.     echo "|          \  /    |             |        /    "
  84.     echo "|           +--+     |             |     +----- "
  85.     echo "================================================="
  86.     select CHOOSE in "Nmap" "hping" "EXIT" ; do
  87.         case $CHOOSE in
  88.         "1" )
  89.           nmap
  90.           clear
  91.           pause ;;
  92.  
  93.         "2" )
  94.           hping
  95.           clear
  96.           pause ;;
  97.  
  98.         "3" )
  99.           clear
  100.           exit 0 ;;
  101.  
  102. esac
  103. break
  104. done
  105. }
  106.  
  107. title
RAW Paste Data