Skip to content

Commit

Permalink
Merge pull request #919 from blacklanternsecurity/dns-rotation
Browse files Browse the repository at this point in the history
Automatically Rotate DNS Servers
  • Loading branch information
TheTechromancer authored Dec 20, 2023
2 parents affb308 + a7218dd commit 9ca8e27
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions bbot/core/helpers/dns.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ def __init__(self, *args, **kwargs):
dns_queries_per_second = self._parent_helper.config.get("dns_queries_per_second", 100)
self._dns_rate_limiter = RateLimiter(dns_queries_per_second, "DNS")
super().__init__(*args, **kwargs)
self.rotate = True

async def resolve(self, *args, **kwargs):
async with self._dns_rate_limiter:
Expand Down Expand Up @@ -139,6 +140,8 @@ def __init__(self, parent_helper):

# copy the system's current resolvers to a text file for tool use
self.system_resolvers = dns.resolver.Resolver().nameservers
if len(self.system_resolvers) == 1:
log.warning("BBOT performs better with multiple DNS servers. Your system currently only has one.")
self.resolver_file = self.parent_helper.tempfile(self.system_resolvers, pipe=False)

self.filter_bad_ptrs = self.parent_helper.config.get("dns_filter_ptrs", True)
Expand Down

0 comments on commit 9ca8e27

Please sign in to comment.