forked from leebaird/discover
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nikto.sh
executable file
·83 lines (67 loc) · 1.6 KB
/
nikto.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/usr/bin/bash
# Check for root
if [ $EUID == 0 ]; then
echo
echo
echo "[!] This option cannot be ran as root."
echo
exit
fi
clear
f_banner
echo -e "${BLUE}Run multiple instances of Nikto in parallel.${NC}"
echo
echo "1. List of IPs"
echo "2. List of IP:port"
echo "3. Previous menu"
echo
echo -n "Choice: "
read choice
case $choice in
1)
f_location
echo
echo -n "Port (default 80): "
read port
echo
# Check if port is a number
echo "$port" | grep -E "^[0-9]+$" 2>/dev/null
isnum=$?
if [ $isnum -ne 0 ] && [ ${#port} -gt 0 ]; then
f_error
fi
if [ ${#port} -eq 0 ]; then
port=80
fi
if [ $port -lt 1 ] || [ $port -gt 65535 ]; then
f_error
fi
mkdir $home/data/nikto-$port
while read -r line; do
xdotool key ctrl+shift+t
xdotool type "nikto -h $line -port $port -no404 -maxtime 15m -Format htm --output $home/data/nikto-$port/$line.htm ; exit"
sleep 1
xdotool key Return
done < "$location"
;;
2)
f_location
mkdir $home/data/nikto
while IFS=: read -r host port; do
xdotool key ctrl+shift+t
sleep 1
xdotool type "nikto -h $host -port $port -no404 -maxtime 15m -Format htm --output $home/data/nikto/$host-$port.htm ; exit"
sleep 1
xdotool key Return
done < "$location"
;;
3) f_main;;
*) f_error;;
esac
echo
echo $medium
echo
echo "***Scan complete.***"
echo
echo
echo -e "The new report is located at ${YELLOW}$home/data/nikto-$port/${NC}\n"