Skip to content

Commit

Permalink
Fixes bug #29 NameError: name 'service_version_dict' is not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
nmmapper committed Sep 22, 2020
1 parent c371b45 commit 9c40102
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 7 additions & 1 deletion nmap3/nmap3.py
Expand Up @@ -500,11 +500,17 @@ def nmap_disable_dns(self, target, args=None):
tcp_results = self.parser.filter_top_ports(xml_root)
return tcp_results

class NmapScripts(Nmap):
"""
This will be responsible for the nmap extra scriptin engine
"""
pass

if __name__=="__main__":
parser = argparse.ArgumentParser(prog="Python3 nmap")
parser.add_argument('-d', '--d', help='Help', required=True)
args = parser.parse_args()

nmap = Nmap()
result = nmap.scan_top_ports(args.d)
result = nmap.nmap_version_detection(args.d)
print(json.dumps(result, indent=4, sort_keys=True))
2 changes: 2 additions & 0 deletions nmap3/nmapparser.py
Expand Up @@ -355,8 +355,10 @@ def version_parser(self, xmlroot):
"""
try:
service_version = []
service_version_dict = dict()
scanned_host = xmlroot.findall("host")
stats = xmlroot.attrib

for hosts in scanned_host:
address = hosts.find("address").get("addr")
ports = hosts.find("ports").findall("port")
Expand Down

0 comments on commit 9c40102

Please sign in to comment.