diff --git a/subbrute.py b/subbrute.py index 37191cd..6a14a91 100755 --- a/subbrute.py +++ b/subbrute.py @@ -24,6 +24,9 @@ import socket import struct +# Maximum time to wait for a DNS query to complete +QUERY_TIMEOUT = 4 + #Python 2.x and 3.x compatiablity #We need the Queue library for exception handling try: @@ -63,7 +66,7 @@ def query(self, hostname, query_type = 'ANY', name_server = False, use_tcp = Tru self.last_resolver = name_server query = dnslib.DNSRecord.question(hostname, query_type.upper().strip()) try: - response_q = query.send(name_server, 53, use_tcp) + response_q = query.send(name_server, 53, use_tcp, QUERY_TIMEOUT) if response_q: response = dnslib.DNSRecord.parse(response_q) else: @@ -856,4 +859,4 @@ def signal_init(): 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 + print_target(target, record_type, options.subs, options.resolvers, options.process_count, options.print_data, output, json_output)