Name:Detect Remote Access Software Usage Registry id:33804986-25dd-43cf-bb6b-dc14956c7cbc version:15 date:None author:Steven Dick, Onur Mustafa Erdogan, Splunk 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 13
search:| 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
| 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)
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/ -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$") | 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 registry changes on $dest$' search:'| from datamodel:Endpoint.Registry| search dest=$dest$ registry_path=$registry_path$' earliest_offset:'$info_min_time$' latest_offset:'$info_max_time$' analytic_story:['Insider Threat', 'Command And Control', 'Ransomware', 'Gozi Malware', 'CISA AA24-241A', 'Remote Monitoring and Management Software', 'Seashell Blizzard', 'Cactus Ransomware', 'Scattered Spider', 'Scattered Lapsus$ Hunters']