Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save YSaxon/841e8af8471c9d544f1aafcd68915395 to your computer and use it in GitHub Desktop.
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
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