diff --git a/turbolist3r.py b/turbolist3r.py index 601b650..fbcbb29 100644 --- a/turbolist3r.py +++ b/turbolist3r.py @@ -25,7 +25,6 @@ import threading import socket import time from collections import Counter -from prettytable import PrettyTable # external modules # from subbrute import subbrute @@ -1031,8 +1030,8 @@ def main(domain, threads, savefile, ports, silent, verbose, enable_bruteforce, e # Method code added -cnames = '\033[94m== CNAME records ==\033[0m' -ahosts = '\033[94m== A records ==\033[0m' +cnames = ['\033[94m== CNAME records ==\033[0m'] +ahosts = ['\033[94m== A records ==\033[0m'] def lookup(guess, name_server): @@ -1141,19 +1140,8 @@ if __name__ == "__main__": else: res = main(domain, threads, savefile, ports, silent=False, verbose=verbose, enable_bruteforce=enable_bruteforce,engines=engines) - # Code added here - - # Code added here if (analyze): - cnametable = PrettyTable(["Name", "Records"]) - cnametable.align["Name"] = "l" - cnametable.align["Records"] = "l" - - atable = PrettyTable(["Name", "Records"]) - atable.align["Name"] = "l" - atable.align["Records"] = "l" - # res is the list of subdomains e.g. www.example.com, mail.example.com, etc resolvers = ['8.8.8.8', '8.8.4.4', '9.9.9.9', '1.1.1.1', '1.0.0.1'] server = 0 @@ -1168,13 +1156,9 @@ if __name__ == "__main__": # if the query did not return an error, then add result to appropriate array if rtype != "ERROR": if rtype == "CNAME": - i = [name,record] - cnametable.add_row(i) - + cnames.append(name + " -->-- " + record) elif rtype == "A": - i = [name,record] - atable.add_row(i) - + ahosts.append(name + " -->-- " + record) # round robin the resolvers server = server + 1 server = server % len(resolvers) @@ -1192,20 +1176,17 @@ if __name__ == "__main__": # Known errors: subdomain sample starting with a dot, ex .domain.com continue + ahosts.sort() + cnames.sort() - print cnames - print cnametable - - print ahosts - print atable # output analysis results to console - + for x in range(0, len(ahosts)): + print(G + ahosts[x] + W) + print("\n") + for x in range(0, len(cnames)): + print(G + cnames[x] + W) if (analysisfile!=None): # save the analysis to a file. Merge the arrays into one list for easier reading - result = ahosts + "\n" + str(atable) + "\n" + cnames + "\n" + str(cnametable) + "\n" - - file = open(analysisfile,"w") - file.write(result) - file.close() - print(B + "Saved reverse DNS analysis to " + R + analysisfile + W) + write_file(analysisfile, ahosts + ["\n"] + cnames) + print(B + "Saved reverse DNS analysis to " + analysisfile + W)