ID | Technique | Tactic |
---|---|---|
T1136.001 | Local Account | Persistence |
T1136 | Create Account | Persistence |
Detection: Short Lived Windows Accounts
Description
The following analytic detects the rapid creation and deletion of Windows accounts within a short time frame. 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=4h All_Changes.user All_Changes.dest
3| `security_content_ctime(lastTime)`
4| `security_content_ctime(firstTime)`
5| `drop_dm_object_name("All_Changes")`
6| search result_id = 4720 result_id=4726
7| transaction user connected=false maxspan=240m
8| table firstTime lastTime count user dest result_id
9| `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/
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 created or delete shortly in host $dest$ | 63 | 70 | 90 |
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: 4