Detect Domain Properties in Splunk
Adversaries may gather information about the victim's network domain(s) that can be used during targeting. Information about domains and their properties may include a variety of details, including what domain(s) the victim owns as well as administrative data (name, registrar, etc.) and more directly actionable information such as contacts, business addresses, and name servers. Adversaries gather this information via direct collection (WHOIS queries, DNS enumeration), passive data sets, or by querying publicly accessible API endpoints such as Microsoft's GetUserRealm and autodiscover APIs in Office 365/Azure environments. Tools such as AADInternals leverage these public APIs to enumerate tenant domain details, federation configuration, and company metadata — all without authenticating to the target environment.
MITRE ATT&CK
- Tactic
- Reconnaissance
- Technique
- T1590 Gather Victim Network Information
- Sub-technique
- T1590.001 Domain Properties
- Canonical reference
- https://attack.mitre.org/techniques/T1590/001/
SPL Detection Query
(`index=wineventlog` (sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=1) OR (sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=3))
| eval CommandLine=coalesce(CommandLine, "")
| eval DestinationPort=coalesce(DestinationPort, 0)
| eval IsAADRecon=if(match(CommandLine, "(?i)(get-aadinttenantdomains|get-aadintlogininfo|get-aadinttenantdetails|invoke-aadintreconasoutsider|get-aadintcompanyinfo|aadinternals|get-aadinttenantid)"), 1, 0)
| eval IsO365Recon=if(match(CommandLine, "(?i)(getuserrealm|autodiscover.*microsoft|login\.microsoftonline\.com.*userrealm)"), 1, 0)
| eval IsWhoisTool=if(match(CommandLine, "(?i)(whois\.exe|get-whois|invoke-whois|whois\s+[a-z0-9])"), 1, 0)
| eval IsWhoisPort=if(EventCode=3 AND DestinationPort=43, 1, 0)
| eval IsWhoisSvc=if(EventCode=3 AND match(DestinationHostname, "(?i)(whois\.iana\.org|who\.is|whois\.domaintools\.com|whois\.verisign|rdap\.org|rdap\.arin\.net)"), 1, 0)
| eval SuspicionScore=IsAADRecon + IsO365Recon + IsWhoisTool + IsWhoisPort + IsWhoisSvc
| where SuspicionScore > 0
| eval DetectionType=case(
IsAADRecon=1, "AADInternals_DomainRecon",
IsO365Recon=1, "O365_API_DomainRecon",
IsWhoisTool=1, "WHOIS_Tool_Execution",
IsWhoisPort=1, "WHOIS_Protocol_Port43",
IsWhoisSvc=1, "WHOIS_WebService_Access",
true(), "Domain_Recon_Other"
)
| eval ImageOrProcess=coalesce(Image, "N/A")
| eval DestHost=coalesce(DestinationHostname, DestinationIp, "N/A")
| table _time, host, User, ImageOrProcess, CommandLine, DestHost, DestinationPort, DetectionType, SuspicionScore
| sort - _time Detects domain property reconnaissance using Sysmon Event ID 1 (Process Creation) and Event ID 3 (Network Connection) logs. Evaluates process command lines for AADInternals module commands, O365 GetUserRealm API calls, and WHOIS tool patterns. Network events are evaluated for TCP port 43 (WHOIS protocol) connections and connections to known WHOIS service hostnames. A suspicion score aggregates multiple indicators for analyst prioritization.
Data Sources
Required Sourcetypes
False Positives & Tuning
- IT administrators performing legitimate WHOIS lookups to verify domain registrations, check expiry dates, or investigate abuse complaints
- Security teams using AADInternals or similar tools for authorized red team exercises, tenant health checks, or identity posture assessments
- DevOps/cloud automation scripts querying Azure AD domain configuration during infrastructure provisioning or validation pipelines
- Network monitoring or ITSM tools that perform routine WHOIS queries as part of domain portfolio management workflows
- Developers testing Azure AD or O365 integrations that call GetUserRealm or autodiscover endpoints
Other platforms for T1590.001
Testing Methodology
Validate this detection against 5 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.
- Test 1AADInternals Tenant Domain Reconnaissance
Expected signal: Sysmon Event ID 1: Process Create for powershell.exe with CommandLine containing 'Get-AADIntLoginInformation' and 'AADInternals'. PowerShell ScriptBlock Log Event ID 4104 with the full module import and command. Sysmon Event ID 3: Network connection from powershell.exe to login.microsoftonline.com (port 443). Azure AD Audit Logs may show GetUserRealm API access from the source IP.
- Test 2WHOIS Protocol Query via PowerShell
Expected signal: Sysmon Event ID 1: Process Create for powershell.exe with CommandLine containing 'TcpClient' and 'whois.iana.org' and port 43. Sysmon Event ID 3: Network Connection from powershell.exe to whois.iana.org on DestinationPort 43. Security Event ID 4688 (if command line auditing enabled).
- Test 3Azure AD Domain List Enumeration via Graph API
Expected signal: Sysmon Event ID 1: Process Create for az.cmd or python.exe (Azure CLI) with CommandLine containing 'graph.microsoft.com' and 'domains'. Sysmon Event ID 3: Network connection from the Azure CLI process to graph.microsoft.com on port 443. Azure AD Audit Logs: OperationName='List domains' with the initiating user, IP address, and application 'Microsoft Azure CLI'.
- Test 4AADInternals External Tenant Reconnaissance (Outsider Mode)
Expected signal: Sysmon Event ID 1: Process Create for powershell.exe with CommandLine containing 'Invoke-AADIntReconAsOutsider' and 'AADInternals'. PowerShell ScriptBlock Log Event ID 4104 with the full function invocation. Multiple Sysmon Event ID 3 records: outbound HTTPS connections to login.microsoftonline.com, autodiscover.microsoft.com, and related Microsoft identity endpoints. Azure AD Audit Logs may record the GetUserRealm API calls with source IP.
- Test 5Bulk DNS Record Enumeration for Domain Mapping
Expected signal: Sysmon Event ID 1: Process Create for powershell.exe with CommandLine containing 'Resolve-DnsName' and multiple DNS record types. Sysmon Event ID 22 (DNS Query): multiple DNS queries for the target domain with QueryType values MX, NS, TXT, SOA. Windows DNS Client Event Log (Microsoft-Windows-DNS-Client/Operational): corresponding DNS resolution events.
References (11)
- https://attack.mitre.org/techniques/T1590/001/
- https://o365blog.com/post/just-looking/
- https://github.com/Gerenios/AADInternals
- https://who.is/
- https://dnsdumpster.com/
- https://www.circl.lu/services/passive-dns/
- https://docs.microsoft.com/en-us/archive/blogs/tip_of_the_day/cloud-tip-of-the-day-advanced-way-to-check-domain-availability-for-office-365-and-azure
- https://learn.microsoft.com/en-us/azure/active-directory/reports-monitoring/concept-audit-logs
- https://learn.microsoft.com/en-us/defender-endpoint/advanced-hunting-devicenetworkevents-table
- https://unit42.paloaltonetworks.com/threat-assessment-sandworm-team/
- https://www.microsoft.com/en-us/security/blog/2021/03/02/new-nation-state-cyberattacks/
Unlock Pro Content
Get the full detection package for T1590.001 including response playbook, investigation guide, and atomic red team tests.