summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksej Jocic <aleksej@spidermail.tk>2019-01-12 00:39:36 +0100
committerAleksej Jocic <aleksej@spidermail.tk>2019-01-12 00:39:36 +0100
commite9420b23c4a7820f93b8118c61685ac1ff6bac4c (patch)
tree7535128b8e648e1257d06c98951db43ffc5b73e2
parent086b7547949315ad8f36a12df4fd8fac54c14b1e (diff)
making tmap output more nmapish
-rwxr-xr-xtmap17
1 files changed, 10 insertions, 7 deletions
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()