Detection: Cisco Secure Endpoint - Admin Share Followed By Remote Service

Description

This analytic detects an ADMIN$ connection command on one host followed by a successful remote logon and service-creation alert on the target, by correlating Cisco Secure Endpoint Behavioral Protection telemetry using source, target, account, and time. The target alert confirms service creation, while the earlier net use command does not prove the share mapping succeeded. Review both hosts and any prevention action.

 1`cisco_secure_endpoint`
 2event_type="Threat Detection"
 3
 4
 5| `cisco_secure_endpoint_extract_bp_fields`
 6
 7
 8| where sig_id IN ("20240802132220","20221213105043")
 9
10
11| spath path=computer.network_addresses{}.ip output=endpoint_ips
12
13| spath path=bp_data.details.matched_activity.events{0}.process:start.args{} output=share_args
14
15| spath path=bp_data.details.matched_activity.events{0}.process:start.cmd_line output=share_command
16
17| spath path=bp_data.details.matched_activity.events{0}.etw_logon:success.src_ip output=logon_src_ip
18
19| spath path=bp_data.details.matched_activity.events{0}.etw_logon:success.target_user output=logon_user
20
21| spath path=bp_data.details.matched_activity.events{0}.etw_logon:success.target_domain output=logon_domain
22
23| spath path=bp_data.details.matched_activity.events{1}.etw_service:create.exec output=service_exec
24
25| spath path=bp_data.details.matched_activity.events{1}.etw_service:create.name output=service_name
26
27| spath path=bp_data.details.matched_activity.events{1}.etw_service:create.path output=service_path
28
29
30| eval stage=if(sig_id="20240802132220","share","service"),
31       share_path=mvindex(share_args,mvfind(share_args,"(?i)^use$")+1),
32       account_arg=mvindex(share_args,mvfind(share_args,"(?i)^/user:")),
33       share_parts=split(share_path,urldecode("%5C")),
34       account_parts=split(replace(account_arg,"(?i)^/user:",""),urldecode("%5C")),
35       endpoint_ips=mvmap(endpoint_ips,lower(endpoint_ips)),
36       event_time=tonumber(timestamp)+tonumber(timestamp_nanoseconds)/1000000000
37
38
39| eval source_ip=if(stage="share",endpoint_ips,lower(logon_src_ip)),
40       remote_domain=lower(if(stage="share",mvindex(account_parts,0),logon_domain)),
41       remote_user=lower(if(stage="share",mvindex(account_parts,1),logon_user)),
42       target_key=if(stage="share",lower(mvindex(share_parts,2)),
43            mvappend(endpoint_ips,lower(dest),lower(mvindex(split(dest,"."),0)))),
44       share_time_candidate=if(stage="share",event_time,null()),
45       source_guid_candidate=if(stage="share",endpoint_guid,null()),
46       source_host_candidate=if(stage="share",dest,null()),
47       share_command_candidate=if(stage="share",share_command,null())
48
49
50| where isnotnull(event_time)
51        AND isnotnull(source_ip)
52        AND isnotnull(target_key)
53        AND isnotnull(remote_domain)
54        AND isnotnull(remote_user)
55        AND (stage="service" OR lower(mvindex(share_parts,3))="admin$")
56
57
58| mvexpand source_ip
59
60| mvexpand target_key
61
62| sort 0 source_ip target_key remote_domain remote_user event_time
63
64
65| streamstats last(share_time_candidate) as share_time
66        last(source_guid_candidate) as source_endpoint_guid
67        last(source_host_candidate) as src
68        last(share_command_candidate) as share_command
69  by source_ip target_key remote_domain remote_user
70
71
72| where stage="service"
73        AND isnotnull(share_time)
74        AND event_time>=share_time
75        AND event_time-share_time<=30
76        AND source_endpoint_guid!=endpoint_guid
77
78
79| eval service_binary=service_path.urldecode("%5C").service_exec,
80       user=remote_domain.urldecode("%5C").remote_user,
81       firstTime=share_time,
82       lastTime=event_time
83
84
85| table dest src user endpoint_guid source_endpoint_guid source_ip
86        target_key share_command service_name service_binary firstTime lastTime
87
88| `security_content_ctime(firstTime)`
89
90| `security_content_ctime(lastTime)`
91
92| `cisco_secure_endpoint___admin_share_followed_by_remote_service_filter`

Data Source

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

Macros Used

Name Value
cisco_secure_endpoint_extract_bp_fields `spath path=bp_data.engine output=bp_engine
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___admin_share_followed_by_remote_service_filter search *
cisco_secure_endpoint___admin_share_followed_by_remote_service_filter is an empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.

Annotations

- MITRE ATT&CK
+ Kill Chain Phases
+ NIST
+ CIS
- Threat Actors
ID Technique Tactic
T1021.002 SMB/Windows Admin Shares Lateral Movement
T1569.002 Service Execution Execution
Installation
Exploitation
DE.CM
CIS 10

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

Approved remote administration can connect to ADMIN$ and create a service. Review the source host, account, service image, deployment change, and whether the service actually started.

Associated Analytic Story

Finding

Title Entity Field Entity Type Risk Score
Admin share command from $source_ip$ followed by remote service creation on $dest$ using account $user$ dest system 50

Threat Objects

Field Type
share_command command
service_binary file_path

References

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