From d4355f73abf17e9cf0916628efb02428ab83a13e Mon Sep 17 00:00:00 2001 From: Nasreddine Bencherchali Date: Wed, 29 Jan 2025 00:32:42 +0100 Subject: [PATCH 01/14] feat: add new auditpol related analytics --- ...dows_audit_policy_cleared_via_auditpol.yml | 71 +++++++++++++++++++ ...ows_audit_policy_disabled_via_auditpol.yml | 70 ++++++++++++++++++ ..._policy_excluded_category_via_auditpol.yml | 70 ++++++++++++++++++ ...ows_audit_policy_restored_via_auditpol.yml | 70 ++++++++++++++++++ ...rity_descriptor_tampering_via_auditpol.yml | 67 +++++++++++++++++ ...access_audit_list_cleared_via_auditpol.yml | 67 +++++++++++++++++ 6 files changed, 415 insertions(+) create mode 100644 detections/endpoint/windows_audit_policy_cleared_via_auditpol.yml create mode 100644 detections/endpoint/windows_audit_policy_disabled_via_auditpol.yml create mode 100644 detections/endpoint/windows_audit_policy_excluded_category_via_auditpol.yml create mode 100644 detections/endpoint/windows_audit_policy_restored_via_auditpol.yml create mode 100644 detections/endpoint/windows_audit_policy_security_descriptor_tampering_via_auditpol.yml create mode 100644 detections/endpoint/windows_global_object_access_audit_list_cleared_via_auditpol.yml diff --git a/detections/endpoint/windows_audit_policy_cleared_via_auditpol.yml b/detections/endpoint/windows_audit_policy_cleared_via_auditpol.yml new file mode 100644 index 0000000000..5ab1d8ba55 --- /dev/null +++ b/detections/endpoint/windows_audit_policy_cleared_via_auditpol.yml @@ -0,0 +1,71 @@ +name: Windows Audit Policy Cleared Via Auditpol +id: f067f7cf-f41b-4a60-985e-c23e268a13cb +version: 1 +date: '2025-01-27' +author: Nasreddine Bencherchali, Splunk +status: production +type: TTP +description: The following analytic identifies the execution of `auditpol.exe` with the "/clear" command-line argument used to clears the audit policy. It leverages data from Endpoint Detection and Response (EDR) agents, focusing on process names and command-line executions. This activity can be significant as it indicates potential defense evasion by adversaries or Red Teams, aiming to limit data that can be leveraged for detections and audits. If confirmed malicious, this behavior could allow attackers to bypass defenses, and plan further attacks, potentially leading to full machine compromise or lateral movement. +data_source: +- Sysmon EventID 1 +- Windows Event Log Security 4688 +- CrowdStrike ProcessRollup2 +search: '| tstats `security_content_summariesonly` values(Processes.process) as process min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes where `process_auditpol` Processes.process IN ("*/clear*", "*/remove*") AND NOT Processes.process IN ("*/resourceSACL*", "*/?*") by Processes.dest Processes.user Processes.parent_process Processes.parent_process_name Processes.process_name Processes.original_file_name Processes.process Processes.process_id Processes.parent_process_id | `drop_dm_object_name(Processes)` | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)` | `windows_audit_policy_cleared_via_auditpol_filter`' +how_to_implement: The detection is based on data that originates from Endpoint Detection and Response (EDR) agents. These agents are designed to provide security-related telemetry from the endpoints where the agent is installed. To implement this search, you must ingest logs that contain the process name, and process original file name. Additionally, you must ingest complete command-line executions. These logs must be processed using the appropriate Splunk Technology Add-ons that are specific to the EDR product. The logs must also be mapped to the `Processes` node of the `Endpoint` data model. Use the Splunk Common Information Model (CIM) to normalize the field names and speed up the data modeling process. +known_false_positives: None identified. Attempts to disable logging should be identified and understood. +references: +- https://www.microsoft.com/en-us/security/blog/2021/01/20/deep-dive-into-the-solorigate-second-stage-activation-from-sunburst-to-teardrop-and-raindrop/ +- https://www.cybereason.com/blog/research/prometei-botnet-exploiting-microsoft-exchange-vulnerabilities +- https://attack.mitre.org/techniques/T1562/002/ +- https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/auditpol-clear +- https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/auditpol-remove +drilldown_searches: +- name: View the detection results for - "$user$" and "$dest$" + search: '%original_detection_search% | search user = "$user$" dest = "$dest$"' + earliest_offset: $info_min_time$ + latest_offset: $info_max_time$ +- name: View risk events for the last 7 days for - "$user$" and "$dest$" + search: '| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$user$", + "$dest$") 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$ +rba: + message: An instance of $parent_process_name$ spawning $process_name$ was identified attempting to clear logging on endpoint $dest$ by user $user$. + risk_objects: + - field: user + type: user + score: 16 + - field: dest + type: system + score: 16 + threat_objects: + - field: process_name + type: process_name +tags: + analytic_story: + - Windows Audit Policy Tampering + asset_type: Endpoint + mitre_attack_id: + - T1562.002 + product: + - Splunk Enterprise + - Splunk Enterprise Security + - Splunk Cloud + security_domain: endpoint +tests: +- name: True Positive Test - Sysmon + attack_data: + - data: + https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1562.002/auditpol_tampering/auditpol_tampering_sysmon.log + source: XmlWinEventLog:Microsoft-Windows-Sysmon/Operational + sourcetype: XmlWinEventLog +- name: True Positive Test - Security + attack_data: + - data: + https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1562.002/auditpol_tampering/auditpol_tampering_security.log + source: XmlWinEventLog:Security + sourcetype: XmlWinEventLog diff --git a/detections/endpoint/windows_audit_policy_disabled_via_auditpol.yml b/detections/endpoint/windows_audit_policy_disabled_via_auditpol.yml new file mode 100644 index 0000000000..5a7bb205d4 --- /dev/null +++ b/detections/endpoint/windows_audit_policy_disabled_via_auditpol.yml @@ -0,0 +1,70 @@ +name: Windows Audit Policy Disabled Via Auditpol +id: 14e008e5-6723-4298-b0d4-e95b24e10c18 +version: 1 +date: '2025-01-27' +author: Nasreddine Bencherchali, Splunk +status: production +type: Anomaly +description: The following analytic identifies the execution of `auditpol.exe` with the "/set" command-line argument in order to disable a specific category or sub-category from the audit policy. It leverages data from Endpoint Detection and Response (EDR) agents, focusing on process names and command-line executions. This activity can be significant as it indicates potential defense evasion by adversaries or Red Teams, aiming to limit data that can be leveraged for detections and audits. If confirmed malicious, this behavior could allow attackers to bypass defenses, and plan further attacks, potentially leading to full machine compromise or lateral movement. +data_source: +- Sysmon EventID 1 +- Windows Event Log Security 4688 +- CrowdStrike ProcessRollup2 +search: '| tstats `security_content_summariesonly` values(Processes.process) as process min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes where `process_auditpol` Processes.process="*/set*" Processes.process IN ("*/success:*", "*/failure:*") Processes.process="*disable*" AND NOT Processes.process IN ("*/?*", "*/exclude*") by Processes.dest Processes.user Processes.parent_process Processes.parent_process_name Processes.process_name Processes.original_file_name Processes.process Processes.process_id Processes.parent_process_id | `drop_dm_object_name(Processes)` | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)` | `windows_audit_policy_disabled_via_auditpol_filter`' +how_to_implement: The detection is based on data that originates from Endpoint Detection and Response (EDR) agents. These agents are designed to provide security-related telemetry from the endpoints where the agent is installed. To implement this search, you must ingest logs that contain the process name, and process original file name. Additionally, you must ingest complete command-line executions. These logs must be processed using the appropriate Splunk Technology Add-ons that are specific to the EDR product. The logs must also be mapped to the `Processes` node of the `Endpoint` data model. Use the Splunk Common Information Model (CIM) to normalize the field names and speed up the data modeling process. +known_false_positives: False positives should be rare, investigate the activity, and apply additional filters when necessary. +references: +- https://www.microsoft.com/en-us/security/blog/2021/01/20/deep-dive-into-the-solorigate-second-stage-activation-from-sunburst-to-teardrop-and-raindrop/ +- https://www.cybereason.com/blog/research/prometei-botnet-exploiting-microsoft-exchange-vulnerabilities +- https://attack.mitre.org/techniques/T1562/002/ +- https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/auditpol-set +drilldown_searches: +- name: View the detection results for - "$user$" and "$dest$" + search: '%original_detection_search% | search user = "$user$" dest = "$dest$"' + earliest_offset: $info_min_time$ + latest_offset: $info_max_time$ +- name: View risk events for the last 7 days for - "$user$" and "$dest$" + search: '| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$user$", + "$dest$") 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$ +rba: + message: An instance of $parent_process_name$ spawning $process_name$ with CommandLine $process$ was identified attempting to disable and audit policy category/sub-category on $dest$ by user $user$. + risk_objects: + - field: user + type: user + score: 25 + - field: dest + type: system + score: 25 + threat_objects: + - field: process_name + type: process_name +tags: + analytic_story: + - Windows Audit Policy Tampering + asset_type: Endpoint + mitre_attack_id: + - T1562.002 + product: + - Splunk Enterprise + - Splunk Enterprise Security + - Splunk Cloud + security_domain: endpoint +tests: +- name: True Positive Test - Sysmon + attack_data: + - data: + https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1562.002/auditpol_tampering/auditpol_tampering_sysmon.log + source: XmlWinEventLog:Microsoft-Windows-Sysmon/Operational + sourcetype: XmlWinEventLog +- name: True Positive Test - Security + attack_data: + - data: + https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1562.002/auditpol_tampering/auditpol_tampering_security.log + source: XmlWinEventLog:Security + sourcetype: XmlWinEventLog diff --git a/detections/endpoint/windows_audit_policy_excluded_category_via_auditpol.yml b/detections/endpoint/windows_audit_policy_excluded_category_via_auditpol.yml new file mode 100644 index 0000000000..37cb7228b8 --- /dev/null +++ b/detections/endpoint/windows_audit_policy_excluded_category_via_auditpol.yml @@ -0,0 +1,70 @@ +name: Windows Audit Policy Excluded Category Via Auditpol +id: 083708d4-d763-4ba2-87ac-105b526de81a +version: 1 +date: '2025-01-27' +author: Nasreddine Bencherchali, Splunk +status: production +type: Anomaly +description: The following analytic identifies the execution of `auditpol.exe` with the "/set" and "/exclude" command-line arguments which indicates that the user's per-user policy will cause audit to be suppressed regardless of the system audit policy. It leverages data from Endpoint Detection and Response (EDR) agents, focusing on process names and command-line executions. This activity can be significant as it indicates potential defense evasion by adversaries or Red Teams, aiming to exclude specific users events from log data. If confirmed malicious, this behavior could allow attackers to bypass defenses, and plan further attacks, potentially leading to full machine compromise or lateral movement. +data_source: +- Sysmon EventID 1 +- Windows Event Log Security 4688 +- CrowdStrike ProcessRollup2 +search: '| tstats `security_content_summariesonly` values(Processes.process) as process min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes where `process_auditpol` Processes.process="*/set*" Processes.process="*/exclude*" AND NOT Processes.process="*/?*" by Processes.dest Processes.user Processes.parent_process Processes.parent_process_name Processes.process_name Processes.original_file_name Processes.process Processes.process_id Processes.parent_process_id | `drop_dm_object_name(Processes)` | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)` | `windows_audit_policy_excluded_category_via_auditpol_filter`' +how_to_implement: The detection is based on data that originates from Endpoint Detection and Response (EDR) agents. These agents are designed to provide security-related telemetry from the endpoints where the agent is installed. To implement this search, you must ingest logs that contain the process name, and process original file name. Additionally, you must ingest complete command-line executions. These logs must be processed using the appropriate Splunk Technology Add-ons that are specific to the EDR product. The logs must also be mapped to the `Processes` node of the `Endpoint` data model. Use the Splunk Common Information Model (CIM) to normalize the field names and speed up the data modeling process. +known_false_positives: False positives should be rare, investigate the activity, and apply additional filters when necessary. +references: +- https://www.microsoft.com/en-us/security/blog/2021/01/20/deep-dive-into-the-solorigate-second-stage-activation-from-sunburst-to-teardrop-and-raindrop/ +- https://www.cybereason.com/blog/research/prometei-botnet-exploiting-microsoft-exchange-vulnerabilities +- https://attack.mitre.org/techniques/T1562/002/ +- https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/auditpol-set +drilldown_searches: +- name: View the detection results for - "$user$" and "$dest$" + search: '%original_detection_search% | search user = "$user$" dest = "$dest$"' + earliest_offset: $info_min_time$ + latest_offset: $info_max_time$ +- name: View risk events for the last 7 days for - "$user$" and "$dest$" + search: '| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$user$", + "$dest$") 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$ +rba: + message: An instance of $parent_process_name$ spawning $process_name$ with CommandLine $process$ was identified attempting to exclude a specific user events on $dest$ by user $user$. + risk_objects: + - field: user + type: user + score: 25 + - field: dest + type: system + score: 25 + threat_objects: + - field: process_name + type: process_name +tags: + analytic_story: + - Windows Audit Policy Tampering + asset_type: Endpoint + mitre_attack_id: + - T1562.002 + product: + - Splunk Enterprise + - Splunk Enterprise Security + - Splunk Cloud + security_domain: endpoint +tests: +- name: True Positive Test - Sysmon + attack_data: + - data: + https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1562.002/auditpol_tampering/auditpol_tampering_sysmon.log + source: XmlWinEventLog:Microsoft-Windows-Sysmon/Operational + sourcetype: XmlWinEventLog +- name: True Positive Test - Security + attack_data: + - data: + https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1562.002/auditpol_tampering/auditpol_tampering_security.log + source: XmlWinEventLog:Security + sourcetype: XmlWinEventLog diff --git a/detections/endpoint/windows_audit_policy_restored_via_auditpol.yml b/detections/endpoint/windows_audit_policy_restored_via_auditpol.yml new file mode 100644 index 0000000000..9dfdace4dd --- /dev/null +++ b/detections/endpoint/windows_audit_policy_restored_via_auditpol.yml @@ -0,0 +1,70 @@ +name: Windows Audit Policy Restored Via Auditpol +id: d7d1795b-ea18-47e5-9ca6-2c330d052d21 +version: 1 +date: '2025-01-27' +author: Nasreddine Bencherchali, Splunk +status: production +type: Anomaly +description: The following analytic identifies the execution of `auditpol.exe` with the "/restore" command-line argument used to restore the audit policy from a file. It leverages data from Endpoint Detection and Response (EDR) agents, focusing on process names and command-line executions. This activity can be significant as it indicates potential defense evasion by adversaries or Red Teams, aiming to limit data that can be leveraged for detections and audits. Attackers can provide an audit policy file that disables certain or all audit policy configuration. If confirmed malicious, this behavior could allow attackers to bypass defenses, and plan further attacks, potentially leading to full machine compromise or lateral movement. +data_source: +- Sysmon EventID 1 +- Windows Event Log Security 4688 +- CrowdStrike ProcessRollup2 +search: '| tstats `security_content_summariesonly` values(Processes.process) as process min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes where `process_auditpol` Processes.process="*/restore*" Processes.process="*/file*" AND NOT Processes.process="*/?*" by Processes.dest Processes.user Processes.parent_process Processes.parent_process_name Processes.process_name Processes.original_file_name Processes.process Processes.process_id Processes.parent_process_id | `drop_dm_object_name(Processes)` | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)` | `windows_audit_policy_restored_via_auditpol_filter`' +how_to_implement: The detection is based on data that originates from Endpoint Detection and Response (EDR) agents. These agents are designed to provide security-related telemetry from the endpoints where the agent is installed. To implement this search, you must ingest logs that contain the process name, and process original file name. Additionally, you must ingest complete command-line executions. These logs must be processed using the appropriate Splunk Technology Add-ons that are specific to the EDR product. The logs must also be mapped to the `Processes` node of the `Endpoint` data model. Use the Splunk Common Information Model (CIM) to normalize the field names and speed up the data modeling process. +known_false_positives: False positives could arise from administrative activity such as audit policy setup. Apply additional filters to known scripts and parent processes performing this action where necessary. +references: +- https://www.microsoft.com/en-us/security/blog/2021/01/20/deep-dive-into-the-solorigate-second-stage-activation-from-sunburst-to-teardrop-and-raindrop/ +- https://www.cybereason.com/blog/research/prometei-botnet-exploiting-microsoft-exchange-vulnerabilities +- https://attack.mitre.org/techniques/T1562/002/ +- https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/auditpol-restore +drilldown_searches: +- name: View the detection results for - "$user$" and "$dest$" + search: '%original_detection_search% | search user = "$user$" dest = "$dest$"' + earliest_offset: $info_min_time$ + latest_offset: $info_max_time$ +- name: View risk events for the last 7 days for - "$user$" and "$dest$" + search: '| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$user$", + "$dest$") 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$ +rba: + message: An instance of $parent_process_name$ spawning $process_name$ was identified attempting to restore and audit policy on endpoint $dest$ by user $user$. + risk_objects: + - field: user + type: user + score: 16 + - field: dest + type: system + score: 16 + threat_objects: + - field: process_name + type: process_name +tags: + analytic_story: + - Windows Audit Policy Tampering + asset_type: Endpoint + mitre_attack_id: + - T1562.002 + product: + - Splunk Enterprise + - Splunk Enterprise Security + - Splunk Cloud + security_domain: endpoint +tests: +- name: True Positive Test - Sysmon + attack_data: + - data: + https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1562.002/auditpol_tampering/auditpol_tampering_sysmon.log + source: XmlWinEventLog:Microsoft-Windows-Sysmon/Operational + sourcetype: XmlWinEventLog +- name: True Positive Test - Security + attack_data: + - data: + https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1562.002/auditpol_tampering/auditpol_tampering_security.log + source: XmlWinEventLog:Security + sourcetype: XmlWinEventLog diff --git a/detections/endpoint/windows_audit_policy_security_descriptor_tampering_via_auditpol.yml b/detections/endpoint/windows_audit_policy_security_descriptor_tampering_via_auditpol.yml new file mode 100644 index 0000000000..6cd2c6ffcc --- /dev/null +++ b/detections/endpoint/windows_audit_policy_security_descriptor_tampering_via_auditpol.yml @@ -0,0 +1,67 @@ +name: Windows Global Object Access Audit List Cleared Via Auditpol +id: 5628e0b7-73dc-4f1b-b37a-6e68efc2225f +version: 1 +date: '2025-01-27' +author: Nasreddine Bencherchali, Splunk +status: production +type: Anomaly +description: The following analytic identifies the execution of `auditpol.exe` with the "/set" flag, and "/sd" command-line arguments used to modify the security descriptor of the audit policy. It leverages data from Endpoint Detection and Response (EDR) agents, focusing on process names and command-line executions. This activity can be significant as it indicates potential defense evasion by adversaries or Red Teams, aiming to limit data that can be leveraged for detections and audits. An attacker, can disable certain policy categories from logging and then change the security descriptor in order to restrict access to certain users or application from reverting their changes. If confirmed malicious, this behavior could allow attackers to bypass defenses, and plan further attacks, potentially leading to full machine compromise or lateral movement. +data_source: +- Sysmon EventID 1 +- Windows Event Log Security 4688 +- CrowdStrike ProcessRollup2 +search: '| tstats `security_content_summariesonly` values(Processes.process) as process min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes where `process_auditpol` Processes.process="*/set*" Processes.process="*/sd:*" AND NOT Processes.process="*/?*" by Processes.dest Processes.user Processes.parent_process Processes.parent_process_name Processes.process_name Processes.original_file_name Processes.process Processes.process_id Processes.parent_process_id | `drop_dm_object_name(Processes)` | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)` | `windows_audit_policy_security_descriptor_tampering_via_auditpol_filter`' +how_to_implement: The detection is based on data that originates from Endpoint Detection and Response (EDR) agents. These agents are designed to provide security-related telemetry from the endpoints where the agent is installed. To implement this search, you must ingest logs that contain the process name, and process original file name. Additionally, you must ingest complete command-line executions. These logs must be processed using the appropriate Splunk Technology Add-ons that are specific to the EDR product. The logs must also be mapped to the `Processes` node of the `Endpoint` data model. Use the Splunk Common Information Model (CIM) to normalize the field names and speed up the data modeling process. +known_false_positives: False positives should be rare to non existent. Any activity detected by this analytic should be investigated and approved or denied. +references: +- https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/auditpol-set +drilldown_searches: +- name: View the detection results for - "$user$" and "$dest$" + search: '%original_detection_search% | search user = "$user$" dest = "$dest$"' + earliest_offset: $info_min_time$ + latest_offset: $info_max_time$ +- name: View risk events for the last 7 days for - "$user$" and "$dest$" + search: '| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$user$", + "$dest$") 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$ +rba: + message: An instance of $parent_process_name$ spawning $process_name$ with commandline $process$ was identified attempting to modify the audit policy security descriptor on endpoint $dest$ by user $user$. + risk_objects: + - field: user + type: user + score: 16 + - field: dest + type: system + score: 16 + threat_objects: + - field: process_name + type: process_name +tags: + analytic_story: + - Windows Audit Policy Tampering + asset_type: Endpoint + mitre_attack_id: + - T1562.002 + product: + - Splunk Enterprise + - Splunk Enterprise Security + - Splunk Cloud + security_domain: endpoint +tests: +- name: True Positive Test - Sysmon + attack_data: + - data: + https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1562.002/auditpol_tampering/auditpol_tampering_sysmon.log + source: XmlWinEventLog:Microsoft-Windows-Sysmon/Operational + sourcetype: XmlWinEventLog +- name: True Positive Test - Security + attack_data: + - data: + https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1562.002/auditpol_tampering/auditpol_tampering_security.log + source: XmlWinEventLog:Security + sourcetype: XmlWinEventLog diff --git a/detections/endpoint/windows_global_object_access_audit_list_cleared_via_auditpol.yml b/detections/endpoint/windows_global_object_access_audit_list_cleared_via_auditpol.yml new file mode 100644 index 0000000000..46c7c7e9f9 --- /dev/null +++ b/detections/endpoint/windows_global_object_access_audit_list_cleared_via_auditpol.yml @@ -0,0 +1,67 @@ +name: Windows Global Object Access Audit List Cleared Via Auditpol +id: 802a0930-0a4a-4451-bf6c-6366c6b6d9e7 +version: 1 +date: '2025-01-27' +author: Nasreddine Bencherchali, Splunk +status: production +type: TTP +description: The following analytic identifies the execution of `auditpol.exe` with the "/resourceSACL" flag, and either the "/clear" or "/remove" command-line arguments used to remove or clear the global object access audit policy. It leverages data from Endpoint Detection and Response (EDR) agents, focusing on process names and command-line executions. This activity can be significant as it indicates potential defense evasion by adversaries or Red Teams, aiming to limit data that can be leveraged for detections and audits. If confirmed malicious, this behavior could allow attackers to bypass defenses, and plan further attacks, potentially leading to full machine compromise or lateral movement. +data_source: +- Sysmon EventID 1 +- Windows Event Log Security 4688 +- CrowdStrike ProcessRollup2 +search: '| tstats `security_content_summariesonly` values(Processes.process) as process min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes where `process_auditpol` Processes.process="*/resourceSACL*" Processes.process IN ("*/clear*", "*/remove*") AND NOT Processes.process="*/?*" by Processes.dest Processes.user Processes.parent_process Processes.parent_process_name Processes.process_name Processes.original_file_name Processes.process Processes.process_id Processes.parent_process_id | `drop_dm_object_name(Processes)` | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)` | `windows_global_object_access_audit_list_cleared_via_auditpol_filter`' +how_to_implement: The detection is based on data that originates from Endpoint Detection and Response (EDR) agents. These agents are designed to provide security-related telemetry from the endpoints where the agent is installed. To implement this search, you must ingest logs that contain the process name, and process original file name. Additionally, you must ingest complete command-line executions. These logs must be processed using the appropriate Splunk Technology Add-ons that are specific to the EDR product. The logs must also be mapped to the `Processes` node of the `Endpoint` data model. Use the Splunk Common Information Model (CIM) to normalize the field names and speed up the data modeling process. +known_false_positives: False positives should be rare to non existent. Any activity detected by this analytic should be investigated and approved or denied. +references: +- https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/auditpol-resourcesacl +drilldown_searches: +- name: View the detection results for - "$user$" and "$dest$" + search: '%original_detection_search% | search user = "$user$" dest = "$dest$"' + earliest_offset: $info_min_time$ + latest_offset: $info_max_time$ +- name: View risk events for the last 7 days for - "$user$" and "$dest$" + search: '| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$user$", + "$dest$") 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$ +rba: + message: An instance of $parent_process_name$ spawning $process_name$ was identified attempting to clear the global object access audit policy on endpoint $dest$ by user $user$. + risk_objects: + - field: user + type: user + score: 16 + - field: dest + type: system + score: 16 + threat_objects: + - field: process_name + type: process_name +tags: + analytic_story: + - Windows Audit Policy Tampering + asset_type: Endpoint + mitre_attack_id: + - T1562.002 + product: + - Splunk Enterprise + - Splunk Enterprise Security + - Splunk Cloud + security_domain: endpoint +tests: +- name: True Positive Test - Sysmon + attack_data: + - data: + https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1562.002/auditpol_tampering/auditpol_tampering_sysmon.log + source: XmlWinEventLog:Microsoft-Windows-Sysmon/Operational + sourcetype: XmlWinEventLog +- name: True Positive Test - Security + attack_data: + - data: + https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1562.002/auditpol_tampering/auditpol_tampering_security.log + source: XmlWinEventLog:Security + sourcetype: XmlWinEventLog From 72b2403a462152ff95d68421a511e15ddd6477c1 Mon Sep 17 00:00:00 2001 From: Nasreddine Bencherchali Date: Wed, 29 Jan 2025 00:32:59 +0100 Subject: [PATCH 02/14] feat: add auditpol macro --- macros/process_auditpol.yml | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 macros/process_auditpol.yml diff --git a/macros/process_auditpol.yml b/macros/process_auditpol.yml new file mode 100644 index 0000000000..86065afc53 --- /dev/null +++ b/macros/process_auditpol.yml @@ -0,0 +1,3 @@ +definition: (Processes.process_name="auditpol.exe" OR Processes.original_file_name="AUDITPOL.EXE") +description: Matches the process with its original file name, data for this macro came from https://strontic.github.io/ +name: process_auditpol From 21e1b4925765bf51677d8365b9b1ae2e320fa2de Mon Sep 17 00:00:00 2001 From: Nasreddine Bencherchali Date: Wed, 29 Jan 2025 00:34:19 +0100 Subject: [PATCH 03/14] feat: add new analytic story and analytic --- ...omain_controller_audit_policy_disabled.yml | 6 +- ...indows_important_audit_policy_disabled.yml | 61 +++++++++++++++++++ ...portant_audit_policy_subcategory_guids.yml | 3 + stories/windows_audit_policy_tampering.yml | 24 ++++++++ 4 files changed, 91 insertions(+), 3 deletions(-) create mode 100644 detections/endpoint/windows_important_audit_policy_disabled.yml create mode 100644 macros/important_audit_policy_subcategory_guids.yml create mode 100644 stories/windows_audit_policy_tampering.yml diff --git a/detections/endpoint/windows_ad_domain_controller_audit_policy_disabled.yml b/detections/endpoint/windows_ad_domain_controller_audit_policy_disabled.yml index 58f2fc2bf5..b50f9f3601 100644 --- a/detections/endpoint/windows_ad_domain_controller_audit_policy_disabled.yml +++ b/detections/endpoint/windows_ad_domain_controller_audit_policy_disabled.yml @@ -1,7 +1,7 @@ name: Windows AD Domain Controller Audit Policy Disabled id: fc3ccef1-60a4-4239-bd66-b279511b4d14 -version: 4 -date: '2024-11-13' +version: 5 +date: '2025-01-28' author: Dean Luxton type: TTP status: production @@ -53,7 +53,7 @@ rba: threat_objects: [] tags: analytic_story: - - Sneaky Active Directory Persistence Tricks + - Windows Audit Policy Tampering asset_type: Endpoint mitre_attack_id: - T1562.001 diff --git a/detections/endpoint/windows_important_audit_policy_disabled.yml b/detections/endpoint/windows_important_audit_policy_disabled.yml new file mode 100644 index 0000000000..130b866aae --- /dev/null +++ b/detections/endpoint/windows_important_audit_policy_disabled.yml @@ -0,0 +1,61 @@ +name: Windows Important Audit Policy Disabled +id: 1bf500e5-1226-41d9-af5d-ed1f577929f2 +version: 1 +date: '2025-01-27' +author: Nasreddine Bencherchali, Splunk +type: TTP +status: production +data_source: +- Windows Event Log Security 4719 +description: The following analytic detects the disabling of important audit policies. It leverages EventCode 4719 from Windows Security Event Logs to identify changes where success or failure auditing is removed. This activity is significant as it suggests an attacker may have gained access to the domain controller and is attempting to evade detection by tampering with audit policies. If confirmed malicious, this could lead to severe consequences, including data theft, privilege escalation, and full network compromise. Immediate investigation is required to determine the source and intent of the change. +search: '`wineventlog_security` EventCode=4719 (AuditPolicyChanges IN ("%%8448","%%8450","%%8448, %%8450") OR Changes IN ("Failure removed","Success removed","Success removed, Failure removed")) `important_audit_policy_subcategory_guids` | replace "%%8448" with "Success removed", "%%8450" with "Failure removed", "%%8448, %%8450" with "Success removed, Failure removed" in AuditPolicyChanges | eval AuditPolicyChanges=coalesce(AuditPolicyChanges,Changes), SubcategoryGuid=coalesce(SubcategoryGuid,Subcategory_GUID) | rename ClientProcessId as process_id | stats min(_time) as _time values(host) as dest by AuditPolicyChanges SubcategoryGuid, process_id | lookup advanced_audit_policy_guids GUID as SubcategoryGuid OUTPUT Category SubCategory | `windows_important_audit_policy_disabled_filter`' +how_to_implement: To implement the following query, enable the audit policy sub category "Audit Audit Policy Change", and, ensure you are ingesting EventCode `4719` from your endpoints via the appropriate Splunk Add-on for Microsoft Windows. Update the macro definition with the an accurate list of Audit sub categories that you consider important for your environment. +known_false_positives: Unknown +references: +- https://learn.microsoft.com/en-us/windows/security/threat-protection/auditing/event-4719 +drilldown_searches: +- name: View the detection results for - "$dest$" + search: '%original_detection_search% | search dest = "$dest$"' + earliest_offset: $info_min_time$ + latest_offset: $info_max_time$ +- name: View risk events for the last 7 days for - "$dest$" + search: '| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$dest$") + 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$ +rba: + message: Important audit policy "$SubCategory$" of category "$Category$" was disabled on $dest$ + risk_objects: + - field: dest + type: system + score: 60 + threat_objects: [] +tags: + analytic_story: + - Windows Audit Policy Tampering + asset_type: Endpoint + mitre_attack_id: + - T1562.001 + product: + - Splunk Enterprise + - Splunk Enterprise Security + - Splunk Cloud + security_domain: endpoint + manual_test: This search uses a lookup provided by Enterprise Security and needs to be manually tested +tests: +- name: True Positive Test - Security 1 + attack_data: + - data: + https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1562.001/disable_gpo/windows-security-xml.log + source: XmlWinEventLog:Security + sourcetype: XmlWinEventLog +- name: True Positive Test - Security 2 + attack_data: + - data: + https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1562.002/auditpol_tampering/auditpol_tampering_security.log + source: XmlWinEventLog:Security + sourcetype: XmlWinEventLog diff --git a/macros/important_audit_policy_subcategory_guids.yml b/macros/important_audit_policy_subcategory_guids.yml new file mode 100644 index 0000000000..b829d01150 --- /dev/null +++ b/macros/important_audit_policy_subcategory_guids.yml @@ -0,0 +1,3 @@ +definition: (SubcategoryGuid IN ("{0CCE922B-69AE-11D9-BED3-505054503030}", "{0CCE9215-69AE-11D9-BED3-505054503030}", "{0CCE922F-69AE-11D9-BED3-505054503030}")) +description: This macro is a placeholder that contains a list of important audit policy sub categories. By default it only monitors the "Audit Audit Policy Change", "Audit Logon" and "Audit Process Creation" sub categories. Customer should modify this macro and add the GUIDs important to them. +name: important_audit_policy_subcategory_guids diff --git a/stories/windows_audit_policy_tampering.yml b/stories/windows_audit_policy_tampering.yml new file mode 100644 index 0000000000..62e0f4a8de --- /dev/null +++ b/stories/windows_audit_policy_tampering.yml @@ -0,0 +1,24 @@ +name: Windows Audit Policy Tampering +id: 29ed7ffa-df10-4e85-847f-bd417a8ca355 +version: 1 +date: '2025-01-28' +author: Nasreddine Bencherchali, Splunk +status: production +description: Adversaries often attempt to manipulate Windows audit policies to disable or suppress logging, allowing malicious activities to go undetected. This analytic story covers groups searches that are designed to monitor and detect suspicious actions involving `auditpol.exe` or other methods used to modify, clear, or remove audit policy configurations. +narrative: Windows audit policies play a critical role in ensuring that key system activities are logged for monitoring and forensic purposes. Attackers often target audit policies by modifying, clearing, or disabling them, typically using utilities like `auditpol.exe`, to avoid detection during their operations. +Monitoring for changes to audit policies is an industry-recognized best practice and helps uncover potential malicious activity. While legitimate administrators may occasionally modify audit policies, it is vital to track who performed the modifications, when they occurred, and the specific changes made. Unauthorized tampering with audit configurations may indicate an attempt to suppress evidence or disrupt security monitoring. +This Analytic Story provides a framework to detect suspicious activities involving audit policy manipulation. It includes analytics to identify the use of `auditpol.exe` with specific flags (e.g., `/set`, `/clear`) and other patterns of audit tampering. These detections are critical for investigating potential breaches and maintaining the integrity of security monitoring mechanisms. +references: +- https://www.microsoft.com/en-us/security/blog/2021/01/20/deep-dive-into-the-solorigate-second-stage-activation-from-sunburst-to-teardrop-and-raindrop/ +- https://www.cybereason.com/blog/research/prometei-botnet-exploiting-microsoft-exchange-vulnerabilities +- https://attack.mitre.org/techniques/T1562/002/ +- https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/auditpol-clear +- https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/auditpol-remove +tags: + category: + - Adversary Tactics + product: + - Splunk Enterprise + - Splunk Enterprise Security + - Splunk Cloud + usecase: Security Monitoring From 7b160eafefcfb50d48d421221ebe446204664873 Mon Sep 17 00:00:00 2001 From: Nasreddine Bencherchali Date: Wed, 29 Jan 2025 00:34:42 +0100 Subject: [PATCH 04/14] fix: deprecate 2b85aa3d-f5f6-4c2e-a081-a09f6e1c2e40 --- .../suspicious_event_log_service_behavior.yml | 6 +-- ...ows_event_logging_service_has_shutdown.yml | 49 +++++++++++++++++++ 2 files changed, 52 insertions(+), 3 deletions(-) rename detections/{endpoint => deprecated}/suspicious_event_log_service_behavior.yml (97%) create mode 100644 detections/endpoint/windows_event_logging_service_has_shutdown.yml diff --git a/detections/endpoint/suspicious_event_log_service_behavior.yml b/detections/deprecated/suspicious_event_log_service_behavior.yml similarity index 97% rename from detections/endpoint/suspicious_event_log_service_behavior.yml rename to detections/deprecated/suspicious_event_log_service_behavior.yml index bac4d7f013..b4e976e370 100644 --- a/detections/endpoint/suspicious_event_log_service_behavior.yml +++ b/detections/deprecated/suspicious_event_log_service_behavior.yml @@ -1,9 +1,9 @@ name: Suspicious Event Log Service Behavior id: 2b85aa3d-f5f6-4c2e-a081-a09f6e1c2e40 -version: 5 -date: '2024-11-13' +version: 6 +date: '2025-01-28' author: Mauricio Velazco, Splunk -status: production +status: deprecated type: Hunting description: The following analytic detects the shutdown of the Windows Event Log service using Windows Event ID 1100. This event is logged every time the service diff --git a/detections/endpoint/windows_event_logging_service_has_shutdown.yml b/detections/endpoint/windows_event_logging_service_has_shutdown.yml new file mode 100644 index 0000000000..58f369b084 --- /dev/null +++ b/detections/endpoint/windows_event_logging_service_has_shutdown.yml @@ -0,0 +1,49 @@ +name: Windows Event Logging Service Has Shutdown +id: d696f622-6b08-4336-b456-696cb5b43ba0 +version: 1 +date: '2025-01-28' +author: Mauricio Velazco, Splunk +status: production +type: Anomaly +description: The following analytic detects the shutdown of the Windows Event Log + service using Windows Event ID 1100. This event is logged every time the service + stops, including during normal system shutdowns. Monitoring this activity is crucial + as it can indicate attempts to cover tracks or disable logging. If confirmed malicious, + an attacker could hide their activities, making it difficult to trace their actions + and investigate further incidents. Analysts should verify if the shutdown was planned + and review other alerts and data sources for additional suspicious behavior. +data_source: +- Windows Event Log Security 1100 +search: (`wineventlog_security` EventCode=1100) | stats count min(_time) as firstTime + max(_time) as lastTime by dest name EventCode | `security_content_ctime(firstTime)` + | `security_content_ctime(lastTime)`| `suspicious_event_log_service_behavior_filter` +how_to_implement: To successfully implement this search, you need to be ingesting + Windows event logs from your hosts. In addition, the Splunk Windows TA is needed. +known_false_positives: It is possible the Event Logging service gets shut down due + to system errors or legitimately administration tasks. Investigate the cause of this issue and apply additional filters as needed. +references: +- https://docs.microsoft.com/en-us/windows/security/threat-protection/auditing/event-1100 +- https://www.ired.team/offensive-security/defense-evasion/disabling-windows-event-logs-by-suspending-eventlog-service-threads +- https://attack.mitre.org/techniques/T1070/001/ +- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1070.001/T1070.001.md +tags: + analytic_story: + - Windows Log Manipulation + - Ransomware + - Clop Ransomware + asset_type: Endpoint + mitre_attack_id: + - T1070 + - T1070.001 + product: + - Splunk Enterprise + - Splunk Enterprise Security + - Splunk Cloud + security_domain: endpoint +tests: +- name: True Positive Test + attack_data: + - data: + https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1070.001/suspicious_event_log_service_behavior/windows-xml.log + source: XmlWinEventLog:Security + sourcetype: XmlWinEventLog From c84d51b545fb76fbfd15418720f5a8bf874cd7ed Mon Sep 17 00:00:00 2001 From: Nasreddine Bencherchali Date: Wed, 29 Jan 2025 00:42:05 +0100 Subject: [PATCH 05/14] fix: update titles --- .../endpoint/windows_audit_policy_cleared_via_auditpol.yml | 2 +- .../endpoint/windows_audit_policy_disabled_via_auditpol.yml | 2 +- .../windows_audit_policy_excluded_category_via_auditpol.yml | 2 +- .../endpoint/windows_audit_policy_restored_via_auditpol.yml | 2 +- ..._audit_policy_security_descriptor_tampering_via_auditpol.yml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/detections/endpoint/windows_audit_policy_cleared_via_auditpol.yml b/detections/endpoint/windows_audit_policy_cleared_via_auditpol.yml index 5ab1d8ba55..3f2f66ca5b 100644 --- a/detections/endpoint/windows_audit_policy_cleared_via_auditpol.yml +++ b/detections/endpoint/windows_audit_policy_cleared_via_auditpol.yml @@ -1,4 +1,4 @@ -name: Windows Audit Policy Cleared Via Auditpol +name: Windows Audit Policy Cleared via Auditpol id: f067f7cf-f41b-4a60-985e-c23e268a13cb version: 1 date: '2025-01-27' diff --git a/detections/endpoint/windows_audit_policy_disabled_via_auditpol.yml b/detections/endpoint/windows_audit_policy_disabled_via_auditpol.yml index 5a7bb205d4..a70f401fc9 100644 --- a/detections/endpoint/windows_audit_policy_disabled_via_auditpol.yml +++ b/detections/endpoint/windows_audit_policy_disabled_via_auditpol.yml @@ -1,4 +1,4 @@ -name: Windows Audit Policy Disabled Via Auditpol +name: Windows Audit Policy Disabled via Auditpol id: 14e008e5-6723-4298-b0d4-e95b24e10c18 version: 1 date: '2025-01-27' diff --git a/detections/endpoint/windows_audit_policy_excluded_category_via_auditpol.yml b/detections/endpoint/windows_audit_policy_excluded_category_via_auditpol.yml index 37cb7228b8..84c8729c3a 100644 --- a/detections/endpoint/windows_audit_policy_excluded_category_via_auditpol.yml +++ b/detections/endpoint/windows_audit_policy_excluded_category_via_auditpol.yml @@ -1,4 +1,4 @@ -name: Windows Audit Policy Excluded Category Via Auditpol +name: Windows Audit Policy Excluded Category via Auditpol id: 083708d4-d763-4ba2-87ac-105b526de81a version: 1 date: '2025-01-27' diff --git a/detections/endpoint/windows_audit_policy_restored_via_auditpol.yml b/detections/endpoint/windows_audit_policy_restored_via_auditpol.yml index 9dfdace4dd..24601464a4 100644 --- a/detections/endpoint/windows_audit_policy_restored_via_auditpol.yml +++ b/detections/endpoint/windows_audit_policy_restored_via_auditpol.yml @@ -1,4 +1,4 @@ -name: Windows Audit Policy Restored Via Auditpol +name: Windows Audit Policy Restored via Auditpol id: d7d1795b-ea18-47e5-9ca6-2c330d052d21 version: 1 date: '2025-01-27' diff --git a/detections/endpoint/windows_audit_policy_security_descriptor_tampering_via_auditpol.yml b/detections/endpoint/windows_audit_policy_security_descriptor_tampering_via_auditpol.yml index 6cd2c6ffcc..b52e5e9c14 100644 --- a/detections/endpoint/windows_audit_policy_security_descriptor_tampering_via_auditpol.yml +++ b/detections/endpoint/windows_audit_policy_security_descriptor_tampering_via_auditpol.yml @@ -1,4 +1,4 @@ -name: Windows Global Object Access Audit List Cleared Via Auditpol +name: Windows Audit Policy Security Descriptor Tampering via Auditpol id: 5628e0b7-73dc-4f1b-b37a-6e68efc2225f version: 1 date: '2025-01-27' From 35eabf414ea81ca36e2c23f9bbb5b9a1dbb70e56 Mon Sep 17 00:00:00 2001 From: Nasreddine Bencherchali Date: Wed, 29 Jan 2025 00:48:57 +0100 Subject: [PATCH 06/14] Update windows_event_logging_service_has_shutdown.yml --- ...ows_event_logging_service_has_shutdown.yml | 20 +++++-------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/detections/endpoint/windows_event_logging_service_has_shutdown.yml b/detections/endpoint/windows_event_logging_service_has_shutdown.yml index 58f369b084..8770081092 100644 --- a/detections/endpoint/windows_event_logging_service_has_shutdown.yml +++ b/detections/endpoint/windows_event_logging_service_has_shutdown.yml @@ -4,23 +4,13 @@ version: 1 date: '2025-01-28' author: Mauricio Velazco, Splunk status: production -type: Anomaly -description: The following analytic detects the shutdown of the Windows Event Log - service using Windows Event ID 1100. This event is logged every time the service - stops, including during normal system shutdowns. Monitoring this activity is crucial - as it can indicate attempts to cover tracks or disable logging. If confirmed malicious, - an attacker could hide their activities, making it difficult to trace their actions - and investigate further incidents. Analysts should verify if the shutdown was planned - and review other alerts and data sources for additional suspicious behavior. +type: Hunting +description: The following analytic detects the shutdown of the Windows Event Log service by leveraging Windows Event ID 1100. This event is logged every time the service stops, including during normal system shutdowns. Monitoring this activity is crucial as it can indicate attempts to cover tracks or disable logging. If confirmed malicious, an attacker could hide their activities, making it difficult to trace their actions and investigate further incidents. Analysts should verify if the shutdown was planned and review other alerts and data sources for additional suspicious behavior. data_source: - Windows Event Log Security 1100 -search: (`wineventlog_security` EventCode=1100) | stats count min(_time) as firstTime - max(_time) as lastTime by dest name EventCode | `security_content_ctime(firstTime)` - | `security_content_ctime(lastTime)`| `suspicious_event_log_service_behavior_filter` -how_to_implement: To successfully implement this search, you need to be ingesting - Windows event logs from your hosts. In addition, the Splunk Windows TA is needed. -known_false_positives: It is possible the Event Logging service gets shut down due - to system errors or legitimately administration tasks. Investigate the cause of this issue and apply additional filters as needed. +search: (`wineventlog_security` EventCode=1100) | stats count min(_time) as firstTime max(_time) as lastTime by dest name EventCode | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)`| `suspicious_event_log_service_behavior_filter` +how_to_implement: To successfully implement this search, you need to be ingesting Windows event logs from your hosts. In addition, the Splunk Windows TA is needed. +known_false_positives: It is possible the Event Logging service gets shut down due to system errors or legitimate administration tasks. Investigate the cause of this issue and apply additional filters as needed. references: - https://docs.microsoft.com/en-us/windows/security/threat-protection/auditing/event-1100 - https://www.ired.team/offensive-security/defense-evasion/disabling-windows-event-logs-by-suspending-eventlog-service-threads From cb63a13867fbd5d73de545f3136b33690eec112d Mon Sep 17 00:00:00 2001 From: Nasreddine Bencherchali Date: Wed, 29 Jan 2025 01:03:47 +0100 Subject: [PATCH 07/14] Update windows_audit_policy_tampering.yml --- stories/windows_audit_policy_tampering.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/stories/windows_audit_policy_tampering.yml b/stories/windows_audit_policy_tampering.yml index 62e0f4a8de..bb9b6fde0f 100644 --- a/stories/windows_audit_policy_tampering.yml +++ b/stories/windows_audit_policy_tampering.yml @@ -5,9 +5,7 @@ date: '2025-01-28' author: Nasreddine Bencherchali, Splunk status: production description: Adversaries often attempt to manipulate Windows audit policies to disable or suppress logging, allowing malicious activities to go undetected. This analytic story covers groups searches that are designed to monitor and detect suspicious actions involving `auditpol.exe` or other methods used to modify, clear, or remove audit policy configurations. -narrative: Windows audit policies play a critical role in ensuring that key system activities are logged for monitoring and forensic purposes. Attackers often target audit policies by modifying, clearing, or disabling them, typically using utilities like `auditpol.exe`, to avoid detection during their operations. -Monitoring for changes to audit policies is an industry-recognized best practice and helps uncover potential malicious activity. While legitimate administrators may occasionally modify audit policies, it is vital to track who performed the modifications, when they occurred, and the specific changes made. Unauthorized tampering with audit configurations may indicate an attempt to suppress evidence or disrupt security monitoring. -This Analytic Story provides a framework to detect suspicious activities involving audit policy manipulation. It includes analytics to identify the use of `auditpol.exe` with specific flags (e.g., `/set`, `/clear`) and other patterns of audit tampering. These detections are critical for investigating potential breaches and maintaining the integrity of security monitoring mechanisms. +narrative: Windows audit policies play a critical role in ensuring that key system activities are logged for monitoring and forensic purposes. Attackers often target audit policies by modifying, clearing, or disabling them, typically using utilities like `auditpol.exe`, to avoid detection during their operations. Monitoring for changes to audit policies is an industry-recognized best practice and helps uncover potential malicious activity. While legitimate administrators may occasionally modify audit policies, it is vital to track who performed the modifications, when they occurred, and the specific changes made. Unauthorized tampering with audit configurations may indicate an attempt to suppress evidence or disrupt security monitoring. This Analytic Story provides a framework to detect suspicious activities involving audit policy manipulation. It includes analytics to identify the use of `auditpol.exe` with specific flags (e.g., `/set`, `/clear`) and other patterns of audit tampering. These detections are critical for investigating potential breaches and maintaining the integrity of security monitoring mechanisms. references: - https://www.microsoft.com/en-us/security/blog/2021/01/20/deep-dive-into-the-solorigate-second-stage-activation-from-sunburst-to-teardrop-and-raindrop/ - https://www.cybereason.com/blog/research/prometei-botnet-exploiting-microsoft-exchange-vulnerabilities From 653ea1b64813b20335a4ad6c7fbe8c140b87cfe0 Mon Sep 17 00:00:00 2001 From: Nasreddine Bencherchali Date: Wed, 29 Jan 2025 01:15:59 +0100 Subject: [PATCH 08/14] Update windows_event_logging_service_has_shutdown.yml --- .../endpoint/windows_event_logging_service_has_shutdown.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/detections/endpoint/windows_event_logging_service_has_shutdown.yml b/detections/endpoint/windows_event_logging_service_has_shutdown.yml index 8770081092..200fd0ab5a 100644 --- a/detections/endpoint/windows_event_logging_service_has_shutdown.yml +++ b/detections/endpoint/windows_event_logging_service_has_shutdown.yml @@ -8,7 +8,7 @@ type: Hunting description: The following analytic detects the shutdown of the Windows Event Log service by leveraging Windows Event ID 1100. This event is logged every time the service stops, including during normal system shutdowns. Monitoring this activity is crucial as it can indicate attempts to cover tracks or disable logging. If confirmed malicious, an attacker could hide their activities, making it difficult to trace their actions and investigate further incidents. Analysts should verify if the shutdown was planned and review other alerts and data sources for additional suspicious behavior. data_source: - Windows Event Log Security 1100 -search: (`wineventlog_security` EventCode=1100) | stats count min(_time) as firstTime max(_time) as lastTime by dest name EventCode | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)`| `suspicious_event_log_service_behavior_filter` +search: (`wineventlog_security` EventCode=1100) | stats count min(_time) as firstTime max(_time) as lastTime by dest name EventCode | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)`| `windows_event_logging_service_has_shutdown_filter` how_to_implement: To successfully implement this search, you need to be ingesting Windows event logs from your hosts. In addition, the Splunk Windows TA is needed. known_false_positives: It is possible the Event Logging service gets shut down due to system errors or legitimate administration tasks. Investigate the cause of this issue and apply additional filters as needed. references: From 7a6d81942a727cb474bd92c6061b97854a64717d Mon Sep 17 00:00:00 2001 From: Nasreddine Bencherchali Date: Wed, 29 Jan 2025 11:49:47 +0100 Subject: [PATCH 09/14] fix: remove unnecessary tests --- .../endpoint/windows_audit_policy_disabled_via_auditpol.yml | 6 ------ .../endpoint/windows_audit_policy_restored_via_auditpol.yml | 6 ------ ...it_policy_security_descriptor_tampering_via_auditpol.yml | 6 ------ 3 files changed, 18 deletions(-) diff --git a/detections/endpoint/windows_audit_policy_disabled_via_auditpol.yml b/detections/endpoint/windows_audit_policy_disabled_via_auditpol.yml index a70f401fc9..76cf94e4d2 100644 --- a/detections/endpoint/windows_audit_policy_disabled_via_auditpol.yml +++ b/detections/endpoint/windows_audit_policy_disabled_via_auditpol.yml @@ -62,9 +62,3 @@ tests: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1562.002/auditpol_tampering/auditpol_tampering_sysmon.log source: XmlWinEventLog:Microsoft-Windows-Sysmon/Operational sourcetype: XmlWinEventLog -- name: True Positive Test - Security - attack_data: - - data: - https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1562.002/auditpol_tampering/auditpol_tampering_security.log - source: XmlWinEventLog:Security - sourcetype: XmlWinEventLog diff --git a/detections/endpoint/windows_audit_policy_restored_via_auditpol.yml b/detections/endpoint/windows_audit_policy_restored_via_auditpol.yml index 24601464a4..68e0e4b49a 100644 --- a/detections/endpoint/windows_audit_policy_restored_via_auditpol.yml +++ b/detections/endpoint/windows_audit_policy_restored_via_auditpol.yml @@ -62,9 +62,3 @@ tests: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1562.002/auditpol_tampering/auditpol_tampering_sysmon.log source: XmlWinEventLog:Microsoft-Windows-Sysmon/Operational sourcetype: XmlWinEventLog -- name: True Positive Test - Security - attack_data: - - data: - https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1562.002/auditpol_tampering/auditpol_tampering_security.log - source: XmlWinEventLog:Security - sourcetype: XmlWinEventLog diff --git a/detections/endpoint/windows_audit_policy_security_descriptor_tampering_via_auditpol.yml b/detections/endpoint/windows_audit_policy_security_descriptor_tampering_via_auditpol.yml index b52e5e9c14..463f698b72 100644 --- a/detections/endpoint/windows_audit_policy_security_descriptor_tampering_via_auditpol.yml +++ b/detections/endpoint/windows_audit_policy_security_descriptor_tampering_via_auditpol.yml @@ -59,9 +59,3 @@ tests: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1562.002/auditpol_tampering/auditpol_tampering_sysmon.log source: XmlWinEventLog:Microsoft-Windows-Sysmon/Operational sourcetype: XmlWinEventLog -- name: True Positive Test - Security - attack_data: - - data: - https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1562.002/auditpol_tampering/auditpol_tampering_security.log - source: XmlWinEventLog:Security - sourcetype: XmlWinEventLog From 7b8428a66ac0397bfb11636c289e03f43803d8c4 Mon Sep 17 00:00:00 2001 From: Nasreddine Bencherchali Date: Wed, 29 Jan 2025 15:28:45 +0100 Subject: [PATCH 10/14] feat: add 2 additional analytics related to auditing option modification --- ..._auditing_option_disabled_via_auditpol.yml | 62 +++++++++++++++++++ ...icy_auditing_option_modified__registry.yml | 59 ++++++++++++++++++ 2 files changed, 121 insertions(+) create mode 100644 detections/endpoint/windows_audit_policy_auditing_option_disabled_via_auditpol.yml create mode 100644 detections/endpoint/windows_audit_policy_auditing_option_modified__registry.yml diff --git a/detections/endpoint/windows_audit_policy_auditing_option_disabled_via_auditpol.yml b/detections/endpoint/windows_audit_policy_auditing_option_disabled_via_auditpol.yml new file mode 100644 index 0000000000..afa275552e --- /dev/null +++ b/detections/endpoint/windows_audit_policy_auditing_option_disabled_via_auditpol.yml @@ -0,0 +1,62 @@ +name: Windows Audit Policy Auditing Option Disabled via Auditpol +id: 663a7a50-b752-4c84-975b-8325ca3f6f9e +version: 1 +date: '2025-01-27' +author: Nasreddine Bencherchali, Splunk +status: production +type: TTP +description: The following analytic identifies the execution of `auditpol.exe` with the "/set", "/option" and "/value:disable" command-line arguments used to disable specific auditing options of the audit policy. It leverages data from Endpoint Detection and Response (EDR) agents, focusing on process names and command-line executions. This activity can be significant as it indicates potential defense evasion by adversaries or Red Teams, aiming to limit data that can be leveraged for detections and audits. If confirmed malicious, this behavior could allow attackers to bypass defenses, and plan further attacks, potentially leading to full machine compromise or lateral movement. +data_source: +- Sysmon EventID 1 +- Windows Event Log Security 4688 +- CrowdStrike ProcessRollup2 +search: '| tstats `security_content_summariesonly` values(Processes.process) as process min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes where `process_auditpol` Processes.process="*/set*" Processes.process="*/option:*" Processes.process="*/value:disable*" Processes.process IN ("*FullPrivilegeAuditing*", "*AuditBaseObjects*", "*AuditBaseDirectories*") by Processes.dest Processes.user Processes.parent_process Processes.parent_process_name Processes.process_name Processes.original_file_name Processes.process Processes.process_id Processes.parent_process_id | `drop_dm_object_name(Processes)` | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)` | `windows_audit_policy_auditing_option_disabled_via_auditpol_filter`' +how_to_implement: The detection is based on data that originates from Endpoint Detection and Response (EDR) agents. These agents are designed to provide security-related telemetry from the endpoints where the agent is installed. To implement this search, you must ingest logs that contain the process name, and process original file name. Additionally, you must ingest complete command-line executions. These logs must be processed using the appropriate Splunk Technology Add-ons that are specific to the EDR product. The logs must also be mapped to the `Processes` node of the `Endpoint` data model. Use the Splunk Common Information Model (CIM) to normalize the field names and speed up the data modeling process. +known_false_positives: None identified. Attempts to disable logging should be identified and understood. +references: +- https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-gpac/262a2bed-93d4-4c04-abec-cf06e9ec72fd +- https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/auditpol-set +drilldown_searches: +- name: View the detection results for - "$user$" and "$dest$" + search: '%original_detection_search% | search user = "$user$" dest = "$dest$"' + earliest_offset: $info_min_time$ + latest_offset: $info_max_time$ +- name: View risk events for the last 7 days for - "$user$" and "$dest$" + search: '| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$user$", + "$dest$") 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$ +rba: + message: An instance of $parent_process_name$ spawning $process_name$ was identified attempting to disable an audit policy auditing option on endpoint $dest$ by user $user$. + risk_objects: + - field: user + type: user + score: 60 + - field: dest + type: system + score: 60 + threat_objects: + - field: process_name + type: process_name +tags: + analytic_story: + - Windows Audit Policy Tampering + asset_type: Endpoint + mitre_attack_id: + - T1562.002 + product: + - Splunk Enterprise + - Splunk Enterprise Security + - Splunk Cloud + security_domain: endpoint +tests: +- name: True Positive Test - Sysmon + attack_data: + - data: + https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1562.002/auditpol_tampering/auditpol_tampering_sysmon.log + source: XmlWinEventLog:Microsoft-Windows-Sysmon/Operational + sourcetype: XmlWinEventLog diff --git a/detections/endpoint/windows_audit_policy_auditing_option_modified__registry.yml b/detections/endpoint/windows_audit_policy_auditing_option_modified__registry.yml new file mode 100644 index 0000000000..92514f2d95 --- /dev/null +++ b/detections/endpoint/windows_audit_policy_auditing_option_modified__registry.yml @@ -0,0 +1,59 @@ +name: Windows Audit Policy Auditing Option Modified - Registry +id: 27914692-9c62-44ea-9129-ceb429b61bd0 +version: 1 +date: '2025-01-27' +author: Nasreddine Bencherchali, Splunk +status: production +type: Anomaly +description: The following analytic detects potentially suspicious modifications to the Audit Policy auditing options registry values. It leverages data from the Endpoint.Registry data model, focusing on changes to one of the following auditing option values "CrashOnAuditFail", "FullPrivilegeAuditing", "AuditBaseObjects" and "AuditBaseDirectories" within the "HKLM\\System\\CurrentControlSet\\Control\\Lsa\\" registry key. This activity is significant as it could be a sign of a threat actor trying to tamper with the audit policy configuration, and disabling SACLs configuration. If confirmed malicious, this behavior could allow attackers to bypass defenses, and plan further attacks, potentially leading to full machine compromise or lateral movement. +data_source: +- Sysmon EventID 13 +search: '| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time) as lastTime FROM datamodel=Endpoint.Registry WHERE Registry.registry_key_name="*\\Control\\Lsa" Registry.registry_value_name IN ("CrashOnAuditFail", "FullPrivilegeAuditing", "AuditBaseObjects", "AuditBaseDirectories") BY Registry.registry_path Registry.registry_key_name Registry.registry_value_name Registry.registry_value_data Registry.process_guid Registry.dest Registry.user | `drop_dm_object_name(Registry)` | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)` | `windows_audit_policy_auditing_option_modified__registry_filter`' +how_to_implement: To successfully implement this search, you need to be ingesting logs with the registry value name, registry path, and registry value data from your endpoints. If you are using Sysmon, you must have at least version 2.0 of the official Sysmon TA. https://splunkbase.splunk.com/app/5709 +known_false_positives: Active setup installer may add or modify this registry. +references: +- https://learn.microsoft.com/en-us/openspecs/windows_protocols/ms-gpac/262a2bed-93d4-4c04-abec-cf06e9ec72fd +- https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/auditpol-set +drilldown_searches: +- name: View the detection results for - "$dest$" and "$user$" + search: '%original_detection_search% | search dest = "$dest$" user = "$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)`' + earliest_offset: $info_min_time$ + latest_offset: $info_max_time$ +rba: + message: The auditing option $registry_value_name$ from the configured Audit Policy was modified on $dest$. + risk_objects: + - field: dest + type: system + score: 64 + - field: user + type: user + score: 64 + threat_objects: [] +tags: + analytic_story: + - Windows Audit Policy Tampering + asset_type: Endpoint + mitre_attack_id: + - T1547.014 + - T1547 + product: + - Splunk Enterprise + - Splunk Enterprise Security + - Splunk Cloud + security_domain: endpoint +tests: +- name: True Positive Test - Sysmon + attack_data: + - data: + https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1562.002/auditpol_tampering/auditpol_tampering_sysmon.log + source: XmlWinEventLog:Microsoft-Windows-Sysmon/Operational + sourcetype: XmlWinEventLog From a47e5af14f22194566edd810cd84aebbd5f502b1 Mon Sep 17 00:00:00 2001 From: Nasreddine Bencherchali Date: Wed, 29 Jan 2025 15:31:45 +0100 Subject: [PATCH 11/14] Update windows_audit_policy_auditing_option_modified__registry.yml --- .../windows_audit_policy_auditing_option_modified__registry.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/detections/endpoint/windows_audit_policy_auditing_option_modified__registry.yml b/detections/endpoint/windows_audit_policy_auditing_option_modified__registry.yml index 92514f2d95..456e398a6b 100644 --- a/detections/endpoint/windows_audit_policy_auditing_option_modified__registry.yml +++ b/detections/endpoint/windows_audit_policy_auditing_option_modified__registry.yml @@ -8,7 +8,7 @@ type: Anomaly description: The following analytic detects potentially suspicious modifications to the Audit Policy auditing options registry values. It leverages data from the Endpoint.Registry data model, focusing on changes to one of the following auditing option values "CrashOnAuditFail", "FullPrivilegeAuditing", "AuditBaseObjects" and "AuditBaseDirectories" within the "HKLM\\System\\CurrentControlSet\\Control\\Lsa\\" registry key. This activity is significant as it could be a sign of a threat actor trying to tamper with the audit policy configuration, and disabling SACLs configuration. If confirmed malicious, this behavior could allow attackers to bypass defenses, and plan further attacks, potentially leading to full machine compromise or lateral movement. data_source: - Sysmon EventID 13 -search: '| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time) as lastTime FROM datamodel=Endpoint.Registry WHERE Registry.registry_key_name="*\\Control\\Lsa" Registry.registry_value_name IN ("CrashOnAuditFail", "FullPrivilegeAuditing", "AuditBaseObjects", "AuditBaseDirectories") BY Registry.registry_path Registry.registry_key_name Registry.registry_value_name Registry.registry_value_data Registry.process_guid Registry.dest Registry.user | `drop_dm_object_name(Registry)` | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)` | `windows_audit_policy_auditing_option_modified__registry_filter`' +search: '| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time) as lastTime FROM datamodel=Endpoint.Registry WHERE Registry.registry_key_name="*\\Control\\Lsa" Registry.registry_value_name IN ("CrashOnAuditFail", "FullPrivilegeAuditing", "AuditBaseObjects", "AuditBaseDirectories") BY Registry.registry_path Registry.registry_key_name Registry.registry_value_name Registry.registry_value_data Registry.process_guid Registry.dest Registry.user | `drop_dm_object_name(Registry)` | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)` | `windows_audit_policy_auditing_option_modified___registry_filter`' how_to_implement: To successfully implement this search, you need to be ingesting logs with the registry value name, registry path, and registry value data from your endpoints. If you are using Sysmon, you must have at least version 2.0 of the official Sysmon TA. https://splunkbase.splunk.com/app/5709 known_false_positives: Active setup installer may add or modify this registry. references: From fd0fa2a639b8c4567f0c453faa25c707a4605c30 Mon Sep 17 00:00:00 2001 From: Nasreddine Bencherchali Date: Wed, 29 Jan 2025 15:33:30 +0100 Subject: [PATCH 12/14] fix: rename analytic to comply with tests --- ... windows_audit_policy_auditing_option_modified___registry.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename detections/endpoint/{windows_audit_policy_auditing_option_modified__registry.yml => windows_audit_policy_auditing_option_modified___registry.yml} (100%) diff --git a/detections/endpoint/windows_audit_policy_auditing_option_modified__registry.yml b/detections/endpoint/windows_audit_policy_auditing_option_modified___registry.yml similarity index 100% rename from detections/endpoint/windows_audit_policy_auditing_option_modified__registry.yml rename to detections/endpoint/windows_audit_policy_auditing_option_modified___registry.yml From 0abc9918bf152140200b3687a8b86f857853b640 Mon Sep 17 00:00:00 2001 From: Nasreddine Bencherchali Date: Wed, 29 Jan 2025 16:36:24 +0100 Subject: [PATCH 13/14] Create windows_audit_policy_disabled_via_legacy_auditpol.yml --- ...it_policy_disabled_via_legacy_auditpol.yml | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 detections/endpoint/windows_audit_policy_disabled_via_legacy_auditpol.yml diff --git a/detections/endpoint/windows_audit_policy_disabled_via_legacy_auditpol.yml b/detections/endpoint/windows_audit_policy_disabled_via_legacy_auditpol.yml new file mode 100644 index 0000000000..0f18b43035 --- /dev/null +++ b/detections/endpoint/windows_audit_policy_disabled_via_legacy_auditpol.yml @@ -0,0 +1,64 @@ +name: Windows Audit Policy Disabled via Legacy Auditpol +id: d2cef287-c2b7-4496-a609-7a548c1e27f9 +version: 1 +date: '2025-01-27' +author: Nasreddine Bencherchali, Splunk +status: production +type: Anomaly +description: The following analytic identifies the execution of the legacy `auditpol.exe` included with the Windows 2000 Resource Kit Tools, with the "/disable" command-line argument or one of the allowed category flags and the "none" option, in order to disable a specific logging category from the audit policy. It leverages data from Endpoint Detection and Response (EDR) agents, focusing on process names and command-line executions. This activity can be significant as it indicates potential defense evasion by adversaries or Red Teams, aiming to limit data that can be leveraged for detections and audits. If confirmed malicious, this behavior could allow attackers to bypass defenses, and plan further attacks, potentially leading to full machine compromise or lateral movement. +data_source: +- Sysmon EventID 1 +- Windows Event Log Security 4688 +- CrowdStrike ProcessRollup2 +search: '| tstats `security_content_summariesonly` values(Processes.process) as process min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes where (`process_auditpol` Processes.process="*/disable") OR Processes.process IN ("*/system:none*", "*/logon:none*", "*/object:none*", "*/privilege:none*", "*/process:none*", "*/policy:none*", "*/sam:none*") by Processes.dest Processes.user Processes.parent_process Processes.parent_process_name Processes.process_name Processes.original_file_name Processes.process Processes.process_id Processes.parent_process_id | `drop_dm_object_name(Processes)` | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)` | `windows_audit_policy_disabled_via_legacy_auditpol_filter`' +how_to_implement: The detection is based on data that originates from Endpoint Detection and Response (EDR) agents. These agents are designed to provide security-related telemetry from the endpoints where the agent is installed. To implement this search, you must ingest logs that contain the process name, and process original file name. Additionally, you must ingest complete command-line executions. These logs must be processed using the appropriate Splunk Technology Add-ons that are specific to the EDR product. The logs must also be mapped to the `Processes` node of the `Endpoint` data model. Use the Splunk Common Information Model (CIM) to normalize the field names and speed up the data modeling process. +known_false_positives: False positives should be rare, investigate the activity, and apply additional filters when necessary. +references: +- https://www.microsoft.com/en-us/security/blog/2021/01/20/deep-dive-into-the-solorigate-second-stage-activation-from-sunburst-to-teardrop-and-raindrop/ +- https://www.cybereason.com/blog/research/prometei-botnet-exploiting-microsoft-exchange-vulnerabilities +- https://attack.mitre.org/techniques/T1562/002/ +- https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/auditpol-set +drilldown_searches: +- name: View the detection results for - "$user$" and "$dest$" + search: '%original_detection_search% | search user = "$user$" dest = "$dest$"' + earliest_offset: $info_min_time$ + latest_offset: $info_max_time$ +- name: View risk events for the last 7 days for - "$user$" and "$dest$" + search: '| from datamodel Risk.All_Risk | search normalized_risk_object IN ("$user$", + "$dest$") 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$ +rba: + message: An instance of $parent_process_name$ spawning $process_name$ with CommandLine $process$ was identified attempting to disable and audit policy category/sub-category on $dest$ by user $user$. + risk_objects: + - field: user + type: user + score: 25 + - field: dest + type: system + score: 25 + threat_objects: + - field: process_name + type: process_name +tags: + analytic_story: + - Windows Audit Policy Tampering + asset_type: Endpoint + mitre_attack_id: + - T1562.002 + product: + - Splunk Enterprise + - Splunk Enterprise Security + - Splunk Cloud + security_domain: endpoint +tests: +- name: True Positive Test - Sysmon + attack_data: + - data: + https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1562.002/auditpol_tampering/auditpol_tampering_sysmon.log + source: XmlWinEventLog:Microsoft-Windows-Sysmon/Operational + sourcetype: XmlWinEventLog From e62c67c41803d8817c816325014294f073fc4a07 Mon Sep 17 00:00:00 2001 From: Bhavin Patel Date: Wed, 5 Feb 2025 14:16:15 -0800 Subject: [PATCH 14/14] Update suspicious_event_log_service_behavior.yml --- detections/deprecated/suspicious_event_log_service_behavior.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/detections/deprecated/suspicious_event_log_service_behavior.yml b/detections/deprecated/suspicious_event_log_service_behavior.yml index b4e976e370..df0db7774c 100644 --- a/detections/deprecated/suspicious_event_log_service_behavior.yml +++ b/detections/deprecated/suspicious_event_log_service_behavior.yml @@ -5,7 +5,7 @@ date: '2025-01-28' author: Mauricio Velazco, Splunk status: deprecated type: Hunting -description: The following analytic detects the shutdown of the Windows Event Log +description: This search has been deprecated in favour of Windows Event Logging Service Has Shutdown . The following analytic detects the shutdown of the Windows Event Log service using Windows Event ID 1100. This event is logged every time the service stops, including during normal system shutdowns. Monitoring this activity is crucial as it can indicate attempts to cover tracks or disable logging. If confirmed malicious,