I'm trying to get the output of a Nmap NSE script to output properly to my terminal. I'm using the libnmap module, and have read a few examples as well as the documentation, so I'm not sure where I'm going wrong.
from libnmap.parser import NmapParser
p = NmapParser.parse_fromfile("test.xml")
for host in p.hosts:
for service in host.services:
for script_out in service.scripts_results:
print "Output of {0}: {1}".format(script_out['id'], script_out['output']
When I ran the script above, nothing outputted. If I get the logic of the above script to work properly, then I can probably get it to work in my main script.
I ran this nmap scan in my terminal to test the script. nmap -sV --script dns-brute.nse -oX test.xml google.com