Last active
March 4, 2020 08:21
-
-
Save Chan9390/a3c69ca3a8c9a28d97aa1345f42599c8 to your computer and use it in GitHub Desktop.
Faster nmap scanning with the help of GNU parallel - Part 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for dirname in logs/*; | |
do | |
for filename in ${dirname}/*.gnmap; | |
do | |
project=`echo $filename | cut -d/ -f2`; | |
ip=`echo $filename | cut -d/ -f3`; | |
ip=${ip::-6}; | |
cat $filename | cut -d' ' -f2,4- | sed -n -e 's/Ignored.*//p' | awk -v ip="$ip" -v project="$project" '{$1=""; for(i=2; i<=NF; i++) { a=a" "$i; }; split(a,s,","); for(e in s) { split(s[e],v,"/"); if (v[2] == "closed") { printf project "," ip ",%s,%s\n" , v[1], v[5]}}; a="" }'; | |
done; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment