Created
February 2, 2022 18:10
-
-
Save YSaxon/d2b23c36bfbcdcbeca9d2c711df78861 to your computer and use it in GitHub Desktop.
awk snippet to get open ports from nmap output each formatted as xxx.xxx.xxx.xxx:port
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
#adapted from https://itectec.com/unixlinux/parse-grepable-nmap-output-to-print-a-list-of-iptall-open-ports-with-text-utils-like-awk/ | |
cat nmap_output.gnmap | awk '{ | |
for (i=4;i<=NF;i++) { | |
split($i,a,"/"); | |
if (a[2]=="open") printf "\n%s:%s",$2,a[1];} | |
print ""}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment