Mybash Nmap Script
Mybash Nmap Script
/bin/bash
#This script is a Nmap menu that displays different scan types written in bash
#The purpose of this script is for ease of use so you don’t have to remember all the different
#tacs for the Nmap options. The options will display in a list with numbers listed next to each
#option. To pick a specific option just enter the number that corresponds to the option you’d like
to
# select. After you select your option you will be prompted to provide information such as IPs,
#ports, or hosts you’d like to scan.
options=(“Single IP” “Single Host” “Range of IPs” “Single Port” “Range of Ports” “100 Most
Common Ports” “Scan All Ports” “SYN Scan” “OS Detection” “Quit”)
Select opt in “${options[@]}”
do
case $opt in
“Single IP”)
echo “Please enter the IP you would like to scan”
read $ip
nmap $ip
;;
“Single Host”)
echo “Please enter the host you would like to scan”
read $host
nmap $host
;;
“Range of IPs”)
echo “Please enter the range of IPs you would like to scan”
echo “(example 172.62.10.1-100)”
read $ip
nmap $ip
;;
“Single Port”)
echo “Please enter the IP or Host associated with this port scan”
read $ip
echo “Please enter the port you would like to scan”
read $port
nmap -p $port $ip
;;
“Range of Ports”)
echo “Please enter the IP or Host associated with this port scan”
read $ip
echo “Please enter the range of ports you would like to scan”
echo “example 1-100”
read $ports
nmap -p $ports $ip
;;
“100 Most Common Ports”)
echo “Please enter the IP or Host associated with this scan”
read $ip
nmap -F $ip
;;
“Scan All Ports”)
echo “Please enter the IP or Host associated with this port scan”
read $ip
nmap -p- $ip
;;
“SYN Scan”)
echo “Please enter the IP or Host associated with this scan”
read $ip
nmap -sS $ip
;;
“OS Detection”)
echo “Please enter the IP or Host of the machine you would like to run
OS Detection”
echo “Be aware that OS detection is a best guess and is not always 100
percent correct”
read $ip
nmap -A $ip
;;
“Quit”)
break
;;
*) echo “Invalid Option”;;
esac
done