Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
01rabbit authored Mar 7, 2023
1 parent 5d0d625 commit acf659a
Showing 1 changed file with 59 additions and 14 deletions.
73 changes: 59 additions & 14 deletions modules/kali-tools-top10/7_kp_nmap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ function menu_nmap(){
num2 5 "nmap"
num1 10 "Ping_Scan"
num2 10 "Intense_Scan"
num3 10 "Intense_Scan+UDP"
num4 10 "Intense_Scan_all_TCP_Port"
num3 10 "Intense_Scan_UDP"
num4 10 "Intense_Scan_all_TCP"
num5 10 "Vuln_Scan"
num6 10 "Manual"
num9 10 "Back"
Expand Down Expand Up @@ -53,7 +53,7 @@ function cmd_nmap1(){
if [ ! -d result/$TARGET ];then
mkdir result/$TARGET
fi
show_number 1021 "nmap Ping_Scan"
show_number 1021 "nmap PingScan"
tmux split-window -v
tmux send-keys "${cmd};read;exit" C-m
tmux select-pane -t "${TITLE}".0
Expand All @@ -74,14 +74,26 @@ function cmd_nmap2(){
printf "┌─(${PURPLE}$TITLE${NC})${RED}${USERNAME}@${HOSTNAME}${NC}:${RED}[1]Kali-tools-top10${NC} > ${GREEN}[2]$cmd${NC} > ${GREEN}[2]IntenseScan${NC}\n"
printf "+${BLUE}Options${NC}:\n"
printf "| ${YELLOW}-Pn${NC}: Treat all hosts as online -- skip host discovery\n"
printf "| ${YELLOW}-p <port ranges>${NC}: Only scan specified ports\n"
printf "| ${YELLOW}Ex${NC}: -p22; -p1-65535; -p U:53,111,137,T:21-25,80,139,8080,S:9\n"
printf "| ${YELLOW}-T<0-5>${NC}: Set timing template (higher is faster)\n"
printf "| ${YELLOW}-A${NC}: Enable OS detection, version detection, script scanning, and traceroute\n"
printf "| ${YELLOW}-oA <basename>${NC}: Output in the three major formats at once\n"
printf "| ${YELLOW}-v${NC}: Increase verbosity level (use -vv or more for greater effect)\n"
read -p "> Input Target IP: " TARGET
echo "|"
echo "> Here, we run a port scan beforehand and perform an Intense Scan of the open ports."
echo "> Running port scan on all ports..."

FILE=(result/$TARGET/PortScan_`date "+%Y%m%d-%H%M%S"`.nmap)
nmap -T4 -Pn $TARGET -oN $FILE

if [ -e $FILE ];then
echo "> Extracting open ports..."
open_ports=$(grep -E '^[0-9]+/tcp *open' $FILE |cut -d '/' -f 1|paste -sd ",")
fi
printf "+${BLUE}usage${NC}: nmap ${WHITE}[Scan Type...] [Options] {target specification}${NC}\n"
cmd="${cmd} -Pn -T4 -A -v -oA result/$TARGET/IntenseScan_`date "+%Y%m%d-%H%M%S"` $TARGET"
cmd="${cmd} -Pn -p $open_ports -T4 -A -v -oA result/$TARGET/IntenseScan_`date "+%Y%m%d-%H%M%S"` $TARGET"
echo "└─Command > $cmd"
echo ""
echo "> You ready?"
Expand All @@ -93,11 +105,10 @@ function cmd_nmap2(){
if [ ! -d result/$TARGET ];then
mkdir result/$TARGET
fi
show_number 1022 "nmap Intense_Scan"
show_number 1022 "nmap IntenseScan"
tmux split-window -v
tmux send-keys "${cmd};read;exit" C-m
tmux select-pane -t "${TITLE}".0

# eval $cmd
else
:
Expand All @@ -112,19 +123,30 @@ function cmd_nmap3(){
clear
figlet Nmap
cmd="nmap"
printf "┌─(${PURPLE}$TITLE${NC})${RED}${USERNAME}@${HOSTNAME}${NC}:${RED}[1]Kali-tools-top10${NC} > ${GREEN}[2]$cmd${NC} > ${YELLOW}[3]IntenseScan+UDP${NC}\n"
printf "┌─(${PURPLE}$TITLE${NC})${RED}${USERNAME}@${HOSTNAME}${NC}:${RED}[1]Kali-tools-top10${NC} > ${GREEN}[2]$cmd${NC} > ${YELLOW}[3]IntenseScan_UDP${NC}\n"
printf "+${BLUE}Options${NC}:\n"
printf "| ${YELLOW}-Pn${NC}: Treat all hosts as online -- skip host discovery\n"
printf "| ${YELLOW}-sS/sT/sA/sW/sM${NC}: TCP SYN/Connect()/ACK/Window/Maimon scANS\n"
printf "| ${YELLOW}-p <port ranges>${NC}: Only scan specified ports\n"
printf "| ${YELLOW}Ex${NC}: -p22; -p1-65535; -p U:53,111,137,T:21-25,80,139,8080,S:9\n"
printf "| ${YELLOW}-sU${NC}: UDP Scan\n"
printf "| ${YELLOW}-T<0-5>${NC}: Set timing template (higher is faster)\n"
printf "| ${YELLOW}-A${NC}: Enable OS detection, version detection, script scanning, and traceroute\n"
printf "| ${YELLOW}-oA <basename>${NC}: Output in the three major formats at once\n"
printf "| ${YELLOW}-v${NC}: Increase verbosity level (use -vv or more for greater effect)\n"
read -p "> Input Target IP: " TARGET
echo "|"
echo "> Here, we run a port scan beforehand and perform an Intense Scan of the open ports."
echo "> Running port scan on all ports..."

FILE=(result/$TARGET/PortScanUDP_`date "+%Y%m%d-%H%M%S"`.nmap)
sudo nmap -sU -F -Pn -T4 $TARGET -oN $FILE

if [ -e $FILE ];then
echo "> Extracting open ports..."
open_ports=$(grep -E '^[0-9]+/udp *open' $FILE |cut -d '/' -f 1|paste -sd ",")
fi
printf "+${BLUE}usage${NC}: nmap ${WHITE}[Scan Type...] [Options] {target specification}${NC}\n"
cmd="${cmd} -Pn -sS -sU -T4 -A -v -oA result/$TARGET/IntenseScanUDP_`date "+%Y%m%d-%H%M%S"` $TARGET"
cmd="sudo ${cmd} -Pn -sU -p $open_ports -T4 -A -v -oA result/$TARGET/IntenseScanUDP_`date "+%Y%m%d-%H%M%S"` $TARGET"
echo "└─Command > $cmd"
echo ""
echo "> You ready?"
Expand All @@ -136,7 +158,7 @@ function cmd_nmap3(){
if [ ! -d result/$TARGET ];then
mkdir result/$TARGET
fi
show_number 1023 "nmap Intense_Scan+UDP"
show_number 1023 "nmap IntenseScan UDP"
tmux split-window -v
tmux send-keys "${cmd};read;exit" C-m
tmux select-pane -t "${TITLE}".0
Expand Down Expand Up @@ -166,8 +188,18 @@ function cmd_nmap4(){
printf "| ${YELLOW}-v${NC}: Increase verbosity level (use -vv or more for greater effect)\n"
read -p "> Input Target IP: " TARGET
echo "|"
echo "> Here, we run a port scan beforehand and perform an Intense Scan of the open ports."
echo "> Running port scan on all ports..."

FILE=(result/$TARGET/PortScanAllTCP_`date "+%Y%m%d-%H%M%S"`.nmap)
nmap -T4 -Pn -p 1-65535 $TARGET -oN $FILE

if [ -e $FILE ];then
echo "> Extracting open ports..."
open_ports=$(grep -E '^[0-9]+/tcp *open' $FILE |cut -d '/' -f 1|paste -sd ",")
fi
printf "+${BLUE}usage${NC}: nmap ${WHITE}[Scan Type...] [Options] {target specification}${NC}\n"
cmd="${cmd} -Pn -p 1-65535 -T4 -A -v -oA result/$TARGET/IntenseScanAllTCP_`date "+%Y%m%d-%H%M%S"` $TARGET"
cmd="${cmd} -Pn -p $open_port -T4 -A -v -oA result/$TARGET/IntenseScanAllTCP_`date "+%Y%m%d-%H%M%S"` $TARGET"
echo "└─Command > $cmd"
echo ""
echo "> You ready?"
Expand All @@ -179,7 +211,7 @@ function cmd_nmap4(){
if [ ! -d result/$TARGET ];then
mkdir result/$TARGET
fi
show_number 1024 "nmap Intense_Scan_all_TCP"
show_number 1024 "nmap IntenseScan All TCP"
tmux split-window -v
tmux send-keys "${cmd};read;exit" C-m
tmux select-pane -t "${TITLE}".0
Expand All @@ -201,14 +233,26 @@ function cmd_nmap5(){
printf "┌─(${PURPLE}$TITLE${NC})${RED}${USERNAME}@${HOSTNAME}${NC}:${RED}[1]Kali-tools-top10${NC} > ${GREEN}[2]$cmd${NC} > ${PURPLE}[5]Vuln Scan${NC}\n"
printf "+${BLUE}Options${NC}:\n"
printf "| ${YELLOW}-Pn${NC}: Treat all hosts as online -- skip host discovery\n"
printf "| ${YELLOW}-p <port ranges>${NC}: Only scan specified ports\n"
printf "| ${YELLOW}Ex${NC}: -p22; -p1-65535; -p U:53,111,137,T:21-25,80,139,8080,S:9\n"
printf "| ${YELLOW}--script=<Lua scripts>${NC}: <Lua scripts> is a comma separated list of\n"
printf "| directories, script-files or script-categories\n"
printf "| ${YELLOW}-oA <basename>${NC}: Output in the three major formats at once\n"
printf "| ${YELLOW}-v${NC}: Increase verbosity level (use -vv or more for greater effect)\n"
read -p "> Input Target IP: " TARGET
echo "|"
echo "> Here, we run a port scan beforehand and perform an Intense Scan of the open ports."
echo "> Running port scan on all ports..."

FILE=(result/$TARGET/PortScanAllTCP_Vuln_`date "+%Y%m%d-%H%M%S"`.nmap)
nmap -T4 -p 1-65535 $TARGET -oN $FILE

if [ -e $FILE ];then
echo "> Extracting open ports..."
open_ports=$(grep -E '^[0-9]+/tcp *open' $FILE |cut -d '/' -f 1|paste -sd ",")
fi
printf "+${BLUE}usage${NC}: nmap ${WHITE}[Scan Type...] [Options] {target specification}${NC}\n"
cmd="${cmd} -Pn --script vuln -v -oA result/$TARGET/ScriptScanVuln_`date "+%Y%m%d-%H%M%S"` $TARGET"
cmd="${cmd} -Pn -p $open_ports --script vuln -v -oA result/$TARGET/ScriptScanVuln_`date "+%Y%m%d-%H%M%S"` $TARGET"
echo "└─Command > $cmd"
echo ""
echo "> You ready?"
Expand All @@ -220,7 +264,7 @@ function cmd_nmap5(){
if [ ! -d result/$TARGET ];then
mkdir result/$TARGET
fi
show_number 1025 "nmap Vuln_Scan"
show_number 1025 "nmap VulnScan"
tmux split-window -v
tmux send-keys "${cmd};read;exit" C-m
tmux select-pane -t "${TITLE}".0
Expand All @@ -244,6 +288,7 @@ function cmd_nmap6(){
printf "| ${YELLOW}-sn${NC}: Ping Scan - disable port scan\n"
printf "| ${YELLOW}-Pn${NC}: Treat all hosts as online -- skip host discovery\n"
printf "| ${YELLOW}-T<0-5>${NC}: Set timing template (higher is faster)\n"
printf "| ${YELLOW}-sS/sT/sA/sW/sM${NC}: TCP SYN/Connect()/ACK/Window/Maimon scANS\n"
printf "| ${YELLOW}-A${NC}: Enable OS detection, version detection, script scanning, and traceroute\n"
printf "| ${YELLOW}-p <port ranges>${NC}: Only scan specified ports\n"
printf "| ${YELLOW}Ex${NC}: -p22; -p1-65535; -p U:53,111,137,T:21-25,80,139,8080,S:9\n"
Expand Down

0 comments on commit acf659a

Please sign in to comment.