Skip to content

Commit

Permalink
small wildcard tweak
Browse files Browse the repository at this point in the history
  • Loading branch information
TheTechromancer committed Feb 4, 2024
1 parent 6cee78f commit b9095cb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions bbot/core/helpers/dns.py
Original file line number Diff line number Diff line change
Expand Up @@ -849,12 +849,13 @@ async def is_wildcard(self, query, ips=None, rdtype=None):
# for every parent domain, starting with the shortest
try:
for host in parents[::-1]:
# make sure we've checked that domain for wildcards
await self.is_wildcard_domain(host)

# for every rdtype
for _rdtype in list(base_query_ips):
# get the IPs from above
query_ips = base_query_ips.get(_rdtype, set())
# make sure we've checked that domain for wildcards
await self.is_wildcard_domain(host)
host_hash = hash(host)

if host_hash in self._wildcard_cache:
Expand Down
3 changes: 2 additions & 1 deletion bbot/modules/massdns.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ async def filter_event(self, event):
subdomain_depth = self.helpers.subdomain_depth(query) + 1
if subdomain_depth > self.max_depth:
eligible = False
reason = f"subdomain depth of *.{event.data} ({subdomain_depth}) > max_depth ({self.max_depth})"
reason = f"subdomain depth of *.{query} ({subdomain_depth}) > max_depth ({self.max_depth})"

# don't brute-force things that look like autogenerated PTRs
if self.helpers.is_ptr(query):
Expand All @@ -127,6 +127,7 @@ async def filter_event(self, event):
# reject if already processed
if self.already_processed(query):
return False, f'Query "{query}" was already processed'

if eligible:
self.processed.add(hash(query))
return True, reason
Expand Down

0 comments on commit b9095cb

Please sign in to comment.