Skip to content

Commit

Permalink
tweak mutation tracking logic
Browse files Browse the repository at this point in the history
  • Loading branch information
TheTechromancer committed Nov 13, 2023
1 parent 635ffb2 commit fa748a6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion bbot/modules/massdns.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,7 @@ async def finish(self):
)

base_mutations = set()
found_mutations = False
try:
for i, (domain, subdomains) in enumerate(trimmed_found):
self.verbose(f"{domain} has {len(subdomains):,} subdomains")
Expand Down Expand Up @@ -372,7 +373,6 @@ def add_mutation(_domain_hash, m):
add_mutation(domain_hash, subdomain)

if mutations:
self._mutation_run += 1
self.info(f"Trying {len(mutations):,} mutations against {domain} ({i+1}/{len(found)})")
results = list(await self.massdns(query, mutations))
for hostname in results:
Expand All @@ -382,11 +382,15 @@ def add_mutation(_domain_hash, m):
source_event = self.scan.root_event
self.emit_result(hostname, source_event, query, tags=[f"mutation-{self._mutation_run}"])
if results:
found_mutations = True
continue
break
except AssertionError as e:
self.warning(e)

if found_mutations:
self._mutation_run += 1

def add_found(self, host):
if not isinstance(host, str):
host = host.data
Expand Down

0 comments on commit fa748a6

Please sign in to comment.