From 3261e941f8c134d7c1a1b1b5710736a5d1459f47 Mon Sep 17 00:00:00 2001 From: TheTechromancer Date: Fri, 15 Dec 2023 11:01:10 -0500 Subject: [PATCH] only emit ORG_STUB for registered domains --- bbot/modules/internal/speculate.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/bbot/modules/internal/speculate.py b/bbot/modules/internal/speculate.py index c68a2fda6..e37ba9e08 100644 --- a/bbot/modules/internal/speculate.py +++ b/bbot/modules/internal/speculate.py @@ -126,9 +126,12 @@ async def handle_event(self, event): # ORG_STUB from TLD, SOCIAL, AZURE_TENANT org_stubs = set() if event.type == "DNS_NAME" and event.scope_distance == 0: - tld_stub = getattr(self.helpers.tldextract(event.data), "domain", "") - if tld_stub: - org_stubs.add(tld_stub) + tldextracted = self.helpers.tldextract(event.data) + registered_domain = getattr(tldextracted, "registered_domain", "") + if registered_domain: + tld_stub = getattr(tldextracted, "domain", "") + if tld_stub: + org_stubs.add(tld_stub) elif event.type == "SOCIAL": stub = event.data.get("stub", "") if stub: