Skip to content

Commit 9c40102

Browse files
committed
Fixes bug #29 NameError: name 'service_version_dict' is not defined
1 parent c371b45 commit 9c40102

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

nmap3/nmap3.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,11 +500,17 @@ def nmap_disable_dns(self, target, args=None):
500500
tcp_results = self.parser.filter_top_ports(xml_root)
501501
return tcp_results
502502

503+
class NmapScripts(Nmap):
504+
"""
505+
This will be responsible for the nmap extra scriptin engine
506+
"""
507+
pass
508+
503509
if __name__=="__main__":
504510
parser = argparse.ArgumentParser(prog="Python3 nmap")
505511
parser.add_argument('-d', '--d', help='Help', required=True)
506512
args = parser.parse_args()
507513

508514
nmap = Nmap()
509-
result = nmap.scan_top_ports(args.d)
515+
result = nmap.nmap_version_detection(args.d)
510516
print(json.dumps(result, indent=4, sort_keys=True))

nmap3/nmapparser.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -355,8 +355,10 @@ def version_parser(self, xmlroot):
355355
"""
356356
try:
357357
service_version = []
358+
service_version_dict = dict()
358359
scanned_host = xmlroot.findall("host")
359360
stats = xmlroot.attrib
361+
360362
for hosts in scanned_host:
361363
address = hosts.find("address").get("addr")
362364
ports = hosts.find("ports").findall("port")

0 commit comments

Comments
 (0)