From bc02651e787abb9a9db92b1c01ec349a160c65bb Mon Sep 17 00:00:00 2001 From: ekultek Date: Sun, 10 Sep 2017 08:50:41 -0500 Subject: [PATCH] edited so that the type in the output won't be messed up --- lib/attacks/nmap_scan/__init__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/attacks/nmap_scan/__init__.py b/lib/attacks/nmap_scan/__init__.py index 975ffe6..8914a16 100644 --- a/lib/attacks/nmap_scan/__init__.py +++ b/lib/attacks/nmap_scan/__init__.py @@ -53,6 +53,8 @@ class NmapHook(object): """ outputs the current scan information """ + # have to create a spacer or the output comes out funky.. + spacer_data = {4: " " * 8, 6: " " * 6, 8: " " * 4} logger.info(set_color("finding data for IP '{}'...".format(self.ip))) json_data = json.loads(json_data)["scan"] print( @@ -66,9 +68,12 @@ class NmapHook(object): oports = json_data[self.ip]["tcp"].keys() oports.sort() for port in oports: + port_status = json_data[self.ip]["tcp"][port]["state"] + # output the found port information.. print( - "Port: {}\tStatus: {}\tType: {}".format( + "Port: {}\tStatus: {}{}Type: {}".format( port, json_data[self.ip]["tcp"][port]["state"], + spacer_data[len(port_status)], json_data[self.ip]["tcp"][port]["name"] ) )