Changes:
- The -a option no longer requires an argument and does not save RDNS analysis by default - Use --saverdns <file> to save analysis output - Added capability to perform RDNS on subdomains loaded from file (--inputfile) - Other minor edits
This commit is contained in:
parent
9101a974d0
commit
b8bb16636f
|
|
@ -23,6 +23,7 @@ import random
|
||||||
import multiprocessing
|
import multiprocessing
|
||||||
import threading
|
import threading
|
||||||
import socket
|
import socket
|
||||||
|
import time
|
||||||
from collections import Counter
|
from collections import Counter
|
||||||
|
|
||||||
# external modules
|
# external modules
|
||||||
|
|
@ -117,8 +118,10 @@ def parse_args():
|
||||||
default=30)
|
default=30)
|
||||||
parser.add_argument('-e', '--engines', help='Specify a comma-separated list of search engines')
|
parser.add_argument('-e', '--engines', help='Specify a comma-separated list of search engines')
|
||||||
parser.add_argument('-o', '--output', help='Save just domain names to specified text file')
|
parser.add_argument('-o', '--output', help='Save just domain names to specified text file')
|
||||||
parser.add_argument('-a', '--analysis', help='Do analysis of the results and save to specified text file')
|
parser.add_argument('-a', '--analyze', default=False, help='Do reverse DNS analysis and output results', action="store_true")
|
||||||
parser.add_argument('--debug', default=False, help='Enable verbose debug output', action="store_true")
|
parser.add_argument('--saverdns', help='Save reverse DNS analysis to specified file')
|
||||||
|
parser.add_argument('--inputfile', help='Read domains from specified file (perhaps from other tool) and use instead of searching engines. Use with -a to analyze domains')
|
||||||
|
parser.add_argument('--debug', default=False, help='Enable technical debug output', action="store_true")
|
||||||
return parser.parse_args()
|
return parser.parse_args()
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1121,19 +1124,26 @@ if __name__ == "__main__":
|
||||||
enable_bruteforce = args.bruteforce
|
enable_bruteforce = args.bruteforce
|
||||||
verbose = args.verbose
|
verbose = args.verbose
|
||||||
engines = args.engines
|
engines = args.engines
|
||||||
# Line added here
|
inputfile = args.inputfile
|
||||||
analysis = args.analysis
|
analyze = args.analyze
|
||||||
|
analysisfile = args.saverdns
|
||||||
debug = args.debug
|
debug = args.debug
|
||||||
if (debug):
|
if (debug):
|
||||||
print("Debugging output enabled for analysis module")
|
print("Debugging output enabled for analysis module")
|
||||||
if verbose or verbose is None:
|
if verbose or verbose is None:
|
||||||
verbose = True
|
verbose = True
|
||||||
banner()
|
banner()
|
||||||
|
if (inputfile != None):
|
||||||
|
print(B + "[-] Reading subdomains from " + inputfile + W)
|
||||||
|
f = open(inputfile, 'r')
|
||||||
|
res = f.readlines()
|
||||||
|
f.close()
|
||||||
|
else:
|
||||||
res = main(domain, threads, savefile, ports, silent=False, verbose=verbose, enable_bruteforce=enable_bruteforce,
|
res = main(domain, threads, savefile, ports, silent=False, verbose=verbose, enable_bruteforce=enable_bruteforce,
|
||||||
engines=engines)
|
engines=engines)
|
||||||
|
|
||||||
# Code added here
|
# Code added here
|
||||||
if (analysis):
|
if (analyze):
|
||||||
# res is the list of subdomains e.g. www.example.com, mail.example.com, etc
|
# 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', '75.75.75.75', '1.1.1.1', '1.0.0.1']
|
resolvers = ['8.8.8.8', '8.8.4.4', '9.9.9.9', '75.75.75.75', '1.1.1.1', '1.0.0.1']
|
||||||
server = 0
|
server = 0
|
||||||
|
|
@ -1159,6 +1169,7 @@ if __name__ == "__main__":
|
||||||
count = count + 1
|
count = count + 1
|
||||||
if (count % 30) == 0:
|
if (count % 30) == 0:
|
||||||
print(str(count) + '/' + total)
|
print(str(count) + '/' + total)
|
||||||
|
time.sleep(0.2) # This helps the script catch the Ctrl-C cancel without looping up to the next subdomain
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
print(R + '\n[-] User exit' + W)
|
print(R + '\n[-] User exit' + W)
|
||||||
exit()
|
exit()
|
||||||
|
|
@ -1177,6 +1188,7 @@ if __name__ == "__main__":
|
||||||
for x in range(0, len(cnames)):
|
for x in range(0, len(cnames)):
|
||||||
print(G + cnames[x] + W)
|
print(G + cnames[x] + W)
|
||||||
|
|
||||||
# print ""
|
if (analysisfile!=None):
|
||||||
# save the analysis to a file. Merge the arrays into one list for easier reading
|
# save the analysis to a file. Merge the arrays into one list for easier reading
|
||||||
write_file(analysis, ahosts + ["\n"] + cnames)
|
write_file(analysisfile, ahosts + ["\n"] + cnames)
|
||||||
|
print(B + "Saved reverse DNS analysis to " + analysisfile + W)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue