From 990d09e2aa50ea86454f232aeba3a9c912fb55a1 Mon Sep 17 00:00:00 2001 From: zake <139054590+zake1god@users.noreply.github.com> Date: Thu, 2 Jan 2025 21:04:37 +0700 Subject: [PATCH 01/24] Add detection suspicious api / url from telegram User who's using telegram if got phishing/suspicious api/ or suspicious url will detected --- ...ram_detected_access_suspicious_api_url.yml | 100 ++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 detections/endpoint/telegram_detected_access_suspicious_api_url.yml diff --git a/detections/endpoint/telegram_detected_access_suspicious_api_url.yml b/detections/endpoint/telegram_detected_access_suspicious_api_url.yml new file mode 100644 index 0000000000..6dfdb51d76 --- /dev/null +++ b/detections/endpoint/telegram_detected_access_suspicious_api_url.yml @@ -0,0 +1,100 @@ +data_source: +- Windows Security 4688 +name: Telegram Detected Access Suspicious API/URL +id: 6e106492-561f-4f0c-919c-6560861e27d3 +version: 1 +date: '2025-01-02' +author: Zaki Zarkasih Al Mustafa +type: TTP +status: production +description: Detects suspicious process activity related to Telegram API +search: index=windows (sourcetype=Wineventlog:Security OR source=Wineventlog:Security) + AND ParentProcessName=*Telegram* AND CommandLine=*api.telegram* | eval utc_time=strptime(TimeCreated, + "%Y-%m-%dT%H:%M:%S.%6NZ") | eval Time_Created=strftime(utc_time + 25200, "%Y-%m-%d + %H:%M:%S") | rename Time_Created as "Time Created", host as Host, src_user as User + | table "Time Created", Host, User, EventID, ParentProcessName, CommandLine, NewProcessName + | `telegram_detected_access_suspicious_api_url_filter` +macros: + - telegram_detected_access_suspicious_api_url_filter +lookups: [] +how_to_implement: | + Ensure the relevant data source (`Wineventlog:Security`) is ingested into Splunk. + Configure the macro `telegram_detected_access_suspicious_api_url_filter` to filter false positives or noisy data. + Deploy this detection rule in Splunk Enterprise Security or Splunk Cloud. + +known_false_positives: | + Non-malicious use of Telegram's API by legitimate applications or processes may trigger this detection. + Automated scripts or tools using Telegram for notifications or integrations might also appear as suspicious. + Developers testing Telegram API functionality in controlled environments. + +drilldown_searches: + - name: Original Detection + description: Original detection search results + search: "%original_detection_search%" + earliest_offset: -24h + latest_offset: now + + - name: Investigate Parent Process + description: | + This drilldown searches for other processes spawned by the same parent process + to identify potential patterns or related activities. + search: | + index=windows (sourcetype=Wineventlog:Security OR source=Wineventlog:Security) + AND ParentProcessName="$ParentProcessName$" + | table _time, ParentProcessName, NewProcessName, CommandLine + earliest_offset: -24h + latest_offset: now + + - name: Investigate User Activity + description: | + This drilldown searches for all activities performed by the same user in the + Windows Event Logs to provide additional context. + search: | + index=windows (sourcetype=Wineventlog:Security OR source=Wineventlog:Security) + AND src_user="$src_user$" + | table _time, src_user, EventID, host, CommandLine + earliest_offset: -24h + latest_offset: now + +references: +- https://securelist.com/telegram-phishing-services/109383/ +tags: + analytic_story: + - XMRig + asset_type: Endpoint + confidence: 85 + impact: 70 + message: Detects suspicious access to Telegram API for potential misuse or malicious activity. + mitre_attack_id: + - T1059.001 + - T1059.003 + - T1003.002 + - T1105 + - T1566 + observable: + - name: CommandLine + type: Process Name + role: + - Attacker + - name: Host + type: Hostname + role: + - Victim + product: + - Splunk Enterprise + - Splunk Enterprise Security + - Splunk Cloud + required_fields: + - index + - sourcetype + - ParentProcessName + - CommandLine + risk_score: 59.5 + security_domain: endpoint + cve: [] +tests: +- name: True Positive Test + attack_data: + - data: https://github.com/splunk/contentctl/wiki + sourcetype: Wineventlog:Security + source: Wineventlog \ No newline at end of file From 5f473664d56de27d1371ad0ea2ef54b294a98c2d Mon Sep 17 00:00:00 2001 From: zake <139054590+zake1god@users.noreply.github.com> Date: Wed, 8 Jan 2025 03:10:08 +0700 Subject: [PATCH 02/24] Update telegram_detected_access_suspicious_api_url.yml fix drilldown and change index to macros `wineventlog_security` --- ...ram_detected_access_suspicious_api_url.yml | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/detections/endpoint/telegram_detected_access_suspicious_api_url.yml b/detections/endpoint/telegram_detected_access_suspicious_api_url.yml index 6dfdb51d76..13cda2521d 100644 --- a/detections/endpoint/telegram_detected_access_suspicious_api_url.yml +++ b/detections/endpoint/telegram_detected_access_suspicious_api_url.yml @@ -8,7 +8,7 @@ author: Zaki Zarkasih Al Mustafa type: TTP status: production description: Detects suspicious process activity related to Telegram API -search: index=windows (sourcetype=Wineventlog:Security OR source=Wineventlog:Security) +search: `wineventlog_security` AND ParentProcessName=*Telegram* AND CommandLine=*api.telegram* | eval utc_time=strptime(TimeCreated, "%Y-%m-%dT%H:%M:%S.%6NZ") | eval Time_Created=strftime(utc_time + 25200, "%Y-%m-%d %H:%M:%S") | rename Time_Created as "Time Created", host as Host, src_user as User @@ -28,33 +28,27 @@ known_false_positives: | Developers testing Telegram API functionality in controlled environments. drilldown_searches: - - name: Original Detection - description: Original detection search results - search: "%original_detection_search%" - earliest_offset: -24h - latest_offset: now - - name: Investigate Parent Process description: | This drilldown searches for other processes spawned by the same parent process to identify potential patterns or related activities. search: | - index=windows (sourcetype=Wineventlog:Security OR source=Wineventlog:Security) + `wineventlog_security` AND ParentProcessName="$ParentProcessName$" | table _time, ParentProcessName, NewProcessName, CommandLine - earliest_offset: -24h - latest_offset: now + earliest_offset: $info_min_time$ + latest_offset: $info_max_time$ - name: Investigate User Activity description: | This drilldown searches for all activities performed by the same user in the Windows Event Logs to provide additional context. search: | - index=windows (sourcetype=Wineventlog:Security OR source=Wineventlog:Security) + `wineventlog_security` AND src_user="$src_user$" | table _time, src_user, EventID, host, CommandLine - earliest_offset: -24h - latest_offset: now + earliest_offset: $info_min_time$ + latest_offset: $info_max_time$ references: - https://securelist.com/telegram-phishing-services/109383/ @@ -97,4 +91,4 @@ tests: attack_data: - data: https://github.com/splunk/contentctl/wiki sourcetype: Wineventlog:Security - source: Wineventlog \ No newline at end of file + source: Wineventlog From 602f4da9782fcd6b3b0eeadc1ca71c6ca03c1d6e Mon Sep 17 00:00:00 2001 From: zake <139054590+zake1god@users.noreply.github.com> Date: Wed, 8 Jan 2025 03:11:09 +0700 Subject: [PATCH 03/24] Update telegram_detected_access_suspicious_api_url.yml remove lookups --- .../endpoint/telegram_detected_access_suspicious_api_url.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/detections/endpoint/telegram_detected_access_suspicious_api_url.yml b/detections/endpoint/telegram_detected_access_suspicious_api_url.yml index 13cda2521d..89274fdb05 100644 --- a/detections/endpoint/telegram_detected_access_suspicious_api_url.yml +++ b/detections/endpoint/telegram_detected_access_suspicious_api_url.yml @@ -16,7 +16,6 @@ search: `wineventlog_security` | `telegram_detected_access_suspicious_api_url_filter` macros: - telegram_detected_access_suspicious_api_url_filter -lookups: [] how_to_implement: | Ensure the relevant data source (`Wineventlog:Security`) is ingested into Splunk. Configure the macro `telegram_detected_access_suspicious_api_url_filter` to filter false positives or noisy data. From 4ef0485a33404040831bcfa9b91e6d78deb63780 Mon Sep 17 00:00:00 2001 From: zake <139054590+zake1god@users.noreply.github.com> Date: Wed, 8 Jan 2025 03:13:50 +0700 Subject: [PATCH 04/24] Update telegram_detected_access_suspicious_api_url.yml declare macros wineventlog_security --- .../endpoint/telegram_detected_access_suspicious_api_url.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/detections/endpoint/telegram_detected_access_suspicious_api_url.yml b/detections/endpoint/telegram_detected_access_suspicious_api_url.yml index 89274fdb05..9d80eb7fec 100644 --- a/detections/endpoint/telegram_detected_access_suspicious_api_url.yml +++ b/detections/endpoint/telegram_detected_access_suspicious_api_url.yml @@ -16,6 +16,7 @@ search: `wineventlog_security` | `telegram_detected_access_suspicious_api_url_filter` macros: - telegram_detected_access_suspicious_api_url_filter + - wineventlog_security how_to_implement: | Ensure the relevant data source (`Wineventlog:Security`) is ingested into Splunk. Configure the macro `telegram_detected_access_suspicious_api_url_filter` to filter false positives or noisy data. From b039994bae800a4d60105909c67cbb13893fc8c6 Mon Sep 17 00:00:00 2001 From: zake <139054590+zake1god@users.noreply.github.com> Date: Wed, 8 Jan 2025 03:18:55 +0700 Subject: [PATCH 05/24] Update telegram_detected_access_suspicious_api_url.yml add | in the first search --- .../telegram_detected_access_suspicious_api_url.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/detections/endpoint/telegram_detected_access_suspicious_api_url.yml b/detections/endpoint/telegram_detected_access_suspicious_api_url.yml index 9d80eb7fec..230aa18177 100644 --- a/detections/endpoint/telegram_detected_access_suspicious_api_url.yml +++ b/detections/endpoint/telegram_detected_access_suspicious_api_url.yml @@ -8,7 +8,7 @@ author: Zaki Zarkasih Al Mustafa type: TTP status: production description: Detects suspicious process activity related to Telegram API -search: `wineventlog_security` +search: | `wineventlog_security` AND ParentProcessName=*Telegram* AND CommandLine=*api.telegram* | eval utc_time=strptime(TimeCreated, "%Y-%m-%dT%H:%M:%S.%6NZ") | eval Time_Created=strftime(utc_time + 25200, "%Y-%m-%d %H:%M:%S") | rename Time_Created as "Time Created", host as Host, src_user as User @@ -33,7 +33,7 @@ drilldown_searches: This drilldown searches for other processes spawned by the same parent process to identify potential patterns or related activities. search: | - `wineventlog_security` + `` AND ParentProcessName="$ParentProcessName$" | table _time, ParentProcessName, NewProcessName, CommandLine earliest_offset: $info_min_time$ @@ -44,7 +44,7 @@ drilldown_searches: This drilldown searches for all activities performed by the same user in the Windows Event Logs to provide additional context. search: | - `wineventlog_security` + `` AND src_user="$src_user$" | table _time, src_user, EventID, host, CommandLine earliest_offset: $info_min_time$ From 83a9bf0150c5d58eeebb322e77e91d4fb391cb2c Mon Sep 17 00:00:00 2001 From: Steven Dick <38897662+nterl0k@users.noreply.github.com> Date: Mon, 10 Feb 2025 10:59:11 -0500 Subject: [PATCH 06/24] Add files via upload --- ...ows_bitLocker_suspicious_command_usage.yml | 69 +++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 windows_bitLocker_suspicious_command_usage.yml diff --git a/windows_bitLocker_suspicious_command_usage.yml b/windows_bitLocker_suspicious_command_usage.yml new file mode 100644 index 0000000000..0f0e422e51 --- /dev/null +++ b/windows_bitLocker_suspicious_command_usage.yml @@ -0,0 +1,69 @@ +name: Windows BitLocker Suspicious Command Usage +id: d0e6ec70-6e40-41a2-8b93-8d9ff077a746 +version: 1 +date: '2025-02-10' +author: Steven Dick +status: production +type: TTP +description: This analytic is developed to detect the usage of BitLocker commands used to disable or impact boot settings. The malware ShrinkLocker uses various commands change how BitLocker handles encryption, potentially bypassing TPM requirements, enabling BitLocker without TPM, and enforcing specific startup key and PIN configurations. Such modifications can weaken system security, making it easier for unauthorized access and data breaches. Detecting these changes is crucial for maintaining robust encryption and data protection. +data_source: +- Sysmon EventID 1 +- Windows Event Log Security 4688 +- CrowdStrike ProcessRollup2 +search: |- + | tstats `security_content_summariesonly` values(Processes.process) as process, values(Processes.parent_process) as parent_process min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes where Processes.process_name = manage-bde.exe AND Processes.process IN ("* -protectors -disable *","* -protectors -delete *","* –forcerecovery *","* -lock *") by Processes.dest Processes.user Processes.process_name Processes.parent_process_name + | `drop_dm_object_name(Processes)` + | `security_content_ctime(firstTime)` + | `security_content_ctime(lastTime)` + | `windows_bitlocker_suspicious_command_usage_filter` +how_to_implement: To successfully implement this search you need to be ingesting information on process that include the name of the process responsible for the changes from your endpoints into the `Endpoint` datamodel in the `Processes` node. In addition, confirm the latest CIM App 4.20 or higher is installed and the latest TA for the endpoint product. +known_false_positives: Administrators may enable or disable this feature that may cause some false positive. +references: +- https://attack.mitre.org/techniques/T1486/ +- https://www.nccgroup.com/us/research-blog/nameless-and-shameless-ransomware-encryption-via-bitlocker/ +- https://www.bitdefender.com/en-us/blog/businessinsights/shrinklocker-decryptor-from-friend-to-foe-and-back-again +- https://www.bleepingcomputer.com/news/security/new-shrinklocker-ransomware-uses-bitlocker-to-encrypt-your-files/ +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$ +- name: Investigate processes on $dest$ + search: '| from datamodel Endpoint.Processes +| search process_name = $process_name$ AND dest = "$dest$"' + earliest_offset: $info_min_time$ + latest_offset: $info_max_time$ +rba: + message: A suspicious Windows BitLocker command was run by $user$ detected on $dest$ + risk_objects: + - field: dest + type: system + score: 60 + - field: user + type: user + score: 60 + threat_objects: + - field: parent_process + type: process +tags: + analytic_story: + - ShrinkLocker + asset_type: Endpoint + mitre_attack_id: + - T1486 + - T1490 + 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/T1486/bitlocker_sus_commands/bitlocker_sus_commands.log + source: XmlWinEventLog:Microsoft-Windows-Sysmon/Operational + sourcetype: XmlWinEventLog \ No newline at end of file From 2ccd4cd0e59bd95e008517a2234a79e2d282f2b3 Mon Sep 17 00:00:00 2001 From: Steven Dick <38897662+nterl0k@users.noreply.github.com> Date: Mon, 10 Feb 2025 11:14:52 -0500 Subject: [PATCH 07/24] move where it goes dummy --- .../endpoint/windows_bitLocker_suspicious_command_usage.yml | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename windows_bitLocker_suspicious_command_usage.yml => detections/endpoint/windows_bitLocker_suspicious_command_usage.yml (100%) diff --git a/windows_bitLocker_suspicious_command_usage.yml b/detections/endpoint/windows_bitLocker_suspicious_command_usage.yml similarity index 100% rename from windows_bitLocker_suspicious_command_usage.yml rename to detections/endpoint/windows_bitLocker_suspicious_command_usage.yml From 93cf7893d59fc6f66b6ddc86b56f5114918e952a Mon Sep 17 00:00:00 2001 From: Steven Dick <38897662+nterl0k@users.noreply.github.com> Date: Mon, 10 Feb 2025 11:18:07 -0500 Subject: [PATCH 08/24] Update and rename windows_bitLocker_suspicious_command_usage.yml to windows_bitlocker_suspicious_command_usage.yml --- ...usage.yml => windows_bitlocker_suspicious_command_usage.yml} | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename detections/endpoint/{windows_bitLocker_suspicious_command_usage.yml => windows_bitlocker_suspicious_command_usage.yml} (97%) diff --git a/detections/endpoint/windows_bitLocker_suspicious_command_usage.yml b/detections/endpoint/windows_bitlocker_suspicious_command_usage.yml similarity index 97% rename from detections/endpoint/windows_bitLocker_suspicious_command_usage.yml rename to detections/endpoint/windows_bitlocker_suspicious_command_usage.yml index 0f0e422e51..dbe69277c5 100644 --- a/detections/endpoint/windows_bitLocker_suspicious_command_usage.yml +++ b/detections/endpoint/windows_bitlocker_suspicious_command_usage.yml @@ -66,4 +66,4 @@ tests: attack_data: - data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/attack_techniques/T1486/bitlocker_sus_commands/bitlocker_sus_commands.log source: XmlWinEventLog:Microsoft-Windows-Sysmon/Operational - sourcetype: XmlWinEventLog \ No newline at end of file + sourcetype: XmlWinEventLog From dba521c8e8acfa6f8c425a5213655c19a9bdc0e0 Mon Sep 17 00:00:00 2001 From: Nasreddine Bencherchali Date: Wed, 29 Jan 2025 00:32:42 +0100 Subject: [PATCH 09/24] 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 c16e7a1a745d452fd25f917f8c6ba4b23e133b11 Mon Sep 17 00:00:00 2001 From: Nasreddine Bencherchali Date: Wed, 29 Jan 2025 00:32:59 +0100 Subject: [PATCH 10/24] 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 ba36467ece5f16b9399f64096b56ce624d2c715d Mon Sep 17 00:00:00 2001 From: Nasreddine Bencherchali Date: Wed, 29 Jan 2025 00:34:19 +0100 Subject: [PATCH 11/24] 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 805d75c84dcbf7dd5b8d66cd52dfb99c34389b76 Mon Sep 17 00:00:00 2001 From: Nasreddine Bencherchali Date: Wed, 29 Jan 2025 00:34:42 +0100 Subject: [PATCH 12/24] fix: deprecate 2b85aa3d-f5f6-4c2e-a081-a09f6e1c2e40 --- .../suspicious_event_log_service_behavior.yml | 2 +- ...ows_event_logging_service_has_shutdown.yml | 49 +++++++++++++++++++ 2 files changed, 50 insertions(+), 1 deletion(-) rename detections/{endpoint => deprecated}/suspicious_event_log_service_behavior.yml (99%) 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 99% rename from detections/endpoint/suspicious_event_log_service_behavior.yml rename to detections/deprecated/suspicious_event_log_service_behavior.yml index 6900ba2b70..609d68eb40 100644 --- a/detections/endpoint/suspicious_event_log_service_behavior.yml +++ b/detections/deprecated/suspicious_event_log_service_behavior.yml @@ -3,7 +3,7 @@ id: 2b85aa3d-f5f6-4c2e-a081-a09f6e1c2e40 version: 6 date: '2025-02-10' 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 1dfb2597c2a63835290c87a7bc766540d570fea6 Mon Sep 17 00:00:00 2001 From: Nasreddine Bencherchali Date: Wed, 29 Jan 2025 00:42:05 +0100 Subject: [PATCH 13/24] 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 abfbe7a3c7ec4688aca1b40d586787e5bdce486f Mon Sep 17 00:00:00 2001 From: Nasreddine Bencherchali Date: Wed, 29 Jan 2025 00:48:57 +0100 Subject: [PATCH 14/24] 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 9925f0d78c79aad8b4ce31847ebe4dc0105d308c Mon Sep 17 00:00:00 2001 From: Nasreddine Bencherchali Date: Wed, 29 Jan 2025 01:03:47 +0100 Subject: [PATCH 15/24] 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 6b6d45831d46b51ff403adc984eab75ccb64113f Mon Sep 17 00:00:00 2001 From: Nasreddine Bencherchali Date: Wed, 29 Jan 2025 01:15:59 +0100 Subject: [PATCH 16/24] 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 c952f7b1a0d91d4b430d10033e0b83b03629ed94 Mon Sep 17 00:00:00 2001 From: Nasreddine Bencherchali Date: Wed, 29 Jan 2025 11:49:47 +0100 Subject: [PATCH 17/24] 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 4e22f53684e85c3cf6a75719ccc26c39d51a4a52 Mon Sep 17 00:00:00 2001 From: Nasreddine Bencherchali Date: Wed, 29 Jan 2025 15:28:45 +0100 Subject: [PATCH 18/24] 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 d66f4e00d92b69111003014f3997b3744d874456 Mon Sep 17 00:00:00 2001 From: Nasreddine Bencherchali Date: Wed, 29 Jan 2025 15:31:45 +0100 Subject: [PATCH 19/24] 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 ae708a0649dd5b721b34a5d6190d339fe2fac5f6 Mon Sep 17 00:00:00 2001 From: Nasreddine Bencherchali Date: Wed, 29 Jan 2025 15:33:30 +0100 Subject: [PATCH 20/24] 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 6f1d3e6fa6102c33ad174a323c3d4e8e150226f0 Mon Sep 17 00:00:00 2001 From: Nasreddine Bencherchali Date: Wed, 29 Jan 2025 16:36:24 +0100 Subject: [PATCH 21/24] 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 2ab27cd8c5169447ee7370617cba1a5c53246dd8 Mon Sep 17 00:00:00 2001 From: Bhavin Patel Date: Wed, 5 Feb 2025 14:16:15 -0800 Subject: [PATCH 22/24] 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 609d68eb40..e8edce28df 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-02-10' 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, From 659a9a8b32f0fa3bbaef89e3733b500b43dda349 Mon Sep 17 00:00:00 2001 From: Nasreddine Bencherchali Date: Wed, 19 Feb 2025 11:26:50 +0100 Subject: [PATCH 23/24] remove overlapping tagging --- .../windows_audit_policy_auditing_option_modified___registry.yml | 1 - .../endpoint/windows_event_logging_service_has_shutdown.yml | 1 - 2 files changed, 2 deletions(-) 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 456e398a6b..08b863003e 100644 --- a/detections/endpoint/windows_audit_policy_auditing_option_modified___registry.yml +++ b/detections/endpoint/windows_audit_policy_auditing_option_modified___registry.yml @@ -44,7 +44,6 @@ tags: asset_type: Endpoint mitre_attack_id: - T1547.014 - - T1547 product: - Splunk Enterprise - Splunk Enterprise Security diff --git a/detections/endpoint/windows_event_logging_service_has_shutdown.yml b/detections/endpoint/windows_event_logging_service_has_shutdown.yml index 200fd0ab5a..ad327550a6 100644 --- a/detections/endpoint/windows_event_logging_service_has_shutdown.yml +++ b/detections/endpoint/windows_event_logging_service_has_shutdown.yml @@ -23,7 +23,6 @@ tags: - Clop Ransomware asset_type: Endpoint mitre_attack_id: - - T1070 - T1070.001 product: - Splunk Enterprise From de2162b94d1dd2e5db5d2a1a1ae02fee2b94c1b1 Mon Sep 17 00:00:00 2001 From: Nasreddine Bencherchali Date: Wed, 19 Feb 2025 14:50:57 +0100 Subject: [PATCH 24/24] update logic and analytic --- ...l_telegram_api_request_via_commandline.yml | 62 ++++++++++++ ...ram_detected_access_suspicious_api_url.yml | 94 ------------------- 2 files changed, 62 insertions(+), 94 deletions(-) create mode 100644 detections/endpoint/potential_telegram_api_request_via_commandline.yml delete mode 100644 detections/endpoint/telegram_detected_access_suspicious_api_url.yml diff --git a/detections/endpoint/potential_telegram_api_request_via_commandline.yml b/detections/endpoint/potential_telegram_api_request_via_commandline.yml new file mode 100644 index 0000000000..6e704fe58a --- /dev/null +++ b/detections/endpoint/potential_telegram_api_request_via_commandline.yml @@ -0,0 +1,62 @@ +name: Potential Telegram API Request Via CommandLine +id: d6b0d627-d0bf-46b1-936f-c48284767d21 +version: 1 +date: '2025-02-19' +author: Nasreddine Bencherchali, Splunk, Zaki Zarkasih Al Mustafa +status: production +type: Anomaly +description: The following analytic detects the presence of "api.telegram.org" in the CommandLine of a process. It leverages data from Endpoint Detection and Response (EDR) agents, focusing on process execution logs that include command-line details. This activity can be significant as the telegram API has been used as an exfiltration mechanism or even as a C2 channel. If confirmed malicious, this could allow an attacker or malware to exfiltrate data or receive additional C2 instruction, potentially leading to further compromise and persistence within the network. +data_source: +- Sysmon EventID 1 +- Windows Event Log Security 4688 +- CrowdStrike ProcessRollup2 +search: '| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes where Processes.process= "*api.telegram.org*" NOT Processes.process IN ("*-osint -url*", "* --single-argument*") by Processes.dest Processes.user Processes.parent_process_name Processes.parent_process_id Processes.process_name Processes.process Processes.process_id Processes.process_guid | `drop_dm_object_name(Processes)` | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)` | `potential_telegram_api_request_via_commandline_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 GUID, process name, and parent process. 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 positive may stem from application or users requesting the API directly via CommandLine for testing purposes. Investigate the matches and apply the necessary filters. +references: +- https://www.virustotal.com/gui/file/0b3ef5e04329cefb5bb4bf30b3edcb32d1ec6bbcb29d22695a079bfb5b56e8ac/behavior +- https://www.virustotal.com/gui/file/72c59eeb15b5ec1d95e72e4b06a030bc058822bc10e5cb807e78a4624d329666/behavior +- https://www.virustotal.com/gui/file/72c59eeb15b5ec1d95e72e4b06a030bc058822bc10e5cb807e78a4624d329666/content +- https://www.virustotal.com/gui/file/1c4541bf70b6e251ef024ec4dde8dce400539c2368461c0d90e15a81b11ace44/content +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: Process $process_name$ with command line $process$ in $dest$ + risk_objects: + - field: dest + type: system + score: 30 + threat_objects: + - field: process_name + type: process_name +tags: + analytic_story: + - XMRig + asset_type: Endpoint + mitre_attack_id: + - T1102.002 + - T1041 + 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/T1102.002/telegram_api_cli/telegram_cli.log + source: XmlWinEventLog:Microsoft-Windows-Sysmon/Operational + sourcetype: XmlWinEventLog diff --git a/detections/endpoint/telegram_detected_access_suspicious_api_url.yml b/detections/endpoint/telegram_detected_access_suspicious_api_url.yml deleted file mode 100644 index 230aa18177..0000000000 --- a/detections/endpoint/telegram_detected_access_suspicious_api_url.yml +++ /dev/null @@ -1,94 +0,0 @@ -data_source: -- Windows Security 4688 -name: Telegram Detected Access Suspicious API/URL -id: 6e106492-561f-4f0c-919c-6560861e27d3 -version: 1 -date: '2025-01-02' -author: Zaki Zarkasih Al Mustafa -type: TTP -status: production -description: Detects suspicious process activity related to Telegram API -search: | `wineventlog_security` - AND ParentProcessName=*Telegram* AND CommandLine=*api.telegram* | eval utc_time=strptime(TimeCreated, - "%Y-%m-%dT%H:%M:%S.%6NZ") | eval Time_Created=strftime(utc_time + 25200, "%Y-%m-%d - %H:%M:%S") | rename Time_Created as "Time Created", host as Host, src_user as User - | table "Time Created", Host, User, EventID, ParentProcessName, CommandLine, NewProcessName - | `telegram_detected_access_suspicious_api_url_filter` -macros: - - telegram_detected_access_suspicious_api_url_filter - - wineventlog_security -how_to_implement: | - Ensure the relevant data source (`Wineventlog:Security`) is ingested into Splunk. - Configure the macro `telegram_detected_access_suspicious_api_url_filter` to filter false positives or noisy data. - Deploy this detection rule in Splunk Enterprise Security or Splunk Cloud. - -known_false_positives: | - Non-malicious use of Telegram's API by legitimate applications or processes may trigger this detection. - Automated scripts or tools using Telegram for notifications or integrations might also appear as suspicious. - Developers testing Telegram API functionality in controlled environments. - -drilldown_searches: - - name: Investigate Parent Process - description: | - This drilldown searches for other processes spawned by the same parent process - to identify potential patterns or related activities. - search: | - `` - AND ParentProcessName="$ParentProcessName$" - | table _time, ParentProcessName, NewProcessName, CommandLine - earliest_offset: $info_min_time$ - latest_offset: $info_max_time$ - - - name: Investigate User Activity - description: | - This drilldown searches for all activities performed by the same user in the - Windows Event Logs to provide additional context. - search: | - `` - AND src_user="$src_user$" - | table _time, src_user, EventID, host, CommandLine - earliest_offset: $info_min_time$ - latest_offset: $info_max_time$ - -references: -- https://securelist.com/telegram-phishing-services/109383/ -tags: - analytic_story: - - XMRig - asset_type: Endpoint - confidence: 85 - impact: 70 - message: Detects suspicious access to Telegram API for potential misuse or malicious activity. - mitre_attack_id: - - T1059.001 - - T1059.003 - - T1003.002 - - T1105 - - T1566 - observable: - - name: CommandLine - type: Process Name - role: - - Attacker - - name: Host - type: Hostname - role: - - Victim - product: - - Splunk Enterprise - - Splunk Enterprise Security - - Splunk Cloud - required_fields: - - index - - sourcetype - - ParentProcessName - - CommandLine - risk_score: 59.5 - security_domain: endpoint - cve: [] -tests: -- name: True Positive Test - attack_data: - - data: https://github.com/splunk/contentctl/wiki - sourcetype: Wineventlog:Security - source: Wineventlog