ID | Technique | Tactic |
---|---|---|
T1136.001 | Local Account | Persistence |
T1136 | Create Account | Persistence |
T1078.003 | Local Accounts | Defense Evasion |
Detection: Short Lived Windows Accounts
Description
The following analytic detects the rapid creation and deletion of Windows accounts within a short time frame of 1 hour. It leverages the "Change" data model in Splunk, specifically monitoring events with result IDs 4720 (account creation) and 4726 (account deletion). This behavior is significant as it may indicate an attacker attempting to create and remove accounts quickly to evade detection or gain unauthorized access. If confirmed malicious, this activity could lead to unauthorized access, privilege escalation, or further malicious actions within the environment. Immediate investigation of flagged events is crucial to mitigate potential damage.
Search
1
2| tstats `security_content_summariesonly` values(All_Changes.result_id) as result_id count min(_time) as firstTime max(_time) as lastTime from datamodel=Change where All_Changes.result_id=4720 OR All_Changes.result_id=4726 by _time span=1h All_Changes.user All_Changes.dest All_Changes.Account_Management.src All_Changes.Account_Management.src_user
3| `security_content_ctime(lastTime)`
4| `security_content_ctime(firstTime)`
5| `drop_dm_object_name("All_Changes")`
6| `drop_dm_object_name("Account_Management")`
7| transaction user connected=false maxspan=60m
8| eval create_result_id=mvindex(result_id, 0)
9| eval delete_result_id=mvindex(result_id, 1)
10| search create_result_id = 4720 delete_result_id=4726
11| table firstTime lastTime count user src src_user dest create_result_id delete_result_id
12| `short_lived_windows_accounts_filter`
Data Source
Name | Platform | Sourcetype | Source |
---|---|---|---|
Windows Event Log System 4720 | Windows | 'xmlwineventlog' |
'XmlWinEventLog:System' |
Windows Event Log System 4726 | Windows | 'xmlwineventlog' |
'XmlWinEventLog:System' |
Macros Used
Name | Value |
---|---|
security_content_ctime | convert timeformat="%Y-%m-%dT%H:%M:%S" ctime($field$) |
short_lived_windows_accounts_filter | search * |
short_lived_windows_accounts_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 Notable | Yes |
Rule Title | %name% |
Rule Description | %description% |
Notable Event Fields | user, dest |
Creates Risk Event | True |
Implementation
This search requires you to have enabled your Group Management Audit Logs in your Local Windows Security Policy and be ingesting those logs. More information on how to enable them can be found here: http://whatevernetworks.com/auditing-group-membership-changes-in-active-directory/. We also recommend adjsuting the maxspan and _time parameter to better fit your environment.
Known False Positives
It is possible that an administrator created and deleted an account in a short time period. Verifying activity with an administrator is advised.
Associated Analytic Story
Risk Based Analytics (RBA)
Risk Message | Risk Score | Impact | Confidence |
---|---|---|---|
A user account $user$ is created and deleted within a short time period on host $dest$ by user $src_user$ | 63 | 70 | 90 |
References
Detection Testing
Test Type | Status | Dataset | Source | Sourcetype |
---|---|---|---|---|
Validation | ✅ Passing | N/A | N/A | N/A |
Unit | ✅ Passing | Dataset | WinEventLog:Security |
WinEventLog |
Integration | ✅ Passing | Dataset | WinEventLog:Security |
WinEventLog |
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: 6