From 5503bf5687619e3c0ab19a20b88f254a14762566 Mon Sep 17 00:00:00 2001 From: Touhid M Shaikh Date: Fri, 22 Mar 2019 18:43:03 +0530 Subject: [PATCH 1/3] Added Table View for records display. Added Table View for records display. A separate table for CNAME and A records. --- turbolist3r.py | 46 +++++++++++++++++++++++++++++++++------------- 1 file changed, 33 insertions(+), 13 deletions(-) diff --git a/turbolist3r.py b/turbolist3r.py index fbcbb29..913f41c 100644 --- a/turbolist3r.py +++ b/turbolist3r.py @@ -25,6 +25,12 @@ import threading import socket import time from collections import Counter +from prettytable import PrettyTable + + + + + # external modules # from subbrute import subbrute @@ -1030,8 +1036,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): @@ -1140,8 +1146,14 @@ 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"]) + atable = PrettyTable(["Name", "Records"]) + # 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 @@ -1156,9 +1168,14 @@ if __name__ == "__main__": # if the query did not return an error, then add result to appropriate array if rtype != "ERROR": if rtype == "CNAME": - cnames.append(name + " -->-- " + record) + #cnames.append(name + " -->-- " + record) + i = [name,record] + cnametable.add_row(i) + elif rtype == "A": - ahosts.append(name + " -->-- " + record) + #ahosts.append(name + " -->-- " + record) + i = [name,record] + atable.add_row(i) # round robin the resolvers server = server + 1 server = server % len(resolvers) @@ -1176,17 +1193,20 @@ 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 - write_file(analysisfile, ahosts + ["\n"] + cnames) - print(B + "Saved reverse DNS analysis to " + analysisfile + W) + 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) From cf4c0ca37dc0d7ad0570bd850034114e206f718f Mon Sep 17 00:00:00 2001 From: Touhid M Shaikh Date: Fri, 22 Mar 2019 18:46:47 +0530 Subject: [PATCH 2/3] Update turbolist3r.py --- turbolist3r.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/turbolist3r.py b/turbolist3r.py index 913f41c..717f3ff 100644 --- a/turbolist3r.py +++ b/turbolist3r.py @@ -26,12 +26,6 @@ import socket import time from collections import Counter from prettytable import PrettyTable - - - - - - # external modules # from subbrute import subbrute import dns.resolver @@ -1168,12 +1162,10 @@ if __name__ == "__main__": # if the query did not return an error, then add result to appropriate array if rtype != "ERROR": if rtype == "CNAME": - #cnames.append(name + " -->-- " + record) i = [name,record] cnametable.add_row(i) elif rtype == "A": - #ahosts.append(name + " -->-- " + record) i = [name,record] atable.add_row(i) # round robin the resolvers @@ -1193,7 +1185,6 @@ if __name__ == "__main__": # Known errors: subdomain sample starting with a dot, ex .domain.com continue - print cnames print cnametable @@ -1201,7 +1192,6 @@ if __name__ == "__main__": print atable # output analysis results to console - 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" From 39f43948fff422f49c38e8cecc0e184f01c4295b Mon Sep 17 00:00:00 2001 From: Touhid M Shaikh Date: Fri, 22 Mar 2019 19:06:33 +0530 Subject: [PATCH 3/3] Table Align to Left. Aligned Table to left for better looks. ;) --- turbolist3r.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/turbolist3r.py b/turbolist3r.py index 717f3ff..601b650 100644 --- a/turbolist3r.py +++ b/turbolist3r.py @@ -26,6 +26,7 @@ import socket import time from collections import Counter from prettytable import PrettyTable + # external modules # from subbrute import subbrute import dns.resolver @@ -1146,7 +1147,12 @@ if __name__ == "__main__": # 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'] @@ -1168,6 +1174,7 @@ if __name__ == "__main__": elif rtype == "A": i = [name,record] atable.add_row(i) + # round robin the resolvers server = server + 1 server = server % len(resolvers) @@ -1185,6 +1192,7 @@ if __name__ == "__main__": # Known errors: subdomain sample starting with a dot, ex .domain.com continue + print cnames print cnametable @@ -1192,6 +1200,7 @@ if __name__ == "__main__": print atable # output analysis results to console + 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"