| ID | Technique | Tactic |
|---|---|---|
| T1552.002 | Credentials in Registry | Credential Access |
| T1555 | Credentials from Password Stores | Credential Access |
Detection: Cisco Secure Endpoint - Credential Store Sweep and Cleanup
Description
This analytic detects a registry and Windows Vault credential-store sweep in one process tree by correlating Cisco Secure Endpoint Behavioral Protection alerts. It also identifies PowerShell history deletion after the sweep when observed. The ordered actions can indicate an attacker looking for stored credentials; subsequent history deletion can indicate an attempt to hide evidence of that activity. Determine whether credentials were accessed; the alerts alone do not prove extraction.
Search
1`cisco_secure_endpoint`
2event_type="Threat Detection"
3
4
5| `cisco_secure_endpoint_extract_bp_fields`
6
7
8| where sig_id IN ("20190125210148","20200702150108","20210401012913")
9
10
11| spath path=bp_data.details.matched_activity.events{0}.process:start.parent_guid output=parent_guid
12
13| spath path=bp_data.details.matched_activity.events{0}.process:start.cmd_line output=process_command
14
15
16| eval stage=case(sig_id="20190125210148","registry",
17 sig_id="20200702150108","vault",
18 sig_id="20210401012913","cleanup")
19
20
21| eval event_time=tonumber(timestamp)+tonumber(timestamp_nanoseconds)/1000000000
22
23
24| where isnotnull(endpoint_guid)
25 AND isnotnull(parent_guid)
26 AND isnotnull(event_time)
27
28
29| sort 0 endpoint_guid parent_guid event_time
30
31
32| streamstats max(eval(if(stage="registry",event_time,null()))) as registry_time
33 last(eval(if(stage="registry",process_command,null()))) as registry_command
34 max(eval(if(stage="vault",event_time,null()))) as vault_time
35 last(eval(if(stage="vault",process_command,null()))) as vault_command
36 by endpoint_guid parent_guid
37
38
39| where (stage="vault"
40 AND isnotnull(registry_time)
41 AND registry_time<=event_time
42 AND event_time-registry_time<=600)
43 OR (stage="cleanup"
44 AND isnotnull(registry_time)
45 AND isnotnull(vault_time)
46 AND registry_time<=vault_time
47 AND vault_time<=event_time
48 AND event_time-registry_time<=600)
49
50
51| eval history_command=if(stage="cleanup",process_command,null()),
52 activity=if(stage="cleanup","history cleared","vault queried"),
53 firstTime=registry_time,
54 lastTime=event_time
55
56
57| sort 0 endpoint_guid parent_guid firstTime -lastTime
58
59
60| dedup endpoint_guid parent_guid firstTime
61
62
63| eval user=coalesce(user,"unknown")
64
65
66| table dest user endpoint_guid parent_guid activity registry_command
67 vault_command history_command firstTime lastTime
68
69| `security_content_ctime(firstTime)`
70
71| `security_content_ctime(lastTime)`
72
73| `cisco_secure_endpoint___credential_store_sweep_and_cleanup_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___credential_store_sweep_and_cleanup_filter | search * |
cisco_secure_endpoint___credential_store_sweep_and_cleanup_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 |
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
An administrator may inspect a credential-related registry key and vault entries, then clear PowerShell history during maintenance. Review the queried key, vault access scope, account, parent process, and whether the history file actually existed and was removed.
Associated Analytic Story
Finding
| Title | Entity Field | Entity Type | Risk Score |
|---|---|---|---|
| Registry and Windows Vault credential sweep under parent process $parent_guid$ on $dest$ | dest | system | 50 |
Threat Objects
| Field | Type |
|---|---|
| registry_command | command |
| vault_command | command |
References
-
https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1070.003/T1070.003.md
-
https://docs.amp.cisco.com/en/SecureEndpoint/Secure%20Endpoint%20User%20Guide.pdf
-
https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1552.002/T1552.002.md
-
https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1555.004/T1555.004.md
Atomic Tests
Learn more about Atomic Red Team tests here.
| Atomic Test ID | Atomic Test Name | Supported Platform |
|---|---|---|
| b6ec082c-7384-46b3-a111-9a9b8b14e5e7 | Enumeration for Credentials in Registry | Windows |
| 9c2dd36d-5c8b-4b29-8d72-a11b0d5d7439 | Access Saved Credentials via VaultCmd | Windows |
| da75ae8d-26d6-4483-b0fe-700e4df4f037 | Clear Powershell History by Deleting History File | 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