Skip to content

Instantly share code, notes, and snippets.

@bonsaiviking
Created December 20, 2013 22:18
Show Gist options
  • Save bonsaiviking/8062547 to your computer and use it in GitHub Desktop.
Save bonsaiviking/8062547 to your computer and use it in GitHub Desktop.
YMMV, but this should export a PNG of a zenmap topology from a Nmap XML file
#!/usr/bin/env python
import sys
if len(sys.argv) != 4:
print """{0} - Output a PNG from Nmap XML
Usage: {0} <scan.xml> <out.png> <width_in_pixels>""".format(sys.argv[0])
sys.exit(1)
try:
from zenmapGUI.TopologyPage import *
except ImportError:
import sys
sys.path.insert(0,"/edit/me/path/to/zenmap")
from zenmapGUI.TopologyPage import *
t = TopologyPage(NetworkInventory(sys.argv[1]))
pix = int(sys.argv[3])
t.radialnet.set_allocation((0,0,pix,pix))
t.update_radialnet()
t.radialnet.save_drawing_to_file(sys.argv[2])
@mousumipaul
Copy link

Receiving the same error. Any update on it?

@mousumipaul
Copy link

It worked for me after replacing the source code of Networkinventry.py of zenmapcore from this link.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment