Last active
June 2, 2022 19:20
-
-
Save YSaxon/841e8af8471c9d544f1aafcd68915395 to your computer and use it in GitHub Desktop.
awk snippet to extract ips/ports from nmap output that have bad ciphers
This file contains hidden or 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
cat nmap/*.nmap | awk '/^[^\|]/ {if (printplugins==1 && !uniqdict[ip port]++) {print ip ":" port; for (i=0;i<pl;i++) {print pluginlines[i]}; print "\n"};pl=0;printplugins=0;} | |
/Nmap scan report for/ {match($0,/[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+/); ip = substr($0,RSTART,RLENGTH)} | |
/^[0-9]+.tcp/ {split($0,parr,"/"); port=parr[1]} | |
/^\|/ {pluginlines[pl++]=$0} | |
/ - [B-F]$/ {printplugins=1}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment