From ae48d01b8fe67ef8c3dba0412799e01a10213825 Mon Sep 17 00:00:00 2001 From: research-bot Date: Thu, 14 Nov 2024 14:36:30 -0800 Subject: [PATCH 1/3] udpating detection --- .../endpoint/short_lived_windows_accounts.yml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/detections/endpoint/short_lived_windows_accounts.yml b/detections/endpoint/short_lived_windows_accounts.yml index 73372196c4..379bd5f1bc 100644 --- a/detections/endpoint/short_lived_windows_accounts.yml +++ b/detections/endpoint/short_lived_windows_accounts.yml @@ -1,16 +1,23 @@ name: Short Lived Windows Accounts id: b25f6f62-0782-43c1-b403-083231ffd97d -version: 5 -date: '2024-09-30' +version: 6 +date: '2024-11-14' author: David Dorsey, Splunk status: production type: TTP -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. +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=4h All_Changes.user All_Changes.dest | `security_content_ctime(lastTime)` | `security_content_ctime(firstTime)` | `drop_dm_object_name("All_Changes")` | search result_id = 4720 result_id=4726 | transaction user connected=false maxspan=240m | table firstTime lastTime count user dest 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/' +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.src +| `security_content_ctime(lastTime)` +| `security_content_ctime(firstTime)` +| `drop_dm_object_name("All_Changes")` +| transaction user connected=false maxspan=60m +| eval create_result_id=mvindex(result_id, 0) | eval delete_result_id=mvindex(result_id, 1) +| table firstTime lastTime count user src 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: [] drilldown_searches: From 69e78f2a65a82eadd2928f2e6d00e6780dc4f689 Mon Sep 17 00:00:00 2001 From: research-bot Date: Thu, 14 Nov 2024 14:38:42 -0800 Subject: [PATCH 2/3] references --- detections/endpoint/short_lived_windows_accounts.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/detections/endpoint/short_lived_windows_accounts.yml b/detections/endpoint/short_lived_windows_accounts.yml index 379bd5f1bc..772d84600c 100644 --- a/detections/endpoint/short_lived_windows_accounts.yml +++ b/detections/endpoint/short_lived_windows_accounts.yml @@ -2,7 +2,7 @@ name: Short Lived Windows Accounts id: b25f6f62-0782-43c1-b403-083231ffd97d version: 6 date: '2024-11-14' -author: David Dorsey, Splunk +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. @@ -19,7 +19,9 @@ search: '| tstats `security_content_summariesonly` values(All_Changes.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: [] +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 "$user$" search: '%original_detection_search% | search dest = "$dest$" user = "$user$"' From 46d8a8064572493bfc76e977c04dce120d864a04 Mon Sep 17 00:00:00 2001 From: research-bot Date: Mon, 18 Nov 2024 14:03:47 -0800 Subject: [PATCH 3/3] updating observable --- .../endpoint/short_lived_windows_accounts.yml | 21 ++++++++++--------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/detections/endpoint/short_lived_windows_accounts.yml b/detections/endpoint/short_lived_windows_accounts.yml index 772d84600c..343a908605 100644 --- a/detections/endpoint/short_lived_windows_accounts.yml +++ b/detections/endpoint/short_lived_windows_accounts.yml @@ -9,13 +9,13 @@ description: The following analytic detects the rapid creation and deletion of W 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.src +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("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) -| table firstTime lastTime count user src dest create_result_id delete_result_id +| 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. @@ -23,12 +23,12 @@ 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 "$user$" - search: '%original_detection_search% | search dest = "$dest$" user = "$user$"' +- 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$") starthoursago=168 | 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)`' +- name: View risk events for the last 7 days for - "$dest$" and "$src_user$" + search: '| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$dest$", "$src_user$") starthoursago=168 | 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: $info_min_time$ latest_offset: $info_max_time$ tags: @@ -37,16 +37,17 @@ tags: asset_type: Windows confidence: 90 impact: 70 - message: A user account created or delete shortly in host $dest$ + message: A user account $user$ is created and deleted within a short time period on host $dest$ by user $src_user$ mitre_attack_id: - T1136.001 - T1136 + - T1078.003 observable: - name: dest type: Hostname role: - Victim - - name: user + - name: src_user type: User role: - Victim