Skip to content

Commit

Permalink
Merge pull request #918 from blacklanternsecurity/fix-azure-tenant
Browse files Browse the repository at this point in the history
Don't emit empty AZURE_TENANT events
  • Loading branch information
TheTechromancer authored Dec 20, 2023
2 parents 9ca8e27 + db94040 commit 850a97c
Showing 1 changed file with 13 additions and 13 deletions.
26 changes: 13 additions & 13 deletions bbot/modules/azure_tenant.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,19 +32,19 @@ async def handle_event(self, event):
tenant_names = set()
if domains:
self.verbose(f'Found {len(domains):,} domains under tenant for "{query}": {", ".join(sorted(domains))}')
for domain in domains:
if domain != query:
self.emit_event(domain, "DNS_NAME", source=event, tags=["affiliate", "azure-tenant"])
# tenant names
if domain.lower().endswith(".onmicrosoft.com"):
tenantname = domain.split(".")[0].lower()
if tenantname:
tenant_names.add(tenantname)

event_data = {"tenant-names": sorted(tenant_names), "domains": sorted(domains)}
if tenant_id is not None:
event_data["tenant-id"] = tenant_id
self.emit_event(event_data, "AZURE_TENANT", source=event)
for domain in domains:
if domain != query:
self.emit_event(domain, "DNS_NAME", source=event, tags=["affiliate", "azure-tenant"])
# tenant names
if domain.lower().endswith(".onmicrosoft.com"):
tenantname = domain.split(".")[0].lower()
if tenantname:
tenant_names.add(tenantname)

event_data = {"tenant-names": sorted(tenant_names), "domains": sorted(domains)}
if tenant_id is not None:
event_data["tenant-id"] = tenant_id
self.emit_event(event_data, "AZURE_TENANT", source=event)

async def query(self, domain):
url = f"{self.base_url}/autodiscover/autodiscover.svc"
Expand Down

0 comments on commit 850a97c

Please sign in to comment.