Skip to content

Instantly share code, notes, and snippets.

@thomaspatzke
Created November 15, 2013 08:35
Show Gist options
  • Save thomaspatzke/7481047 to your computer and use it in GitHub Desktop.
Save thomaspatzke/7481047 to your computer and use it in GitHub Desktop.
Create "host;name;port;service;product" CSV from nmap scan XML.
xmlstarlet sel -t -m '//port/state[@state="open"]' -v 'concat(ancestor::host/address/@addr,";",ancestor::host/hostnames/hostname[position()=1]/@name,";",../@portid,";",../service/@name,";",../service/@product)' -n file.xml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment