edited so that the type in the output won't be messed up

This commit is contained in:
ekultek 2017-09-10 08:50:41 -05:00
parent 7dc6d9b510
commit bc02651e78

View file

@ -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"]
)
)