Detection rules › Splunk

Short Lived Windows Accounts

Status
production
Severity
medium
Group by
All_Changes.Account_Management.src, All_Changes.Account_Management.src_user, All_Changes.dest, All_Changes.user, _time, user
Author
David Dorsey, Bhavin Patel, Splunk
Source
github.com/splunk/security_content

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.

MITRE ATT&CK coverage

Event coverage

Rule body splunk

name: Short Lived Windows Accounts
id: b25f6f62-0782-43c1-b403-083231ffd97d
version: 14
creation_date: '2020-04-29'
modification_date: '2026-05-13'
author: David Dorsey, Bhavin Patel, Splunk
status: production
type: TTP
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.
data_source:
    - Windows Event Log System 4720
    - Windows Event Log System 4726
search: |-
    | 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
    | `security_content_ctime(lastTime)`
    | `security_content_ctime(firstTime)`
    | `drop_dm_object_name("All_Changes")`
    | `drop_dm_object_name("Account_Management")`
    | transaction user connected=false maxspan=60m
    | eval create_result_id=mvindex(result_id, 0)
    | eval delete_result_id=mvindex(result_id, 1)
    | search create_result_id = 4720 delete_result_id=4726
    | table firstTime lastTime count user src src_user dest create_result_id delete_result_id
    | `short_lived_windows_accounts_filter`
how_to_implement: '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.
references:
    - https://www.youtube.com/watch?v=D4Cd-KK4ctk
    - https://attack.mitre.org/techniques/T1078/
drilldown_searches:
    - name: View the detection results for - "$dest$" and "$src_user$"
      search: '%original_detection_search% | search  dest = "$dest$" src_user = "$src_user$"'
      earliest_offset: $info_min_time$
      latest_offset: $info_max_time$
    - name: View risk events for the last 7 days for - "$dest$" and "$user$"
      search: '| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$dest$", "$user$") | stats count min(_time) as firstTime max(_time) as lastTime values(search_name) as "Search Name" values(risk_message) as "Risk Message" values(analyticstories) as "Analytic Stories" values(annotations._all) as "Annotations" values(annotations.mitre_attack.mitre_tactic) as "ATT&CK Tactics" by normalized_risk_object | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)`'
      earliest_offset: 7d
      latest_offset: "0"
finding:
    title: A user account $user$ is created and deleted within a short time period on host $dest$ by user $src_user$
    entity:
        field: src_user
        type: user
        score: 50
intermediate_findings:
    entities:
        - field: dest
          type: system
          score: 50
          message: A user account $user$ is created and deleted within a short time period on host $dest$ by user $src_user$
analytic_story:
    - Active Directory Lateral Movement
    - GhostRedirector IIS Module and Rungan Backdoor
asset_type: Windows
mitre_attack_id:
    - T1078.003
    - T1136.001
product:
    - Splunk Enterprise
    - Splunk Enterprise Security
    - Splunk Cloud
category: endpoint
security_domain: access
tests:
    - name: True Positive Test
      attack_data:
        - data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1136.001/atomic_red_team/windows-security.log
          source: WinEventLog:Security
          sourcetype: WinEventLog
        - data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1136.001/atomic_red_team/windows-system.log
          source: WinEventLog:System
          sourcetype: WinEventLog
        - data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1136.001/atomic_red_team/windows-sysmon.log
          source: XmlWinEventLog:Microsoft-Windows-Sysmon/Operational
          sourcetype: XmlWinEventLog
      test_type: unit

Stages and Predicates

Stage 1: tstats

| 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

Stage 2: search

| `security_content_ctime(lastTime)`

Stage 3: search

| `security_content_ctime(firstTime)`

Stage 4: search

| `drop_dm_object_name("All_Changes")`

Stage 5: search

| `drop_dm_object_name("Account_Management")`

Stage 6: transaction

| transaction user connected=false maxspan=60m

Stage 7: eval

| eval create_result_id=mvindex(result_id, 0)

Stage 8: eval

| eval delete_result_id=mvindex(result_id, 1)

Stage 9: search

| search create_result_id = 4720 delete_result_id=4726

Stage 10: table

| table firstTime lastTime count user src src_user dest create_result_id delete_result_id

Stage 11: search

| `short_lived_windows_accounts_filter`

Indicators

Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.

FieldKindValues
All_Changes.result_ideq
  • 4720 corpus 2 (splunk 2)
  • 4726
create_result_ideq
  • 4720
delete_result_ideq
  • 4726