Created
December 20, 2013 22:18
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
It worked for me after replacing the source code of Networkinventry.py of zenmapcore from this link.