From e9420b23c4a7820f93b8118c61685ac1ff6bac4c Mon Sep 17 00:00:00 2001 From: Aleksej Jocic Date: Sat, 12 Jan 2019 00:39:36 +0100 Subject: making tmap output more nmapish --- tmap | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'tmap') diff --git a/tmap b/tmap index 5a3562f..e5476ee 100755 --- a/tmap +++ b/tmap @@ -210,18 +210,21 @@ def main(): r = dict() for h in HOSTS: r = hostScan(h, PORTS, WAIT_TIME, CLEARNET, JOBS) - f.write("Results for: {}\n".format(h)) for i in r.keys(): if len(r[i]) != 0: - f.write('{} open ports: {}\n'.format(i, str(r[i]))) - if BANNER: - f.write('PORT\tBANNER\n') + f.write('Tmap scan report for {}\n'.format(i)) + if BANNER == False: + f.write('PORT\tSTATE\n') + for j in r[i]: + f.write('{}\topen\n'.format(j)) if BANNER: + f.write('PORT\tSTATE\tBANNER\n') for j in r[i]: banner = getBanner(i,j,WAIT_TIME, CLEARNET) - if banner == "banner_error" or banner == '': - continue - f.write('{}\t{}\n'.format(j,banner)) + if banner == "banner_error": + f.write('{}\topen\n'.format(j)) + else: + f.write('{}\topen\t{}\n'.format(j,banner)) ## Record time of program stopping and display the time running to the user endTime = time.time() -- cgit v1.2.3