diff options
Diffstat (limited to 'tmap')
-rwxr-xr-x | tmap | 15 |
1 files changed, 6 insertions, 9 deletions
@@ -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)) |