Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add explicit break when resolver pool is small #52

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion subbrute.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@
import socket
import struct

# Minimum number of seconds to wait before querying the same nameserver again
REPEAT_TIMEOUT = 5

#Python 2.x and 3.x compatiablity
#We need the Queue library for exception handling
try:
Expand Down Expand Up @@ -57,6 +60,9 @@ def query(self, hostname, query_type = 'ANY', name_server = False, use_tcp = Tru
response = None
if name_server == False:
name_server = self.get_ns()
# If we just picked the same one again, give it a break
if self.last_resolver == name_server:
time.sleep(REPEAT_TIMEOUT)
else:
self.wildcards = {}
self.failed_code = None
Expand Down Expand Up @@ -856,4 +862,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)
print_target(target, record_type, options.subs, options.resolvers, options.process_count, options.print_data, output, json_output)