Detect DNS Data Exfiltration using pretrained model in DSDL
THIS IS A EXPERIMENTAL DETECTION
This detection has been marked experimental by the Splunk Threat Research team. This means we have not been able to test, simulate, or build datasets for this detection. Use at your own risk. This analytic is NOT supported.
Description
The following analytic uses a pre trained deep learning model to detect DNS data exfiltration. The model is trained on the data we collected and is inferred on live data. This detection detects low throughput DNS Tunneling (data exfiltration) using features computed from past events between the same src and domain. The search uses macros from URL ToolBox app to generate features used by the model. The model is a deep learning model that accepts DNS request as input along with a few custom features to generate a pred_is_exfiltration_proba score. The higher the pred_is_exfiltration_proba, the more likely the DNS request is data exfiltration. The threshold for flagging a request as DNS exfiltration is set at 0.5.
- Type: Anomaly
- Product: Splunk Enterprise, Splunk Enterprise Security, Splunk Cloud
- Datamodel: Network_Resolution
- Last Updated: 2023-04-27
- Author: Abhinav Mishra, Kumar Sharad and Namratha Sreekanta, Splunk
- ID: 92f65c3a-168c-11ed-71eb-0242ac120012
Annotations
ATT&CK
Kill Chain Phase
- Actions On Objectives
NIST
- DE.AE
CIS20
- CIS 13
CVE
Search
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
| tstats `security_content_summariesonly` count from datamodel=Network_Resolution by DNS.src _time DNS.query
| `drop_dm_object_name("DNS")`
| sort - _time,src, query
| streamstats count as rank by src query
| where rank < 10
| table src,query,rank,_time
| apply detect_dns_data_exfiltration_using_pretrained_model_in_dsdl
| table src,_time,query,rank,pred_is_dns_data_exfiltration_proba,pred_is_dns_data_exfiltration
| where rank == 1
| rename pred_is_dns_data_exfiltration_proba as is_exfiltration_score
| rename pred_is_dns_data_exfiltration as is_exfiltration
| where is_exfiltration_score > 0.5
| `security_content_ctime(_time)`
| table src, _time,query,is_exfiltration_score,is_exfiltration
| `detect_dns_data_exfiltration_using_pretrained_model_in_dsdl_filter`
Macros
The SPL above uses the following Macros:
detect_dns_data_exfiltration_using_pretrained_model_in_dsdl_filter is a empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.
Required fields
List of fields required to use this analytic.
- _time
- DNS.message_type
- DNS.record_type
- DNS.src
- DNS.dest
- DNS.answer
How To Implement
Steps to deploy detect DNS data exfiltration model into Splunk App DSDL. This detection depends on the Splunk app for Data Science and Deep Learning which can be found here - https://splunkbase.splunk.com/app/4607/ and the Network Resolution datamodel which can be found here - https://splunkbase.splunk.com/app/1621/. The detection uses a pre-trained deep learning model that needs to be deployed in DSDL app. Follow the steps for deployment here - https://github.com/splunk/security_content/wiki/How-to-deploy-pre-trained-Deep-Learning-models-for-ESCU
.\
- Download the
artifacts .tar.gz
file from the link - https://seal.splunkresearch.com/detect_dns_data_exfiltration_using_pretrained_model_in_dsdl.tar.gz Download thedetect_dns_data_exfiltration_using_pretrained_model_in_dsdl.ipynb
Jupyter notebook from https://github.com/splunk/security_content/notebooks\ - Login to the Jupyter Lab assigned for detect_dns_data_exfiltration_using_pretrained_model_in_dsdl container. This container should be listed on Containers page for DSDL app.\
- Below steps need to be followed inside Jupyter lab \
- Upload the detect_dns_data_exfiltration_using_pretrained_model_in_dsdl.tar.gz file into
app/model/data
path using the upload option in the jupyter notebook.\ - Untar the artifact detect_dns_data_exfiltration_using_pretrained_model_in_dsdl.tar.gz using
tar -xf app/model/data/detect_suspicious_dns_txt_records_using_pretrained_model_in_dsdl.tar.gz -C app/model/data
\ - Upload detect_dns_data_exfiltration_using_pretrained_model_in_dsdl.pynb into Jupyter lab notebooks folder using the upload option in Jupyter lab \
- Save the notebook using the save option in jupyter notebook. \
- Upload
detect_dns_data_exfiltration_using_pretrained_model_in_dsdl.json
intonotebooks/data
folder.Known False Positives
False positives may be present if DNS data exfiltration request look very similar to benign DNS requests.
Associated Analytic Story
RBA
Risk Score | Impact | Confidence | Message |
---|---|---|---|
45.0 | 50 | 90 | A DNS data exfiltration request was sent by this host $src$ , kindly review. |
The Risk Score is calculated by the following formula: Risk Score = (Impact * Confidence/100). Initial Confidence and Impact is set by the analytic author.
Reference
- https://attack.mitre.org/techniques/T1048/003/
- https://unit42.paloaltonetworks.com/dns-tunneling-how-dns-can-be-abused-by-malicious-actors/
- https://en.wikipedia.org/wiki/Data_exfiltration
Test Dataset
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 | version: 1