Skip to content

Commit

Permalink
fix dnsresolve bug
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Nov 26, 2024
1 parent 8ed0708 commit 555a4de
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions bbot/modules/internal/dnsresolve.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ async def handle_event(self, event, **kwargs):
if blacklisted:
return False, "it has a blacklisted DNS record"

# DNS resolution for hosts that aren't IPs
if not event_is_ip:
# if the event is within our dns search distance, resolve the rest of our records
if main_host_event.scope_distance < self._dns_search_distance:
Expand All @@ -82,13 +83,14 @@ async def handle_event(self, event, **kwargs):
event_data_changed = await self.handle_wildcard_event(main_host_event)
if event_data_changed:
# since data has changed, we check again whether it's a duplicate
if self.scan.ingress_module.is_incoming_duplicate(event, add=True):
if not event._graph_important:
return False, "event was already emitted by its module"
else:
self.debug(
f"Event {event} was already emitted by its module, but it's graph-important so it gets a pass"
)
if self.scan.ingress_module.is_incoming_duplicate(main_host_event):
if new_event:
if not event._graph_important:
return False, "event was already emitted by its module"
else:
self.debug(
f"Event {event} was already emitted by its module, but it's graph-important so it gets a pass"
)

# if there weren't any DNS children and it's not an IP address, tag as unresolved
if not main_host_event.raw_dns_records and not event_is_ip:
Expand Down

0 comments on commit 555a4de

Please sign in to comment.