summaryrefslogtreecommitdiff
path: root/tmap
diff options
context:
space:
mode:
authoralexej996 <aleksej@spidermail.tk>2018-11-08 01:02:49 +0100
committeralexej996 <aleksej@spidermail.tk>2018-11-08 01:02:49 +0100
commit57e5f7f2a9756241cc65d17d8e19f947117bafc2 (patch)
tree48ba4faba41057a0880614f5a76567f9eeaafc28 /tmap
parent85aa48ce97d32f485503dd833d853b3ece6651f1 (diff)
adding newlines to the end of f.write
Diffstat (limited to 'tmap')
-rwxr-xr-xtmap15
1 files changed, 6 insertions, 9 deletions
diff --git a/tmap b/tmap
index 92ba600..3585c21 100755
--- a/tmap
+++ b/tmap
@@ -154,11 +154,9 @@ def main():
exit()
## Checking for file output
- if(OUTFILE != "empty_outfile"):
+ if OUTFILE != "empty_outfile":
f = open(OUTFILE, "w")
-
-
-
+
## Display message that scan is starting
print("Starting a scan...")
@@ -168,20 +166,19 @@ def main():
r = hostScan(h, PORTS, WAIT_TIME, CLEARNET)
for i in r.keys():
if len(r[i]) != 0:
- if(OUTFILE == "empty_outfile"):
+ if OUTFILE == "empty_outfile":
print('{} open ports: {}'.format(i, str(r[i])))
else:
- f.write('{} open ports: {}'.format(i, str(r[i])))
+ f.write('{} open ports: {}\n'.format(i, str(r[i])))
## Record time of program stopping and display the time running to the user
endTime = time.time()
totalTime = round(endTime - startTime, 2)
- if(OUTFILE == "empty_outfile"):
+ if OUTFILE == "empty_outfile":
print("Scan done in {} seconds".format(totalTime))
else:
- f.write("\n")
- f.write("Scan done in {} seconds".format(totalTime))
+ f.write("Scan done in {} seconds\n".format(totalTime))
f.close()
print("Results written to {}".format(OUTFILE))