Skip to content

Instantly share code, notes, and snippets.

@savon-noir
Created May 5, 2013 20:45
Show Gist options
  • Save savon-noir/5522111 to your computer and use it in GitHub Desktop.
Save savon-noir/5522111 to your computer and use it in GitHub Desktop.
from libnmap import NmapParser, NmapReport
import json
from libnmap import ReportEncoder
d = NmapParser.parse_fromfile('/root/dev/python-nmap-lib/libnmap/test/files/1_hosts.xml')
r = NmapReport('t1', d)
j = json.dumps(r, cls=ReportEncoder)
r.db().db_insert(json.loads(j))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment