Skip to content

Instantly share code, notes, and snippets.

@NoifP
NoifP / nmap_trace_extract.py
Last active March 9, 2023 11:26 — forked from B0073D/nmap_trace_extract.py
This piece of python will extract hops from the XML output of nmap and write it to a CSV file in a format that Gephi can use.
import xml.etree.ElementTree as etree
tree = etree.parse('wowser.xml')
root = tree.getroot()
hosts = root.findall('host')
output_file = open('nmap_edges.csv', 'w')
output_file.truncate()
output_file.write("Source,Target\n")
for i in hosts: