﻿---
title: First Time Seen DNS Query to RMM Domain
description: Detects DNS queries to commonly abused remote monitoring and management (RMM) or remote access software domains from processes that are not browsers...
url: https://www.elastic.co/docs/reference/security/prebuilt-rules/rules/windows/command_and_control_dns_rmm_domains_non_browser
products:
  - Elastic Security
---

# 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.
**Rule type**: esql
**Rule indices**:
**Rule Severity**: medium
**Risk Score**: 47
**Runs every**: 5m
**Searches indices from**: `now-7205m`
**Maximum alerts per execution**: 100
**References**:
- [[https://attack.mitre.org/techniques/T1219/002/](https://attack.mitre.org/techniques/T1219/002/)](https://attack.mitre.org/techniques/T1219/002/)
- [[https://www.cisa.gov/news-events/cybersecurity-advisories/aa23-025a](https://www.cisa.gov/news-events/cybersecurity-advisories/aa23-025a)](https://www.cisa.gov/news-events/cybersecurity-advisories/aa23-025a)
- [[https://lolrmm.io/](https://lolrmm.io/)](https://lolrmm.io/)

**Tags**:
- Domain: Endpoint
- OS: Windows
- Use Case: Threat Detection
- Tactic: Command and Control
- Resources: Investigation Guide
- Data Source: Elastic Defend
- Data Source: Sysmon
- Noise: Medium
- Performance: Slow
- Threat: Remote Management Tool Abuse
- Rule Type: ES|QL
- Platform: Windows

**Version**: 6
**Rule authors**:
- Elastic

**Rule license**: Elastic License v2

## Setup

This 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.
Setup instructions: [https://ela.st/install-elastic-defend](https://ela.st/install-elastic-defend)

### Additional data sources

This rule also supports the following third-party data sources. For setup instructions, refer to the links below:
- [Sysmon Event ID 22 - DNS Query](https://ela.st/sysmon-event-22-setup)


## Investigation guide


## 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.


## Rule Query

```esql
FROM logs-endpoint.events.network-*, logs-windows.sysmon_operational-* METADATA _index
| WHERE host.os.type == "windows"
    AND event.category == "network"
    AND event.action in ("lookup_requested", "DNSEvent (DNS query)")
    AND dns.question.name IS NOT NULL

// Exclude browser processes
| WHERE NOT
    process.name IN (
        "chrome.exe", "msedge.exe", "MicrosoftEdge.exe", "MicrosoftEdgeCP.exe",
        "firefox.exe", "iexplore.exe", "safari.exe", "brave.exe",
        "opera.exe", "vivaldi.exe", "msedgewebview2.exe"
    )

// Extract the parent domain (last two labels, e.g. example.com)
| GROK dns.question.name """(?:[^.]+\.)+(?<parent_domain>[^.]+\.[^.]+)$"""
| EVAL parent_domain = COALESCE(parent_domain, dns.question.name)

// Known RMM parent domains, add or remove entries here as your environment changes.
| WHERE parent_domain IN (
    "01com.com",
    "247ithelp.com",
    "action1.com",
    "addigy.com",
    "aeroadmin.com",
    "ammyy.com",
    "anydesk.com",
    "anyplace-control.com",
    "anysupport.net",
    "atera.com",
    "aurelius.host",
    "auvik.com",
    "aweray.com",
    "aweray.net",
    "backdrop.cloud",
    "barracudamsp.com",
    "beamyourscreen.com",
    "beanywhere.com",
    "beinsync.com",
    "beinsync.net",
    "beyondtrustcloud.com",
    "bomgar.com",
    "bomgarcloud.com",
    "centrastage.net",
    "centuriontech.com",
    "connectwise.com",
    "crossloop.com",
    "dameware.com",
    "datto.com",
    "datto.net",
    "deskday.ai",
    "deskroll.com",
    "desktopstreaming.com",
    "distantdesktop.com",
    "donkz.nl",
    "dwservice.net",
    "ehorus.com",
    "electric.ai",
    "emcosoftware.com",
    "ericom.com",
    "fastsupport.com",
    "fastviewer.com",
    "fixme.it",
    "fleetdeck.io",
    "gatherplace.com",
    "gatherplace.net",
    "getgo.com",
    "getscreen.me",
    "gotoassist.at",
    "gotoassist.com",
    "gotoassist.me",
    "gotohttp.com",
    "gotoresolve.com",
    "goverlan.com",
    "heartbeatrm.com",
    "helpme.net",
    "helpwire.app",
    "hoptodesk.com",
    "hostedrmm.com",
    "immy.bot",
    "immybot.com",
    "imperosoftware.com",
    "instanthousecall.com",
    "instanthousecall.net",
    "intelliadmin.com",
    "internapcdn.net",
    "internetid.ru",
    "iperius-rs.com",
    "iperius.net",
    "iperiusremote.com",
    "islonline.com",
    "islonline.net",
    "itarian.com",
    "itsupport247.net",
    "jumpcloud.com",
    "jumpdesktop.com",
    "jumpto.me",
    "kabuto.io",
    "kabutoservices.com",
    "kaseya.com",
    "kaseya.net",
    "kickidler.com",
    "laplink.com",
    "level.io",
    "liongard.com",
    "litemanager.com",
    "litemanager.ru",
    "logicnow.com",
    "logmein-gateway.com",
    "logmein.com",
    "logmeininc.com",
    "logmeinrescue.com",
    "logmeinrescue.eu",
    "lunixar.com",
    "meshcentral.com",
    "mikogo.com",
    "mikogo4.com",
    "miradore.com",
    "msp360.com",
    "mygreenpc.com",
    "n-able.com",
    "naverisk.com",
    "nchuser.com",
    "netop.com",
    "netsupportmanager.com",
    "netsupportsoftware.com",
    "netviewer.com",
    "ninjaone.com",
    "ninjarmm.com",
    "ninjarmm.net",
    "nomachine.com",
    "ntrsupport.com",
    "opti-tune.com",
    "optitune.us",
    "oray.com",
    "oray.net",
    "panorama9.com",
    "parsec.app",
    "parsecusercontent.com",
    "pcvisit.de",
    "pilixo.com",
    "playanext.com",
    "pulseway.com",
    "qetqo.com",
    "r-hud.net",
    "real-time-collaboration.com",
    "remmon.hu",
    "remote.it",
    "remote.management",
    "remotecall.com",
    "remotedesktop.com",
    "remotepc.com",
    "remotetopc.com",
    "remoteutilities.com",
    "remotix.com",
    "remotly.com",
    "repairshopr.com",
    "rmansys.ru",
    "rmmservice.ca",
    "rmmservice.eu",
    "royalapps.com",
    "rport.io",
    "rudesktop.ru",
    "rustdesk.com",
    "rview.com",
    "screenconnect.com",
    "screenmeet.com",
    "scrn.mt",
    "servably.com",
    "server-eye.de",
    "set.me",
    "setme.net",
    "showmypc.com",
    "signalserver.xyz",
    "simple-help.com",
    "skyfex.com",
    "sorillus.com",
    "splashtop.com",
    "splashtop.eu",
    "spyanywhere.com",
    "spytech-web.com",
    "startsupport.com",
    "superops.ai",
    "superops.com",
    "superopsalpha.com",
    "superopsbeta.com",
    "supremocontrol.com",
    "swi-rc.com",
    "swi-tc.com",
    "syncroapi.com",
    "syncromsp.com",
    "syspectr.com",
    "system-monitor.com",
    "systemmonitor.us",
    "tacticalrmm.com",
    "tailscale.com",
    "teamviewer.com",
    "techinline.net",
    "tele-desk.com",
    "tiflux.com",
    "tightvnc.com",
    "tmate.io",
    "todesk.com",
    "twingate.com",
    "ultraviewer.net",
    "ultravnc.com",
    "vnc.com",
    "weezo.me",
    "weezo.net",
    "xeox.com",
    "zoho.eu",
    "zohoassist.com",
    "zohoassist.jp"
)

// Aggregate by parent domain and get 1st time seen timestamp as well as unique count of agents
| STATS
    event_count = COUNT(*),
    Esql.first_time_seen = MIN(@timestamp),
    Esql.count_distinct_host_id = COUNT_DISTINCT(host.id),
    Esql.process_executable_values = VALUES(process.executable),
    Esql.dns_question_name_values = VALUES(dns.question.name),
    Esql.host_name_values = VALUES(host.name),
    Esql.host_id_values = VALUES(host.id),
    Esql.user_name_values = VALUES(user.name),
    Esql.user_id_values = VALUES(user.id),
    Esql.namespace_values = VALUES(data_stream.namespace) BY parent_domain

// Calculate the time difference between first time seen and rule execution time
| eval Esql.recent = DATE_DIFF("minute", Esql.first_time_seen, now())

// 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
| where Esql.recent <= 6 and Esql.count_distinct_host_id == 1

// populate fields for rule exception and triage
| eval host.name = MV_FIRST(Esql.host_name_values),
       host.id = MV_FIRST(Esql.host_id_values),
       user.name = MV_FIRST(Esql.user_name_values),
       user.id = MV_FIRST(Esql.user_id_values),
       data_stream.namespace = MV_FIRST(Esql.namespace_values),
       process.executable = MV_FIRST(Esql.process_executable_values),
       dns.question.name = MV_FIRST(Esql.dns_question_name_values)
| keep host.name, host.id, user.name, user.id, data_stream.namespace, process.executable, dns.question.name, Esql.*
```

**Framework:** MITRE ATT&CK
- Tactic:
  - Name: Command and Control
  - Id: TA0011
  - Reference URL: [[https://attack.mitre.org/tactics/TA0011/](https://attack.mitre.org/tactics/TA0011/)](https://attack.mitre.org/tactics/TA0011/)
- Technique:
  - Name: Remote Access Tools
  - Id: T1219
  - Reference URL: [[https://attack.mitre.org/techniques/T1219/](https://attack.mitre.org/techniques/T1219/)](https://attack.mitre.org/techniques/T1219/)
- Sub Technique:
  - Name: Remote Desktop Software
  - Id: T1219.002
  - Reference URL: [[https://attack.mitre.org/techniques/T1219/002/](https://attack.mitre.org/techniques/T1219/002/)](https://attack.mitre.org/techniques/T1219/002/)