Rule Documentation: DNS Zone Export Commands Execution (PowerShell Command Audit)
DNS Zone Export
Query
DeviceEvents
| where ActionType == "PowerShellCommand"
| where AdditionalFields has_any ("Export-DnsServerZone", "Get-DnsServerZone")
| where InitiatingProcessCommandLine != @"""MonitoringHost.exe"" -Embedding"About this query
Explanation
This query is designed to detect potentially malicious activity involving the use of PowerShell commands to export or enumerate DNS zones, which could indicate an adversary's attempt to map out internal networks for further attacks. Here's a simplified breakdown:
-
Purpose: The query identifies when specific PowerShell commands (
Export-DnsServerZoneandGet-DnsServerZone) are executed. These commands can be used by attackers to gather information about internal network hosts and services. -
Exclusions: It filters out routine, benign uses of these commands, such as those initiated by known monitoring software (
MonitoringHost.exe -Embedding), to reduce false alarms. -
Focus: The query is particularly concerned with:
- Non-administrative users running these commands.
- Execution from systems that are not typically DNS servers.
- Activity occurring outside normal business hours or scheduled maintenance times.
-
Correlations: It suggests further investigation if:
- There are unusual DNS queries or a high volume of DNS lookups from the same machine.
- DNS data is exported to unexpected file locations.
- There is evidence of lateral movement or attempts to escalate privileges shortly after the DNS commands are run.
-
Relevance: This detection is part of a broader effort to identify reconnaissance activities, which are often precursors to more serious attacks. It aligns with specific tactics in the MITRE ATT&CK framework, such as discovering network configurations and services.
Overall, this query helps security teams spot and investigate suspicious DNS-related activities that could indicate an adversary's reconnaissance efforts.
Details

Ali Hussein
Released: November 10, 2025
Tables
Keywords
Operators