Detection: Excessive DNS Failures

EXPERIMENTAL DETECTION

This detection status is set to experimental. The Splunk Threat Research team has not yet fully tested, simulated, or built comprehensive datasets for this detection. As such, this analytic is not officially supported. If you have any questions or concerns, please reach out to us at research@splunk.com.

Description

The following analytic identifies excessive DNS query failures by counting DNS responses that do not indicate success, triggering when there are more than 50 occurrences. It leverages the Network_Resolution data model, focusing on DNS reply codes that signify errors. This activity is significant because a high number of DNS failures can indicate potential network misconfigurations, DNS poisoning attempts, or malware communication issues. If confirmed malicious, this activity could lead to disrupted network services, hindered communication, or data exfiltration attempts by attackers.

 1
 2| tstats `security_content_summariesonly` count from datamodel=Network_Resolution where nodename=DNS "DNS.reply_code"!="No Error" "DNS.reply_code"!="NoError" DNS.reply_code!="unknown" NOT "DNS.query"="*.arpa" "DNS.query"="*.*" by "DNS.src" "DNS.query" "DNS.reply_code" 
 3| `drop_dm_object_name("DNS")` 
 4| lookup cim_corporate_web_domain_lookup domain as query OUTPUT domain 
 5| where isnull(domain) 
 6| lookup update=true alexa_lookup_by_str domain as query OUTPUT rank 
 7| where isnull(rank) 
 8| eventstats max(count) as mc by src reply_code 
 9| eval mode_query=if(count=mc, query, null()) 
10| stats sum(count) as count values(mode_query) as query values(mc) as max_query_count by src reply_code 
11| where count>50 
12| `get_asset(src)` 
13| `excessive_dns_failures_filter`

Data Source

Name Platform Sourcetype Source Supported App
N/A N/A N/A N/A N/A

Macros Used

Name Value
security_content_summariesonly summariesonly=summariesonly_config allow_old_summaries=oldsummaries_config fillnull_value=fillnull_config``
excessive_dns_failures_filter search *
excessive_dns_failures_filter is an empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.

Annotations

- MITRE ATT&CK
+ Kill Chain Phases
+ NIST
+ CIS
- Threat Actors
ID Technique Tactic
T1071.004 DNS Command And Control
T1071 Application Layer Protocol Command And Control
KillChainPhase.COMMAND_AND_CONTROL
NistCategory.DE_AE
Cis18Value.CIS_13
APT18
APT39
APT41
Chimera
Cobalt Group
FIN7
Ke3chang
LazyScripter
OilRig
Tropic Trooper
Magic Hound
Rocke
TeamTNT

Default Configuration

This detection is configured by default in Splunk Enterprise Security to run with the following settings:

Setting Value
Disabled true
Cron Schedule 0 * * * *
Earliest Time -70m@m
Latest Time -10m@m
Schedule Window auto
Creates Risk Event True
This configuration file applies to all detections of type anomaly. These detections will use Risk Based Alerting.

Implementation

To successfully implement this search you must ensure that DNS data is populating the Network_Resolution data model.

Known False Positives

It is possible legitimate traffic can trigger this rule. Please investigate as appropriate. The threshold for generating an event can also be customized to better suit your environment.

Associated Analytic Story

Risk Based Analytics (RBA)

Risk Message Risk Score Impact Confidence
Excessive DNS failures detected on $src$ 25 50 50
The Risk Score is calculated by the following formula: Risk Score = (Impact * Confidence/100). Initial Confidence and Impact is set by the analytic author.

Detection Testing

Test Type Status Dataset Source Sourcetype
Validation Not Applicable N/A N/A N/A
Unit ❌ Failing N/A N/A N/A
Integration ❌ Failing N/A N/A N/A

Replay any dataset to Splunk Enterprise by using our replay.py tool or the UI. Alternatively you can replay a dataset into a Splunk Attack Range


Source: GitHub | Version: 4