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

Fix dnsresolve dedupe bug #2040

Merged
merged 2 commits into from
Nov 26, 2024
Merged
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
5 changes: 3 additions & 2 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,9 +83,9 @@ 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 event.type == "DNS_NAME" and self.scan.ingress_module.is_incoming_duplicate(event, add=True):
if not event._graph_important:
return False, "event was already emitted by its module"
return False, "it's a DNS wildcard, and its module already emitted a similar wildcard event"
else:
self.debug(
f"Event {event} was already emitted by its module, but it's graph-important so it gets a pass"
Expand Down