diff --git a/dnslib/__init__.pyc b/dnslib/__init__.pyc new file mode 100644 index 0000000..f5a07ba Binary files /dev/null and b/dnslib/__init__.pyc differ diff --git a/dnslib/bimap.pyc b/dnslib/bimap.pyc new file mode 100644 index 0000000..ce0e97b Binary files /dev/null and b/dnslib/bimap.pyc differ diff --git a/dnslib/bit.pyc b/dnslib/bit.pyc new file mode 100644 index 0000000..b868fb1 Binary files /dev/null and b/dnslib/bit.pyc differ diff --git a/dnslib/buffer.pyc b/dnslib/buffer.pyc new file mode 100644 index 0000000..3c3f9b9 Binary files /dev/null and b/dnslib/buffer.pyc differ diff --git a/dnslib/dns.pyc b/dnslib/dns.pyc new file mode 100644 index 0000000..103dc2a Binary files /dev/null and b/dnslib/dns.pyc differ diff --git a/dnslib/label.pyc b/dnslib/label.pyc new file mode 100644 index 0000000..6108906 Binary files /dev/null and b/dnslib/label.pyc differ diff --git a/dnslib/lex.pyc b/dnslib/lex.pyc new file mode 100644 index 0000000..0452908 Binary files /dev/null and b/dnslib/lex.pyc differ diff --git a/dnslib/ranges.pyc b/dnslib/ranges.pyc new file mode 100644 index 0000000..e5bf8da Binary files /dev/null and b/dnslib/ranges.pyc differ diff --git a/subbrute.py b/subbrute.py index 37191cd..363ab06 100755 --- a/subbrute.py +++ b/subbrute.py @@ -23,6 +23,7 @@ import datetime import socket import struct +import requests #Python 2.x and 3.x compatiablity #We need the Queue library for exception handling @@ -530,8 +531,33 @@ def extract_directory(dir_name, hostname = ""): ret.append(h) return ret -def print_target(target, query_type = "ANY", subdomains = "names.txt", resolve_list = "resolvers.txt", process_count = 16, print_data = False, output = False, json_output = False): +def print_target(target, query_type = "ANY", subdomains = "names.txt", resolve_list = "resolvers.txt", process_count = 16, print_data = False, output = False, json_output = False, dnsdumpster=False): json_struct = {} + + if dnsdumpster: + s = requests.Session() + page_with_token = s.get("https://dnsdumpster.com/").text + csrf_token = re.findall("[a-zA-Z0-9]{32}", page_with_token)[0] + cookies = dict(csrftoken=csrf_token) + s.headers.update({ + "referer": "https://dnsdumpster.com/", + "origin" : "https://dnsdumpster.com/" + }) + payload = { + "csrfmiddlewaretoken" : csrf_token, + "targetip" : target + } + page_with_results = s.post("https://dnsdumpster.com/", data=payload, cookies=cookies).text + domain_regex = "([a-zA-Z0-9\-\.]+)\.{0}".format(target) + subdomains_dnsdump = re.findall(domain_regex, page_with_results) + for i in list(set(subdomains_dnsdump)): + subdomain_dnsdump = i + "." + target + print(subdomain_dnsdump) + sys.stdout.flush() + if output: + output.write(subdomain_dnsdump + "\n") + output.flush() + if not print_data: dupe_filter = {} for result in run(target, query_type, subdomains, resolve_list, process_count): @@ -820,6 +846,8 @@ def signal_init(): help = "(optional) Number of lookup theads to run. default = 16") parser.add_option("-v", "--verbose", action = 'store_true', dest = "verbose", default = False, help = "(optional) Print debug information.") + parser.add_option("--dnsdumpster", action="store_true", dest = "dnsdumpster", default = False, + help = "(optional) Print subdomains found by DNSDumpster.com at the beginning of output") (options, args) = parser.parse_args() verbose = options.verbose @@ -846,6 +874,7 @@ def signal_init(): except: error("Failed writing to file:", options.json) + #subbrute with find the best record to use if the type is None. record_type = "ANY" if options.type: @@ -855,5 +884,5 @@ def signal_init(): for target in targets: target = target.strip() if target: - trace(target, record_type, options.subs, options.resolvers, options.process_count, options.print_data, output, json_output) - print_target(target, record_type, options.subs, options.resolvers, options.process_count, options.print_data, output, json_output) \ No newline at end of file + trace(target, record_type, options.subs, options.resolvers, options.process_count, options.print_data, output, json_output, options.dnsdumpster) + print_target(target, record_type, options.subs, options.resolvers, options.process_count, options.print_data, output, json_output, options.dnsdumpster) \ No newline at end of file