Detect Remote Access Software Usage Registry
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.
Query · spl
| tstats `security_content_summariesonly`
count min(_time) as firstTime
max(_time) as lastTime
latest(Registry.process_guid) as process_guid
FROM datamodel=Endpoint.Registry WHERE
(
Registry.registry_path="*\\Microsoft\\Windows\\CurrentVersion\\Run*"
OR
(
Registry.registry_path="*\\SYSTEM\\CurrentControlSet\\Services\\*"
Registry.registry_value_name="ImagePath"
)
)
(
[
| inputlookup remote_access_software
| search file_name!=""
| eval file_name="*".file_name."*"
| rex mode=sed field=file_name "s/\*\*/\*/g"
| rename file_name as Registry.registry_value_data
| table Registry.registry_value_data
]
OR
[
| inputlookup remote_access_software
| search file_path!=""
| eval file_path="*".file_path."*"
| rex mode=sed field=file_path "s/\*\*/\*/g"
| rename file_path as Registry.registry_value_data
| table Registry.registry_value_data
]
)
BY Registry.action Registry.dest Registry.process_guid Registry.process_id Registry.registry_hive
Registry.registry_path Registry.registry_key_name Registry.registry_value_data Registry.registry_value_name
Registry.registry_value_type Registry.status Registry.user Registry.vendor_product
| `drop_dm_object_name(Registry)`
| rex field=registry_value_data "(?i)(?:^|\x5c)(?<file_name>[^\x5c/\x27\x22]+\.\w{2,5})\b"
| rex field=registry_value_data "(?i)(?<file_path>\w:\x5c(?:[^\x5c/\x27\x22]+\x5c)+[^\x5c/\x27\x22]+\.\w{2,5})\b"
| lookup local=t remote_access_software file_name OUTPUT app as name_signature, category as name_category, reference as name_reference, description as name_description
| lookup local=t remote_access_software file_path OUTPUT app as path_signature, category as path_category, reference as path_reference, description as path_description
| eval signature=coalesce(nullif(name_signature, ""), path_signature),
category=coalesce(nullif(name_category, ""), path_category),
reference=coalesce(nullif(name_reference, ""), path_reference),
description=coalesce(nullif(name_description, ""), path_description)
| `security_content_ctime(firstTime)`
| `security_content_ctime(lastTime)`
| `remote_access_software_usage_exceptions`
| `detect_remote_access_software_usage_registry_filter`
Implementation guide
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
Analyst notes
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