/
script.sh
30 lines (26 loc) · 2.46 KB
/
script.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
#!/bin/bash
echo "
███╗ ██╗ █████╗ █████╗ ██████╗ ██╗ ██╗ ████████╗ ██████╗ ███╗ ██╗███╗ ███╗ █████╗ ██████╗
████╗ ██║██╔══██╗██╔══██╗██╔══██╗██║ ██║ ╚══██╔══╝██╔═══██╗ ████╗ ██║████╗ ████║██╔══██╗██╔══██╗
██╔██╗ ██║███████║███████║██████╔╝██║ ██║█████╗██║ ██║ ██║█████╗██╔██╗ ██║██╔████╔██║███████║██████╔╝
██║╚██╗██║██╔══██║██╔══██║██╔══██╗██║ ██║╚════╝██║ ██║ ██║╚════╝██║╚██╗██║██║╚██╔╝██║██╔══██║██╔═══╝
██║ ╚████║██║ ██║██║ ██║██████╔╝╚██████╔╝ ██║ ╚██████╔╝ ██║ ╚████║██║ ╚═╝ ██║██║ ██║██║
╚═╝ ╚═══╝╚═╝ ╚═╝╚═╝ ╚═╝╚═════╝ ╚═════╝ ╚═╝ ╚═════╝ ╚═╝ ╚═══╝╚═╝ ╚═╝╚═╝ ╚═╝╚═╝
Creator : @sengarharshit1
https://www.twitter.com/sengarharshit1
https://www.linkedin.com/in/sengarharshit1
"
if [ "$1" == "" ]
then
echo "
Usage:
./script.sh ip_list.txt
./script.sh ip_range (e.g., ./script.sh 192.168.1.1/24)
./script.sh single_ip (e.g., ./script.sh 192.168.43.68)
"
else
naabu -ports full -hL $1 -o naabu_scan.txt || naabu -ports full -host $1 -o naabu_scan.txt
cat naabu_scan.txt | cut -d ':' -f2 | sort -u > ports.txt
for i in `cat naabu_scan.txt | cut -d ':' -f1 |uniq`; do nmap -sS -Pn -sV -T3 -p $(sed ':a;N;$!ba;s/\n/,/g' ports.txt) $i -oN nmap_$i_scan.txt;done
rm ports.txt
fi