Detection rules › Splunk

Detect Remote Access Software Usage DNS

Status
production
Severity
low
Group by
DNS.answer_count, DNS.query_count, DNS.vendor_product, dns.answers.name, dns.question.name, dns.response.code, src_ip
Author
Steven Dick
Source
github.com/splunk/security_content

The following analytic detects DNS queries to domains associated with known remote access software such as AnyDesk, GoToMyPC, LogMeIn, and TeamViewer. This detection is crucial as adversaries often use these tools to maintain access and control over compromised environments. Identifying such behavior is vital for a Security Operations Center (SOC) because unauthorized remote access can lead to data breaches, ransomware attacks, and other severe impacts if these threats are not mitigated promptly.

MITRE ATT&CK coverage

TacticTechniques
Command & ControlT1219 Remote Access Tools

Event coverage

ProviderEventTitle
SysmonEvent ID 22DNSEvent (DNS query)

Rule body splunk

name: Detect Remote Access Software Usage DNS
id: a16b797d-e309-41bd-8ba0-5067dae2e4be
version: 14
creation_date: '2024-03-06'
modification_date: '2026-05-13'
author: Steven Dick
status: production
type: Anomaly
description: The following analytic detects DNS queries to domains associated with known remote access software such as AnyDesk, GoToMyPC, LogMeIn, and TeamViewer. This detection is crucial as adversaries often use these tools to maintain access and control over compromised environments. Identifying such behavior is vital for a Security Operations Center (SOC) because unauthorized remote access can lead to data breaches, ransomware attacks, and other severe impacts if these threats are not mitigated promptly.
data_source:
    - Sysmon EventID 22
search: |
    | tstats `security_content_summariesonly`
      count min(_time) as firstTime
            max(_time) as lastTime
    from datamodel=Network_Resolution where
    DNS.query=*
    NOT DNS.query IN ("-", "unknown")
    by DNS.answer DNS.answer_count DNS.query
       DNS.query_count DNS.reply_code_id DNS.src
       DNS.vendor_product
    | `drop_dm_object_name("DNS")`
    | `security_content_ctime(firstTime)`
    | `security_content_ctime(lastTime)`
    | lookup remote_access_software remote_domain AS query OUTPUT isutility, description as signature,
    comment_reference as desc, category
    | eval dest = query
    | search isutility = True
    | `remote_access_software_usage_exceptions`
    | `detect_remote_access_software_usage_dns_filter`
how_to_implement: To implement this search, you must ingest logs that contain the DNS query and the source of the query. These logs must be processed using the appropriate Splunk Technology Add-ons that are specific to the DNS logs. The logs must also be mapped to the `Network_Resolution` data model. Use the Splunk Common Information Model (CIM) to normalize the field names and speed up the data modeling process. The "exceptions" macro leverages both an Assets and Identities lookup, as well as a KVStore collection called "remote_software_exceptions" that lets you track and maintain device-based exceptions for this set of detections.
known_false_positives: It is possible that legitimate remote access software is used within the environment. Ensure that the lookup is reviewed and updated with any additional remote access software that is used within the environment. Known false positives can be added to the remote_access_software_usage_exception.csv lookup to globally suppress these situations across all remote access content
references:
    - https://attack.mitre.org/techniques/T1219/
    - https://thedfirreport.com/2022/08/08/bumblebee-roasts-its-way-to-domain-admin/
    - https://thedfirreport.com/2022/11/28/emotet-strikes-again-lnk-file-leads-to-domain-wide-ransomware/
drilldown_searches:
    - name: View the detection results for - "$src$"
      search: '%original_detection_search% | search  src = "$src$"'
      earliest_offset: $info_min_time$
      latest_offset: $info_max_time$
    - name: View risk events for the last 7 days for - "$src$"
      search: '| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$src$") | stats count min(_time) as firstTime max(_time) as lastTime values(search_name) as "Search Name" values(risk_message) as "Risk Message" values(analyticstories) as "Analytic Stories" values(annotations._all) as "Annotations" values(annotations.mitre_attack.mitre_tactic) as "ATT&CK Tactics" by normalized_risk_object | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)`'
      earliest_offset: 7d
      latest_offset: "0"
    - name: Investigate traffic to $query$
      search: '| from datamodel:Network_Resolution.DNS | search src=$src$ query=$query$'
      earliest_offset: $info_min_time$
      latest_offset: $info_max_time$
intermediate_findings:
    entities:
        - field: src
          type: system
          score: 20
          message: A domain for a known remote access software $query$ was contacted by $src$.
threat_objects:
    - field: query
      type: domain
    - field: signature
      type: signature
analytic_story:
    - Insider Threat
    - Command And Control
    - Ransomware
    - CISA AA24-241A
    - Remote Monitoring and Management Software
    - Scattered Spider
    - Interlock Ransomware
    - Scattered Lapsus$ Hunters
asset_type: Endpoint
mitre_attack_id:
    - T1219
product:
    - Splunk Enterprise
    - Splunk Enterprise Security
    - Splunk Cloud
category: network
security_domain: endpoint
tests:
    - name: True Positive Test
      attack_data:
        - data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1219/screenconnect/screenconnect_sysmon.log
          source: XmlWinEventLog:Microsoft-Windows-Sysmon/Operational
          sourcetype: XmlWinEventLog
      description: PORTED MANUAL TEST - This detection uses A&I lookups from Enterprise Security.
      test_type: experimental

Stages and Predicates

Stage 1: tstats

| tstats `security_content_summariesonly`
  count min(_time) as firstTime
        max(_time) as lastTime
from datamodel=Network_Resolution where
DNS.query=*
NOT DNS.query IN ("-", "unknown")
by DNS.answer DNS.answer_count DNS.query
   DNS.query_count DNS.reply_code_id DNS.src
   DNS.vendor_product

Stage 2: search

| `drop_dm_object_name("DNS")`

Stage 3: search

| `security_content_ctime(firstTime)`

Stage 4: search

| `security_content_ctime(lastTime)`

Stage 5: lookup

| lookup remote_access_software remote_domain AS query OUTPUT isutility, description as signature,
comment_reference as desc, category
Lookup table
remote_access_software
Key field
remote_domain as query
Output columns
['isutility', 'isutility'], ['description', 'signature'], ['comment_reference', 'desc'], ['category', 'category']

Stage 6: eval

| eval dest = query

Stage 7: search

| search isutility = True

Stage 8: search

| `remote_access_software_usage_exceptions`

Stage 9: search

| `detect_remote_access_software_usage_dns_filter`

Exclusions

Top-level NOT(...) conjuncts: predicates this rule actively suppresses.

FieldKindExcluded values
DNS.queryin"-", "unknown"
rmm_exceptioneqTRUE
rmm_exception_endin"FALSE", "UNLIMITED"

Indicators

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
DNS.queryeq
  • "*" corpus 3 (splunk 3)
isutilityeq
  • True corpus 4 (splunk 4)