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/03/23"
  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"""
 42references = [
 43    "https://attack.mitre.org/techniques/T1219/002/",
 44    "https://www.cisa.gov/news-events/cybersecurity-advisories/aa23-025a",
 45]
 46risk_score = 47
 47rule_id = "e5f6a7b8-c9d0-8e1f-2a3b-4c5d6e7f8a9b"
 48severity = "medium"
 49tags = [
 50    "Domain: Endpoint",
 51    "OS: Windows",
 52    "Use Case: Threat Detection",
 53    "Tactic: Command and Control",
 54    "Resources: Investigation Guide",
 55    "Data Source: Elastic Defend",
 56    "Data Source: Sysmon"
 57]
 58timestamp_override = "event.ingested"
 59type = "esql"
 60
 61query = '''
 62FROM logs-endpoint.events.network-*, logs-windows.sysmon_operational-* METADATA _index
 63| WHERE host.os.type == "windows"
 64    AND event.category == "network"
 65    AND event.action in ("lookup_requested", "DNSEvent (DNS query)")
 66    AND dns.question.name IS NOT NULL
 67
 68// Exclude browser processes
 69| WHERE NOT
 70    process.name IN (
 71        "chrome.exe", "msedge.exe", "MicrosoftEdge.exe", "MicrosoftEdgeCP.exe",
 72        "firefox.exe", "iexplore.exe", "safari.exe", "brave.exe",
 73        "opera.exe", "vivaldi.exe", "msedgewebview2.exe"
 74    )
 75
 76// Extract the parent domain (last two labels, e.g. example.com)
 77| GROK dns.question.name """(?:[^.]+\.)+(?<parent_domain>[^.]+\.[^.]+)$"""
 78| EVAL parent_domain = COALESCE(parent_domain, dns.question.name)
 79
 80// Known RMM parent domains, add or remove entries here as your environment changes.
 81| WHERE parent_domain IN (
 82    "teamviewer.com",
 83    "logmein.com",
 84    "logmeinrescue.com",
 85    "logmeininc.com",
 86    "internapcdn.net",
 87    "anydesk.com",
 88    "screenconnect.com",
 89    "connectwise.com",
 90    "splashtop.com",
 91    "zohoassist.com",
 92    "dwservice.net",
 93    "gotoassist.com",
 94    "getgo.com",
 95    "logmeinrescue.com",
 96    "rustdesk.com",
 97    "remoteutilities.com",
 98    "atera.com",
 99    "ammyy.com",
100    "n-able.com",
101    "kaseya.net",
102    "bomgar.com",
103    "beyondtrustcloud.com",
104    "parsec.app",
105    "parsecusercontent.com",
106    "tailscale.com",
107    "twingate.com",
108    "jumpcloud.com",
109    "vnc.com",
110    "remotepc.com",
111    "netsupportsoftware.com",
112    "getscreen.me",
113    "beanywhere.com",
114    "swi-rc.com",
115    "swi-tc.com",
116    "qetqo.com",
117    "tmate.io",
118    "playanext.com",
119    "supremocontrol.com",
120    "itarian.com",
121    "datto.com",
122    "auvik.com",
123    "syncromsp.com",
124    "pulseway.com",
125    "immy.bot",
126    "immybot.com",
127    "level.io",
128    "ninjarmm.com",
129    "ninjaone.com",
130    "centrastage.net",
131    "datto.net",
132    "liongard.com",
133    "naverisk.com",
134    "panorama9.com",
135    "superops.ai",
136    "superops.com",
137    "tacticalrmm.com",
138    "meshcentral.com",
139    "remotly.com",
140    "fixme.it",
141    "islonline.com",
142    "zoho.eu",
143    "goverlan.com",
144    "iperius.net",
145    "iperiusremote.com",
146    "remotix.com",
147    "mikogo.com",
148    "r-hud.net",
149    "pcvisit.de",
150    "netviewer.com",
151    "helpwire.app",
152    "remotetopc.com",
153    "rport.io",
154    "action1.com",
155    "tiflux.com",
156    "gotoresolve.com"
157)
158
159// Aggregate by parent domain and get 1st time seen timestamp as well as unique count of agents
160| STATS
161    event_count = COUNT(*),
162    Esql.first_time_seen = MIN(@timestamp),
163    Esql.count_distinct_host_id = COUNT_DISTINCT(host.id),
164    Esql.process_executable_values = VALUES(process.executable),
165    Esql.dns_question_name_values = VALUES(dns.question.name),
166    Esql.host_name_values = VALUES(host.name) BY parent_domain
167
168// Calculate the time difference between first time seen and rule execution time
169| eval Esql.recent = DATE_DIFF("minute", Esql.first_time_seen, now())
170
171// 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
172| where Esql.recent <= 6 and Esql.count_distinct_host_id == 1
173
174// populate fields for rule exception
175| eval host.name = MV_FIRST(Esql.host_name_values),
176       process.executable = MV_FIRST(Esql.process_executable_values), dns.question.name = MV_FIRST(Esql.dns_question_name_values)
177| keep host.name, process.executable, dns.question.name, Esql.*
178'''
179
180
181[[rule.threat]]
182framework = "MITRE ATT&CK"
183[[rule.threat.technique]]
184id = "T1219"
185name = "Remote Access Tools"
186reference = "https://attack.mitre.org/techniques/T1219/"
187[[rule.threat.technique.subtechnique]]
188id = "T1219.002"
189name = "Remote Desktop Software"
190reference = "https://attack.mitre.org/techniques/T1219/002/"
191
192[rule.threat.tactic]
193id = "TA0011"
194name = "Command and Control"
195reference = "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

to-top