File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed
Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -511,6 +511,6 @@ class NmapScripts(Nmap):
511511 parser .add_argument ('-d' , '--d' , help = 'Help' , required = True )
512512 args = parser .parse_args ()
513513
514- nmap = Nmap ()
515- result = nmap .nmap_version_detection (args .d )
514+ nmap = NmapHostDiscovery ()
515+ result = nmap .nmap_no_portscan (args .d )
516516 print (json .dumps (result , indent = 4 , sort_keys = True ))
Original file line number Diff line number Diff line change @@ -238,15 +238,27 @@ def parse_noportscan(self, xmlroot):
238238 # Find all hosts
239239 all_hosts = xmlroot .findall ("host" )
240240 for host in all_hosts :
241-
242241 host_record = {}
242+ address = []
243+ hostnames = []
244+
243245 if host .find ("status" ) is not None :
244246 for key in host .find ("status" ).attrib :
245247 host_record [key ]= host .find ("status" ).attrib .get (key )
246248
247249 for key in host .find ("address" ).attrib :
248250 host_record [key ]= host .find ("address" ).attrib .get (key )
249-
251+
252+ for key in host .findall ("address" ):
253+ address .append (key .attrib )
254+ host_record ["addresses" ]= address
255+
256+ for hostname in host .find ("hostnames" ):
257+ for hosts in hostname .findall ("hostname" ):
258+ hostnames .append (hosts .attrib )
259+
260+ host_record ["hostnames" ]= hostnames
261+
250262 hosts_list .append (host_record )
251263
252264 runstats = xmlroot .find ("runstats" )
You can’t perform that action at this time.
0 commit comments