Skip to content

Instantly share code, notes, and snippets.

@savon-noir
Created May 7, 2013 23:07
Show Gist options
  • Save savon-noir/5536910 to your computer and use it in GitHub Desktop.
Save savon-noir/5536910 to your computer and use it in GitHub Desktop.
dirty json
from libnmap.parser import NmapParser
from libnmap.report import NmapReport
import json
r = NmapParser.parse_fromfile('/root/dev/python-nmap-lib/libnmap/test/files/1_hosts.xml')
rec = r.db().get('51828e572c15d015af53a4a3')
j = rec[0]
del j['_id']
s = json.dumps(j)
nr = json.loads(s, cls=ReportDecoder)
nr.name
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment