Listen to this Post

Introduction:
In the cat-and-mouse game of cybersecurity, Microsoft’s efforts to close one door often leads to the discovery of an open window. A new, open-source tool has emerged that leverages a previously undocumented endpoint to enumerate all domains associated with a Microsoft 365 tenant, entirely without authentication. This capability resurrects significant reconnaissance concerns for defenders while providing invaluable intelligence for ethical penetration testers and red teams.
Learning Objectives:
- Understand the mechanics of the new, non-authenticated Microsoft 365 domain enumeration method.
- Learn how to perform and defend against this reconnaissance technique using command-line tools and scripting.
- Implement defensive monitoring and configuration changes to mitigate the exposure of your tenant’s domain footprint.
You Should Know:
- The Reconnaissance Revival: How the New Endpoint Works
Last year, Microsoft restricted the widely used `Get-FederationConfiguration` method, which required authentication. However, a new, unauthenticated endpoint has been discovered. The tool, hosted on GitHub Pages and backed by a Cloudflare Worker, acts as a simple proxy to this endpoint, queryinghttps://autodiscover-s.outlook.com/autodiscover/autodiscover.json?Email=test@<domain>.com. By analyzing the response for specific redirects and `www-authenticate` headers, it can definitively identify not only the primary tenant domain but also all verified secondary domains.
Step‑by‑step guide explaining what this does and how to use it.
Using the Public Tool: Simply navigate to the published site (implied from the LinkedIn link) and enter a known domain from the target organization. The tool returns a list of all associated tenant domains.
Manual Query with cURL: You can replicate this manually to understand the traffic. For a domain you own or have permission to test:
curl -v "https://autodiscover-s.outlook.com/autodiscover/[email protected]"
Observe the HTTP 401 response and the `WWW-Authenticate` header, which contains the `realm` parameter pointing to the tenant’s unique identifier (e.g., realm=<tenant-guid>.onmicrosoft.com). The tool systematizes this process across potential domain lists.
2. Building Your Own Enumeration Script with PowerShell
For internal security assessments, you can create a simple PowerShell script to automate discovery against a list of suspected domains.
Step‑by‑step guide explaining what this does and how to use it.
1. Prepare a text file (domains.txt) with one domain per line.
2. Create and run the following PowerShell script:
$domains = Get-Content .\domains.txt
$results = @()
foreach ($domain in $domains) {
$uri = "https://autodiscover-s.outlook.com/autodiscover/autodiscover.json?Email=test@$domain"
try {
$response = Invoke-WebRequest -Uri $uri -Method Get -UseBasicParsing -ErrorAction Stop
}
catch [System.Net.WebException] {
$resp = $_.Exception.Response
if ($resp.StatusCode -eq 'Unauthorized') {
$authHeader = $resp.Headers['WWW-Authenticate']
if ($authHeader -match 'realm="([^"]+)"') {
$tenantRealm = $matches[bash]
$obj = [bash]@{
TestedDomain = $domain
TenantRealm = $tenantRealm
IsM365 = $true
}
$results += $obj
Write-Host "[+] $domain is part of tenant: $tenantRealm" -ForegroundColor Green
}
}
}
}
$results | Export-Csv -Path .\m365_tenant_discovery.csv -NoTypeInformation
This script attempts a query for each domain; a 401 response with a specific `realm` header confirms the domain is part of an M365 tenant and reveals the canonical tenant name.
- Integrating with OSINT Workflows for Targeted Phishing Assessment
As highlighted in the discussion, this enumeration becomes powerful when correlated with public data. Attackers can build highly convincing phishing pretexts.
Step‑by‑step guide explaining what this does and how to use it.
1. Domain Enumeration: Use the tool or script to list all domains (company.com, brand.net, legacy-org.org) for a target.
2. DNS/MX Record Correlation: Use command-line dig to check mail servers:
for domain in $(cat discovered_domains.txt); do echo "=== $domain ==="; dig +short MX $domain; done
3. Analysis: Identify domains that do not use Microsoft 365 mail filters (e.g., MX records pointing to old on-premise Exchange or a third-party service). These are prime targets for credential phishing and spam, as they bypass Microsoft’s built-in security stacks.
4. Defensive Hardening: Monitoring for Enumeration Attempts
Since the queries hit Microsoft’s infrastructure first, logging them on your end is difficult. Defense shifts to proactive configuration and monitoring.
Step‑by‑step guide explaining what this does and how to use it.
Unify Mail Flow: The primary mitigation is to ensure ALL accepted domains in your tenant route mail through Exchange Online Protection (EOP). In the Microsoft 365 Admin Center, navigate to Settings > Domains and ensure each domain’s mail flow uses MX records pointing to Microsoft.
Audit Domains Regularly: Use PowerShell to list your accepted domains and verify their MX records:
Get-AcceptedDomain | Select-Object Name, DomainName
Regularly cross-reference this list with external DNS lookups to ensure compliance.
Enable Advanced Audit Logging: Ensure Unified Audit Log is activated. While it won’t log the enumeration itself, it’s critical for tracking subsequent malicious activity.
- Advanced Attack Simulation: From Enumeration to Initial Access
A red team can use this information to craft a credible attack chain.
Step‑by‑step guide explaining what this does and how to use it.
1. Discover Non-M365 Protected Domains: As per steps above.
2. Create Credential Harvesting Sites: Clone legitimate login pages for those specific brands/domains.
3. Send Targeted Phishing: Craft emails appearing to come from the less-secure subdomain (e.g., [email protected]) to employees, leveraging the authentic domain name to bypass reputation filters.
4. Use Valid Domains for Infrastructure: Register command-and-control (C2) servers with names that blend into the discovered domain list (e.g., assets-brand.net) to evade network blocklists.
What Undercode Say:
- Reconnaissance is Not Dead, It Has Evolved. Microsoft’s patches force researchers to find subtler methods. This tool proves that fundamental reconnaissance—mapping an organization’s digital estate—remains possible without triggering a single alert in the target’s environment.
- The Security Perimeter is Defined by Your Weakest Domain. An organization’s security posture is only as strong as the least hardened domain in its M365 tenant. Unifying mail flow and security policies across all accepted domains is no longer optional; it is critical to mitigating business email compromise and targeted phishing.
Analysis: This development is a classic example of the asymmetry in cybersecurity. Defenders must perfectly secure all assets, while attackers need only find one overlooked vulnerability—in this case, a domain not routed through M365’s security stack. The tool itself is not malicious; it merely queries a publicly accessible endpoint. Its value lies in shining a light on a persistent information disclosure issue. For security teams, it serves as an urgent audit trigger. For threat actors, it streamlines the reconnaissance phase of the cyber kill chain, making attacks more efficient and credible. The discussion around the tool is as valuable as the tool itself, highlighting the ongoing dialogue and shared discovery within the security community.
Prediction:
The widespread dissemination of this technique will lead to a short-term spike in sophisticated, domain-specific phishing campaigns as threat actors exploit identified gaps. In response, Microsoft will likely modify or restrict the implicated autodiscover endpoint within 6-12 months, potentially by requiring some form of proof (like a valid TLS certificate for the domain) before revealing tenant information. This will, in turn, catalyze the next round of research into alternative enumeration vectors, perpetuating the cycle. Ultimately, this will push organizations toward stricter domain consolidation and universal use of cloud mail filtering, shrinking the attack surface.
▶️ Related Video (80% Match):
🎯Let’s Practice For Free:
IT/Security Reporter URL:
Reported By: Danielbradley2 Microsoft – Hackers Feeds
Extra Hub: Undercode MoN
Basic Verification: Pass ✅


