|
Hey everyone,
This is my first attempt at programming/scripting. This script is designed to allow anyone to use the NMap network mapper to do varying levels of portscans against a given host. Eventually I would like to add output capability and some other things. Until then, any hints, suggeestions, or comments would be much appreciated.
Thanks,
Wakizashi
#This script uses the Nmap utility to run portscans on a target host. The #scan #types range from non-intrusive reconnassance scans to a full #blown scan with OS detection and more.
#
#You MUST have Nmap installed to use this script!!!
#
#Portscan v.002
# Written by Wakizashi
#
#These lines get the IP of the target host from the user
#
echo "Enter the IP or Range to scan (x.x.x.x, x.x.x.x/x, or x.x.x.x-x:"
read HOST_NAME
#This part lists the types of scans available to the user
SCAN_TYPE=0
while [ "$SCAN_TYPE" != "exit" ]
do
echo
echo "Choose a scan:?"
echo "C - Change target/range"
echo "0 - List Scan (No Intrusion)"
echo "1 - Detect host (Less Intrusion)"
echo "2 - Scan ports 1-1674 (Intrusive)"
echo "3 - Scan interesting ports (Intrusive)"
echo "4 - Scan ports 1-65535 (Intrusive)"
echo "5 - Basic scan w/OS Detection ()"
echo "exit - Type \"exit\" to quit"
echo ""
read SCAN_TYPE
case $SCAN_TYPE in
c)
echo "Enter the IP or Range to scan (x.x.x.x, x.x.x.x/x, or x.x.x.x-x:"
read HOST_NAME
;;
0)
nmap $HOST_NAME -v -sL #List Scan
;;
1)
nmap $HOST_NAME -v -sP #Host Detection
;;
2)
nmap $HOST_NAME -v -P0 #Scan ports 1-1674
;;
3)
nmap $HOST_NAME -v -F -P0 #Scan only Known Ports
;;
4)
nmap $HOST_NAME -v -P0 -p1-65535 #Scan Ports 1-65535
;;
5)
nmap $HOST_NAME -v -A -P0 #Enable OS Detection
esac
done
|