We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 837448c commit d081c8cCopy full SHA for d081c8c
scripts/tonmap.sh
@@ -0,0 +1,33 @@
1
+#!/usr/bin/env bash
2
+
3
+TARGETSFILE="$1"
4
+PORTSFILE="$2"
5
6
+if [ -z "$1" ]
7
+ then
8
+ TARGETSFILE="naabu_output_targets.txt"
9
+fi
10
+if [ -z "$2" ]
11
12
+ PORTSFILE="naabu_output_ports.txt"
13
14
15
16
+# truncate files
17
+truncate -s 0 $TARGETSFILE
18
+truncate -s 0 $PORTSFILE
19
20
+while IFS=: read ip port; do
21
+ echo $ip>>$TARGETSFILE
22
+ echo $port>>$PORTSFILE
23
+done
24
25
+# sort output
26
+sort -u -o $TARGETSFILE $TARGETSFILE
27
+sort -u -o $PORTSFILE $PORTSFILE
28
29
+# in ports replace newline with comma
30
+ports=`cat $PORTSFILE | tr '\n' ','`
31
32
+# parse and prepare nmap command
33
+echo "nmap -iL $TARGETSFILE -p ${ports:0:-1} -sV"
0 commit comments