From 1506554a5841960ce72e275f2d94a4159a8278cd Mon Sep 17 00:00:00 2001 From: Steven Dick <38897662+nterl0k@users.noreply.github.com> Date: Sat, 28 Dec 2024 12:12:39 -0500 Subject: [PATCH 1/6] Add files via upload --- ..._remote_access_software_usage_registry.yml | 78 +++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 detections/endpoint/detect_remote_access_software_usage_registry.yml diff --git a/detections/endpoint/detect_remote_access_software_usage_registry.yml b/detections/endpoint/detect_remote_access_software_usage_registry.yml new file mode 100644 index 0000000000..63567699d8 --- /dev/null +++ b/detections/endpoint/detect_remote_access_software_usage_registry.yml @@ -0,0 +1,78 @@ +name: Detect Remote Access Software Usage Registry +id: 33804986-25dd-43cf-bb6b-dc14956c7cbc +version: 1 +date: '2024-11-21' +author: Steven Dick +status: production +type: Anomaly +description: The following analytic detects when a known remote access software is added to common persistence locations on a device within the environment. Adversaries use these utilities to retain remote access capabilities to the environment. Utilities in the lookup include AnyDesk, GoToMyPC, LogMeIn, TeamViewer and much more. Review the lookup for the entire list and add any others. +data_source: +- Sysmon EventID 12 +- Sysmon EventID 13 +search: '| tstats `security_content_summariesonly` latest(Registry.process_guid) as process_guid count min(_time) as firstTime max(_time) as lastTime FROM datamodel=Endpoint.Registry where (Registry.registry_path="*\\Microsoft\\Windows\\CurrentVersion\\Run*" OR (Registry.registry_path="*\\SYSTEM\\CurrentControlSet\\Services\\*" AND Registry.registry_value_name="ImagePath")) by Registry.dest Registry.user Registry.registry_path Registry.registry_value_name Registry.registry_value_data Registry.registry_key_name +| `drop_dm_object_name(Registry)` +| `security_content_ctime(firstTime)` +| `security_content_ctime(lastTime)` +| rex field=registry_value_data "(\")?.+\\\(?[^\"=]+\.[^\" ]{1,5})(\")?" +| rex field=registry_value_data "(?[^\.]+\.[^\" ]{1,5}$)" +| eval file_name = coalesce(file_name_1,file_name_2) +| lookup remote_access_software remote_utility AS file_name OUTPUT isutility, description as signature, comment_reference as desc, category +| search isutility = TRUE +| `remote_access_software_usage_exception_filter` +| `detect_remote_access_software_usage_registry_filter`' +how_to_implement: The detection is based on data that originates from Endpoint Detection and Response (EDR) agents. These agents are designed to provide security-related telemetry from the endpoints where the agent is installed. To implement this search, you must ingest logs that contain the file path, file name, and the user that created the file. These logs must be processed using the appropriate Splunk Technology Add-ons that are specific to the EDR product. The logs must also be mapped to the `Filesystem` node of the `Endpoint` 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: Known or approved applications used by the organization or usage of built-in functions. 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/ +tags: + analytic_story: + - Insider Threat + - Command And Control + - Ransomware + - Gozi Malware + - CISA AA24-241A + asset_type: Endpoint + confidence: 50 + impact: 50 + message: A process for a known remote access software [$signature$] was detected on $dest$ + mitre_attack_id: + - T1219 + observable: + - name: dest + type: system + role: + - Victim + - name: user + type: user + role: + - Victim + - name: registry_path + type: registry_path + role: + - Attacker + - name: signature + type: signature + role: + - Attacker + product: + - Splunk Enterprise + - Splunk Enterprise Security + - Splunk Cloud + required_fields: + - _time + - Registry.dest + - Registry.user + - Registry.registry_path + - Registry.registry_value_name + - Registry.registry_value_data + - Registry.registry_key_name + risk_score: 25 + 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 \ No newline at end of file From ff408f240c777a21c20469a295f6c7e93d7382ea Mon Sep 17 00:00:00 2001 From: Steven Dick <38897662+nterl0k@users.noreply.github.com> Date: Mon, 6 Jan 2025 17:19:33 -0500 Subject: [PATCH 2/6] Update detect_remote_access_software_usage_registry.yml --- .../detect_remote_access_software_usage_registry.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/detections/endpoint/detect_remote_access_software_usage_registry.yml b/detections/endpoint/detect_remote_access_software_usage_registry.yml index 63567699d8..864013da8d 100644 --- a/detections/endpoint/detect_remote_access_software_usage_registry.yml +++ b/detections/endpoint/detect_remote_access_software_usage_registry.yml @@ -18,9 +18,9 @@ search: '| tstats `security_content_summariesonly` latest(Registry.process_guid) | eval file_name = coalesce(file_name_1,file_name_2) | lookup remote_access_software remote_utility AS file_name OUTPUT isutility, description as signature, comment_reference as desc, category | search isutility = TRUE -| `remote_access_software_usage_exception_filter` +| `remote_access_software_usage_exceptions` | `detect_remote_access_software_usage_registry_filter`' -how_to_implement: The detection is based on data that originates from Endpoint Detection and Response (EDR) agents. These agents are designed to provide security-related telemetry from the endpoints where the agent is installed. To implement this search, you must ingest logs that contain the file path, file name, and the user that created the file. These logs must be processed using the appropriate Splunk Technology Add-ons that are specific to the EDR product. The logs must also be mapped to the `Filesystem` node of the `Endpoint` 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. +how_to_implement: The detection is based on data that originates from Endpoint Detection and Response (EDR) agents. These agents are designed to provide security-related telemetry from the endpoints where the agent is installed. To implement this search, you must ingest logs that contain the file path, file name, and the user that created the file. These logs must be processed using the appropriate Splunk Technology Add-ons that are specific to the EDR product. The logs must also be mapped to the `Registry` node of the `Endpoint` 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: Known or approved applications used by the organization or usage of built-in functions. 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/ @@ -41,15 +41,15 @@ tags: - T1219 observable: - name: dest - type: system + type: Hostname role: - Victim - name: user - type: user + type: User role: - Victim - name: registry_path - type: registry_path + type: Other role: - Attacker - name: signature @@ -75,4 +75,4 @@ tests: 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 \ No newline at end of file + sourcetype: XmlWinEventLog From 36a79d6b9933ce84733dfc0ed06e8ea64e73588f Mon Sep 17 00:00:00 2001 From: Steven Dick <38897662+nterl0k@users.noreply.github.com> Date: Mon, 6 Jan 2025 17:21:02 -0500 Subject: [PATCH 3/6] Update detect_remote_access_software_usage_registry.yml --- .../endpoint/detect_remote_access_software_usage_registry.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/detections/endpoint/detect_remote_access_software_usage_registry.yml b/detections/endpoint/detect_remote_access_software_usage_registry.yml index 864013da8d..aeba021158 100644 --- a/detections/endpoint/detect_remote_access_software_usage_registry.yml +++ b/detections/endpoint/detect_remote_access_software_usage_registry.yml @@ -53,7 +53,7 @@ tags: role: - Attacker - name: signature - type: signature + type: Other role: - Attacker product: From 2627b4bea5295387ebd14a80484b8fc8c7788634 Mon Sep 17 00:00:00 2001 From: Steven Dick <38897662+nterl0k@users.noreply.github.com> Date: Tue, 7 Jan 2025 15:39:12 -0500 Subject: [PATCH 4/6] Update detect_remote_access_software_usage_registry.yml add drilldowns --- ...detect_remote_access_software_usage_registry.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/detections/endpoint/detect_remote_access_software_usage_registry.yml b/detections/endpoint/detect_remote_access_software_usage_registry.yml index aeba021158..66dfcf55f9 100644 --- a/detections/endpoint/detect_remote_access_software_usage_registry.yml +++ b/detections/endpoint/detect_remote_access_software_usage_registry.yml @@ -26,6 +26,19 @@ 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 - "$dest$" and "$user$" + search: '%original_detection_search% | search dest = "$dest$" user = "$user$"' + earliest_offset: $info_min_time$ + latest_offset: $info_max_time$ +- name: View risk events for the last 7 days for - "$dest$" and "$user$" + search: '| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$dest$","$user$") starthoursago=168 | 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: $info_min_time$ + latest_offset: $info_max_time$ +- name: Investigate registry changes on $dest$ + search: '| from datamodel:Endpoint.Registry| search dest=$dest$ registry_path=$registry_path|s$' + earliest_offset: $info_min_time$ + latest_offset: $info_max_time$ tags: analytic_story: - Insider Threat From 557fdeca897f1d7d149b01c234882fa4d119cfd2 Mon Sep 17 00:00:00 2001 From: Bhavin Patel Date: Wed, 8 Jan 2025 10:21:40 -0800 Subject: [PATCH 5/6] Add manual_test flag --- .../endpoint/detect_remote_access_software_usage_registry.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/detections/endpoint/detect_remote_access_software_usage_registry.yml b/detections/endpoint/detect_remote_access_software_usage_registry.yml index 66dfcf55f9..e466477d69 100644 --- a/detections/endpoint/detect_remote_access_software_usage_registry.yml +++ b/detections/endpoint/detect_remote_access_software_usage_registry.yml @@ -83,6 +83,7 @@ tags: - Registry.registry_key_name risk_score: 25 security_domain: endpoint + manual_test: This detection uses A&I lookups from Enterprise Security. tests: - name: True Positive Test attack_data: From 55d49364275f6f85b86a4144f1355d31da2e15c6 Mon Sep 17 00:00:00 2001 From: Bhavin Patel Date: Thu, 9 Jan 2025 13:26:23 -0800 Subject: [PATCH 6/6] update token --- .../endpoint/detect_remote_access_software_usage_registry.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/detections/endpoint/detect_remote_access_software_usage_registry.yml b/detections/endpoint/detect_remote_access_software_usage_registry.yml index e466477d69..a89b8e1e71 100644 --- a/detections/endpoint/detect_remote_access_software_usage_registry.yml +++ b/detections/endpoint/detect_remote_access_software_usage_registry.yml @@ -36,7 +36,7 @@ drilldown_searches: earliest_offset: $info_min_time$ latest_offset: $info_max_time$ - name: Investigate registry changes on $dest$ - search: '| from datamodel:Endpoint.Registry| search dest=$dest$ registry_path=$registry_path|s$' + search: '| from datamodel:Endpoint.Registry| search dest=$dest$ registry_path=$registry_path$' earliest_offset: $info_min_time$ latest_offset: $info_max_time$ tags: