Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Extract all open ports in Host:Port format from nmap XML output
xmlstarlet sel -t -m '//port/state[@state="open"]/parent::port' -v 'ancestor::host/address/@addr' -o : -v './@portid' -n nmap-output.xml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment