Skip to content

Commit

Permalink
Merge pull request #39 from projectdiscovery/feature-helper-folder
Browse files Browse the repository at this point in the history
adding nmap helper
  • Loading branch information
ehsandeep authored Jun 4, 2020
2 parents 837448c + d081c8c commit fa37979
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions scripts/tonmap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/env bash

TARGETSFILE="$1"
PORTSFILE="$2"

if [ -z "$1" ]
then
TARGETSFILE="naabu_output_targets.txt"
fi
if [ -z "$2" ]
then
PORTSFILE="naabu_output_ports.txt"
fi


# truncate files
truncate -s 0 $TARGETSFILE
truncate -s 0 $PORTSFILE

while IFS=: read ip port; do
echo $ip>>$TARGETSFILE
echo $port>>$PORTSFILE
done

# sort output
sort -u -o $TARGETSFILE $TARGETSFILE
sort -u -o $PORTSFILE $PORTSFILE

# in ports replace newline with comma
ports=`cat $PORTSFILE | tr '\n' ','`

# parse and prepare nmap command
echo "nmap -iL $TARGETSFILE -p ${ports:0:-1} -sV"

0 comments on commit fa37979

Please sign in to comment.