First Time Seen DNS Query to RMM Domain
Detects DNS queries to commonly abused remote monitoring and management (RMM) or remote access software domains from processes that are not browsers. Intended to surface RMM clients, scripts, or other non-browser activity contacting these services.
Elastic rule (View on GitHub)
1[metadata]
2creation_date = "2026/03/03"
3integration = ["endpoint", "windows"]
4maturity = "production"
5updated_date = "2026/05/04"
6
7[rule]
8author = ["Elastic"]
9description = """
10Detects DNS queries to commonly abused remote monitoring and management (RMM) or remote access software domains from processes that are not browsers.
11Intended to surface RMM clients, scripts, or other non-browser activity contacting these services.
12"""
13from = "now-7205m"
14interval = "5m"
15language = "esql"
16license = "Elastic License v2"
17name = "First Time Seen DNS Query to RMM Domain"
18note = """## Triage and analysis
19
20### Investigating First Time Seen DNS Query to RMM Domain
21
22This rule flags DNS queries to commonly abused RMM or remote access domains when the requesting process is not a browser. Legitimate RMM and remote desktop software is frequently abused for C2, persistence, and lateral movement.
23
24### Possible investigation steps
25
26- Identify the process process.executable that performed the DNS query and verify if it is an approved RMM or remote access tool.
27- Review the full process tree and parent process to understand how the binary was launched.
28- Check process.code_signature for trusted RMM publishers; unsigned or unexpected signers may indicate abuse or trojanized installers.
29- Correlate with the companion rule "First Time Seen Remote Monitoring and Management Tool" for the same host to see if the RMM process was first-time seen.
30- Investigate other alerts for the same host or user in the past 48 hours.
31
32### False positive analysis
33
34- Approved RMM or remote support tools used by IT will trigger this rule; consider allowlisting by process path or code signer for known managed tools.
35- Some updaters or installers (e.g. signed by the RMM vendor) may resolve these domains; combine with process name or parent context to reduce noise.
36
37### Response and remediation
38
39- If unauthorized RMM use is confirmed: isolate the host, remove the RMM software, rotate credentials, and block the domains at DNS/firewall where policy permits.
40- Enforce policy that only approved RMM tools from approved publishers may be used, and only by authorized staff.
41"""
42
43setup = """## Setup
44
45This rule is designed for data generated by [Elastic Defend](https://www.elastic.co/security/endpoint-security), which provides native endpoint detection and response, along with event enrichments designed to work with our detection rules.
46
47Setup instructions: https://ela.st/install-elastic-defend
48
49### Additional data sources
50
51This rule also supports the following third-party data sources. For setup instructions, refer to the links below:
52
53- [Sysmon Event ID 22 - DNS Query](https://ela.st/sysmon-event-22-setup)
54"""
55
56references = [
57 "https://attack.mitre.org/techniques/T1219/002/",
58 "https://www.cisa.gov/news-events/cybersecurity-advisories/aa23-025a",
59]
60risk_score = 47
61rule_id = "e5f6a7b8-c9d0-8e1f-2a3b-4c5d6e7f8a9b"
62severity = "medium"
63tags = [
64 "Domain: Endpoint",
65 "OS: Windows",
66 "Use Case: Threat Detection",
67 "Tactic: Command and Control",
68 "Resources: Investigation Guide",
69 "Data Source: Elastic Defend",
70 "Data Source: Sysmon"
71]
72timestamp_override = "event.ingested"
73type = "esql"
74
75query = '''
76FROM logs-endpoint.events.network-*, logs-windows.sysmon_operational-* METADATA _index
77| WHERE host.os.type == "windows"
78 AND event.category == "network"
79 AND event.action in ("lookup_requested", "DNSEvent (DNS query)")
80 AND dns.question.name IS NOT NULL
81
82// Exclude browser processes
83| WHERE NOT
84 process.name IN (
85 "chrome.exe", "msedge.exe", "MicrosoftEdge.exe", "MicrosoftEdgeCP.exe",
86 "firefox.exe", "iexplore.exe", "safari.exe", "brave.exe",
87 "opera.exe", "vivaldi.exe", "msedgewebview2.exe"
88 )
89
90// Extract the parent domain (last two labels, e.g. example.com)
91| GROK dns.question.name """(?:[^.]+\.)+(?<parent_domain>[^.]+\.[^.]+)$"""
92| EVAL parent_domain = COALESCE(parent_domain, dns.question.name)
93
94// Known RMM parent domains, add or remove entries here as your environment changes.
95| WHERE parent_domain IN (
96 "teamviewer.com",
97 "logmein.com",
98 "logmeinrescue.com",
99 "logmeininc.com",
100 "internapcdn.net",
101 "anydesk.com",
102 "screenconnect.com",
103 "connectwise.com",
104 "splashtop.com",
105 "zohoassist.com",
106 "dwservice.net",
107 "gotoassist.com",
108 "getgo.com",
109 "logmeinrescue.com",
110 "rustdesk.com",
111 "remoteutilities.com",
112 "atera.com",
113 "ammyy.com",
114 "n-able.com",
115 "kaseya.net",
116 "bomgar.com",
117 "beyondtrustcloud.com",
118 "parsec.app",
119 "parsecusercontent.com",
120 "tailscale.com",
121 "twingate.com",
122 "jumpcloud.com",
123 "vnc.com",
124 "remotepc.com",
125 "netsupportsoftware.com",
126 "getscreen.me",
127 "beanywhere.com",
128 "swi-rc.com",
129 "swi-tc.com",
130 "qetqo.com",
131 "tmate.io",
132 "playanext.com",
133 "supremocontrol.com",
134 "itarian.com",
135 "datto.com",
136 "auvik.com",
137 "syncromsp.com",
138 "pulseway.com",
139 "immy.bot",
140 "immybot.com",
141 "level.io",
142 "lunixar.com",
143 "ninjarmm.com",
144 "ninjaone.com",
145 "centrastage.net",
146 "datto.net",
147 "liongard.com",
148 "naverisk.com",
149 "panorama9.com",
150 "superops.ai",
151 "superops.com",
152 "tacticalrmm.com",
153 "meshcentral.com",
154 "remotly.com",
155 "fixme.it",
156 "islonline.com",
157 "zoho.eu",
158 "goverlan.com",
159 "iperius.net",
160 "iperiusremote.com",
161 "remotix.com",
162 "mikogo.com",
163 "r-hud.net",
164 "pcvisit.de",
165 "netviewer.com",
166 "helpwire.app",
167 "remotetopc.com",
168 "rport.io",
169 "action1.com",
170 "tiflux.com",
171 "gotoresolve.com"
172)
173
174// Aggregate by parent domain and get 1st time seen timestamp as well as unique count of agents
175| STATS
176 event_count = COUNT(*),
177 Esql.first_time_seen = MIN(@timestamp),
178 Esql.count_distinct_host_id = COUNT_DISTINCT(host.id),
179 Esql.process_executable_values = VALUES(process.executable),
180 Esql.dns_question_name_values = VALUES(dns.question.name),
181 Esql.host_name_values = VALUES(host.name) BY parent_domain
182
183// Calculate the time difference between first time seen and rule execution time
184| eval Esql.recent = DATE_DIFF("minute", Esql.first_time_seen, now())
185
186// First time seen is within 6m of the rule execution time and first seen in the last 5 days as per the rule from schedule and limited to 1 unique host
187| where Esql.recent <= 6 and Esql.count_distinct_host_id == 1
188
189// populate fields for rule exception
190| eval host.name = MV_FIRST(Esql.host_name_values),
191 process.executable = MV_FIRST(Esql.process_executable_values), dns.question.name = MV_FIRST(Esql.dns_question_name_values)
192| keep host.name, process.executable, dns.question.name, Esql.*
193'''
194
195
196[[rule.threat]]
197framework = "MITRE ATT&CK"
198[[rule.threat.technique]]
199id = "T1219"
200name = "Remote Access Tools"
201reference = "https://attack.mitre.org/techniques/T1219/"
202[[rule.threat.technique.subtechnique]]
203id = "T1219.002"
204name = "Remote Desktop Software"
205reference = "https://attack.mitre.org/techniques/T1219/002/"
206
207[rule.threat.tactic]
208id = "TA0011"
209name = "Command and Control"
210reference = "https://attack.mitre.org/tactics/TA0011/"
Triage and analysis
Investigating First Time Seen DNS Query to RMM Domain
This rule flags DNS queries to commonly abused RMM or remote access domains when the requesting process is not a browser. Legitimate RMM and remote desktop software is frequently abused for C2, persistence, and lateral movement.
Possible investigation steps
- Identify the process process.executable that performed the DNS query and verify if it is an approved RMM or remote access tool.
- Review the full process tree and parent process to understand how the binary was launched.
- Check process.code_signature for trusted RMM publishers; unsigned or unexpected signers may indicate abuse or trojanized installers.
- Correlate with the companion rule "First Time Seen Remote Monitoring and Management Tool" for the same host to see if the RMM process was first-time seen.
- Investigate other alerts for the same host or user in the past 48 hours.
False positive analysis
- Approved RMM or remote support tools used by IT will trigger this rule; consider allowlisting by process path or code signer for known managed tools.
- Some updaters or installers (e.g. signed by the RMM vendor) may resolve these domains; combine with process name or parent context to reduce noise.
Response and remediation
- If unauthorized RMM use is confirmed: isolate the host, remove the RMM software, rotate credentials, and block the domains at DNS/firewall where policy permits.
- Enforce policy that only approved RMM tools from approved publishers may be used, and only by authorized staff.
References
Related rules
- Attempt to Establish VScode Remote Tunnel
- Connection to Commonly Abused Free SSL Certificate Providers
- First Time Seen Remote Monitoring and Management Tool
- Multiple Remote Management Tool Vendors on Same Host
- Port Forwarding Rule Addition