Detect Remote Access Software Usage DNS

 Original Source: [splunk source]
Name:Detect Remote Access Software Usage DNS
id:a16b797d-e309-41bd-8ba0-5067dae2e4be
version:16
date:None
author:Steven Dick, Onur Mustafa Erdogan, Splunk
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.
Data_source:
  • -Sysmon EventID 22
search:| tstats `security_content_summariesonly`
count min(_time) as firstTime
max(_time) as lastTime

FROM datamodel=Network_Resolution WHERE

[

| inputlookup remote_access_software

| search domain!=""

| rename domain as DNS.query

| table DNS.query
]

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")`

| lookup local=t remote_access_software domain AS query OUTPUT app as signature, category, reference, description
| eval dest = query

| `security_content_ctime(firstTime)`
| `security_content_ctime(lastTime)`

| `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 "remote_access_software_usage_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$'
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

tags:

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'
manual_test:None