Detection: Cisco Secure Endpoint - Run Value and Task Reference Exe

Description

This analytic detects a long Run value and a scheduled-task creation alert referencing the same executable, by correlating Cisco Secure Endpoint Behavioral Protection alerts. The two persistence mechanisms can indicate an attacker seeking durable execution, although the Run signature only covers unusually long values. A task command may be blocked and does not prove task registration; inspect the exact path and response actions.

 1`cisco_secure_endpoint`
 2event_type="Threat Detection"
 3
 4
 5| `cisco_secure_endpoint_extract_bp_fields`
 6
 7
 8| where sig_id IN ("20201208164752","20220713143144")
 9
10
11| spath path=bp_data.details.matched_activity.events{0}.registry:set.data_txt output=run_data
12
13| spath path=bp_data.details.matched_activity.events{0}.registry:set.key output=run_key
14
15| spath path=bp_data.details.matched_activity.events{0}.registry:set.value output=run_value
16
17| spath path=bp_data.details.matched_activity.events{0}.file:create.path output=file_dir
18
19| spath path=bp_data.details.matched_activity.events{0}.file:create.name output=file_name
20
21| spath path=bp_data.details.matched_activity.events{1}.etw_task:create.name output=task_name
22
23
24| rex field=run_data "^\W*(?<run_file>[A-Za-z]:.*?\.exe)"
25
26
27| eval file_ref=lower(case(sig_id="20201208164752",run_file,sig_id="20220713143144",file_dir.urldecode("%5C").file_name))
28
29
30| eval stage=case(sig_id="20201208164752","run_key",
31           sig_id="20220713143144","task")
32
33
34| eval event_time=tonumber(timestamp)+tonumber(timestamp_nanoseconds)/1000000000
35
36
37| where isnotnull(endpoint_guid)
38        AND isnotnull(file_ref)
39        AND isnotnull(event_time)
40
41
42| sort 0 endpoint_guid file_ref event_time
43
44
45| streamstats max(eval(if(stage="run_key",event_time,null()))) as run_time
46              last(eval(if(stage="run_key",run_key,null()))) as previous_run_key
47              last(eval(if(stage="run_key",run_value,null()))) as previous_run_value
48  by endpoint_guid file_ref
49
50
51| where stage="task"
52        AND isnotnull(run_time)
53        AND event_time>=run_time
54        AND event_time-run_time<=300
55
56
57| eval firstTime=run_time,
58       lastTime=event_time,
59       run_key=previous_run_key,
60       run_value=previous_run_value
61
62
63| dedup endpoint_guid file_ref run_time
64
65
66| eval user=coalesce(user,"unknown")
67
68
69| table dest user endpoint_guid file_ref run_key
70        run_value task_name firstTime lastTime
71
72| `security_content_ctime(firstTime)`
73
74| `security_content_ctime(lastTime)`
75
76| `cisco_secure_endpoint___run_value_and_task_reference_exe_filter`

Data Source

Name Platform Sourcetype Source
Cisco Secure Endpoint Behavioral Protection Threat Detection Other 'cisco:se' 'not_applicable'

Macros Used

Name Value
security_content_ctime convert timeformat="%Y-%m-%dT%H:%M:%S" ctime($field$)
search bp_engine=apde
spath path=bp_data.details.sig_id output=sig_id
spath path=computer.connector_guid output=endpoint_guid
spath path=computer.hostname output=dest
spath path=bp_data.details.matched_activity.events{0}.process:start.user.name output=user
spath path=bp_data.details.matched_activity.events{0}.registry:set.user.name output=registry_user
spath path=bp_data.details.matched_activity.events{0}.file:create.user.name output=file_user
eval user=coalesce(user,registry_user,file_user)
spath path=bp_data.audit output=bp_audit
spath path=bp_data.details.actions{}.action output=bp_action
spath path=bp_data.details.actions{}.status output=bp_action_status
eval bp_response=case(bp_audit="true","audit mode",isnotnull(bp_action_status),mvjoin(bp_action,", "),true(),"no action reported")`
cisco_secure_endpoint___run_value_and_task_reference_exe_filter search *
cisco_secure_endpoint___run_value_and_task_reference_exe_filter is an empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.

Annotations

Default Configuration

This detection is configured by default in Splunk Enterprise Security to run with the following settings:

Setting Value
Disabled true
Cron Schedule 0 * * * *
Earliest Time -70m@m
Latest Time -10m@m
Schedule Window auto
Creates Finding (Notable) Yes
Rule Title %name%
Rule Description %description%
Notable Event Fields user, dest
Creates Intermediate Finding (Risk Event) No
TTP detections generate a Finding (Notable) and may generate Intermediate Findings (Risk Events) for associated entities.

Implementation

This search requires Cisco Secure Endpoint Behavioral Protection Threat Detection alerts, which include event_type="Threat Detection". This search uses an input macro named cisco_secure_endpoint. We strongly recommend that you specify your environment-specific configurations (index, source, sourcetype, etc.) for Cisco Secure Endpoint Behavioral Protection Threat Detection alerts. Replace the macro definition with configurations for your Splunk environment. The cisco_secure_endpoint_extract_bp_fields macro extracts the common signature, endpoint, actor, and prevention-response fields used by this search. The search also uses a post-filter macro designed to filter out known false positives. The logs are to be ingested using the Cisco Security Cloud App for Splunk (https://splunkbase.splunk.com/app/7404). In Protect mode, a Behavioral Protection response can kill or quarantine an earlier stage, so this search requires each later alert to have actually appeared. Review bp_data.audit and bp_data.details.actions in the source events before concluding that a task registered, a process completed, or a transfer succeeded. The included audit-mode fixtures verify alert correlation, not survival of an enforced prevention action.

Known False Positives

Legitimate software installers or updaters may create both a Run value and a scheduled task for the same executable. A long command line can be benign. Review file signature, task schedule, parent process, and software deployment context before escalating.

Associated Analytic Story

Finding

Title Entity Field Entity Type Risk Score
Run key and scheduled task referencing the same executable $file_ref$ on $dest$ dest system 50

Threat Objects

Field Type
file_ref file_path
run_key registry_path
run_value registry_value_name

References

Atomic Tests

Learn more about Atomic Red Team tests here.

Atomic Test ID Atomic Test Name Supported Platform
e55be3fd-3521-4610-9d1a-e210e42dcf05 Reg Key Run Windows
42f53695-ad4a-4546-abb6-7d837f644a71 Scheduled task Local Windows

Detection Testing

Test Type Status Dataset Source Sourcetype
Validation ✅ Passing N/A N/A N/A
Unit ✅ Passing Dataset not_applicable cisco:se
Integration ✅ Passing Dataset not_applicable cisco:se

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: GitHub |

Version: 1