From cf1f54c758fe96ad0eaed338d911510a6030e799 Mon Sep 17 00:00:00 2001 From: tccontre Date: Wed, 27 Jul 2022 15:19:30 +0200 Subject: [PATCH 01/17] dcrat-analytics2 --- ...ork_info_through_ip_check_web_services.yml | 1 + .../windows_high_file_deletion_frequency.yml | 5 +- .../windows_system_logoff_commandline.yml | 73 ++++++++++++++++++ .../windows_system_reboot_commandline.yml | 74 +++++++++++++++++++ .../windows_system_shutdown_commandline.yml | 73 ++++++++++++++++++ ...windows_system_logoff_commandline.test.yml | 13 ++++ ...windows_system_reboot_commandline.test.yml | 13 ++++ ...ndows_system_shutdown_commandline.test.yml | 13 ++++ 8 files changed, 263 insertions(+), 2 deletions(-) create mode 100644 detections/endpoint/windows_system_logoff_commandline.yml create mode 100644 detections/endpoint/windows_system_reboot_commandline.yml create mode 100644 detections/endpoint/windows_system_shutdown_commandline.yml create mode 100644 tests/endpoint/windows_system_logoff_commandline.test.yml create mode 100644 tests/endpoint/windows_system_reboot_commandline.test.yml create mode 100644 tests/endpoint/windows_system_shutdown_commandline.test.yml diff --git a/detections/endpoint/windows_gather_victim_network_info_through_ip_check_web_services.yml b/detections/endpoint/windows_gather_victim_network_info_through_ip_check_web_services.yml index 5d6b527d06..37ac487977 100644 --- a/detections/endpoint/windows_gather_victim_network_info_through_ip_check_web_services.yml +++ b/detections/endpoint/windows_gather_victim_network_info_through_ip_check_web_services.yml @@ -26,6 +26,7 @@ references: tags: analytic_story: - Azorult + - DarkCrystal RAT asset_type: Endpoint cis20: - CIS 3 diff --git a/detections/endpoint/windows_high_file_deletion_frequency.yml b/detections/endpoint/windows_high_file_deletion_frequency.yml index 9aaf0c761e..10743148c8 100644 --- a/detections/endpoint/windows_high_file_deletion_frequency.yml +++ b/detections/endpoint/windows_high_file_deletion_frequency.yml @@ -2,7 +2,7 @@ name: Windows High File Deletion Frequency id: 45b125c4-866f-11eb-a95a-acde48001122 version: 1 date: '2021-03-16' -author: Teoderick Contreras +author: Teoderick Contreras, Splunk type: Anomaly datamodel: - Endpoint @@ -13,7 +13,7 @@ description: This search looks for high frequency of file deletion relative to p search: '`sysmon` EventCode=23 TargetFilename IN ("*.cmd", "*.ini","*.gif", "*.jpg", "*.jpeg", "*.db", "*.ps1", "*.doc*", "*.xls*", "*.ppt*", "*.bmp","*.zip", "*.rar", "*.7z", "*.chm", "*.png", "*.log", "*.vbs", "*.js", "*.vhd", "*.bak", "*.wbcat", - "*.bkf" , "*.backup*", "*.dsk", , "*.win") | stats values(TargetFilename) as deleted_files + "*.bkf" , "*.backup*", "*.dsk", "*.win") | stats values(TargetFilename) as deleted_files min(_time) as firstTime max(_time) as lastTime count by Computer user EventCode Image ProcessID |where count >=100 | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)` | `windows_high_file_deletion_frequency_filter`' @@ -29,6 +29,7 @@ tags: analytic_story: - Clop Ransomware - WhisperGate + - DarkCrystal RAT confidence: 80 context: - Source:Endpoint diff --git a/detections/endpoint/windows_system_logoff_commandline.yml b/detections/endpoint/windows_system_logoff_commandline.yml new file mode 100644 index 0000000000..2de971fd7c --- /dev/null +++ b/detections/endpoint/windows_system_logoff_commandline.yml @@ -0,0 +1,73 @@ +name: Windows System LogOff Commandline +id: 74a8133f-93e7-4b71-9bd3-13a66124fd57 +version: 1 +date: '2022-07-27' +author: Teoderick Contreras, Splunk +type: TTP +datamodel: +- Endpoint +description: The following analytic identifies Windows commandlined to logoff a windows host machine. + This technique was seen in several APT, RAT like dcrat and other commodity malware to shutdown the machine to add more impact, + interrupt access, aid destruction of the system like wiping disk or inhibit system recovery. + This TTP is a good pivot to check why application trigger this commandline which is not so common way to logoff a machine. +search: '| tstats `security_content_summariesonly` values(Processes.process) as process min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes + where (Processes.process_name = shutdown.exe OR Processes.original_file_name = shutdown.exe) Processes.process="*shutdown*" Processes.process="* /l*" Processes.process="* /t*" + by Processes.dest Processes.user Processes.parent_process 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_system_shutdown_commandline_filter`' +how_to_implement: To successfully implement this search, you need to be ingesting + logs with the process name, parent process, and command-line executions from your + endpoints. If you are using Sysmon, you must have at least version 6.0.4 of the + Sysmon TA. +known_false_positives: Administrator may execute this commandline to trigger shutdown, logoff or restart the host machine. +references: +- https://attack.mitre.org/techniques/T1529/ +- https://www.mandiant.com/resources/analyzing-dark-crystal-rat-backdoor +tags: + analytic_story: + - Source:Endpoint + - DarkCrystal RAT + asset_type: Endpoint + cis20: + - CIS 3 + - CIS 5 + - CIS 16 + confidence: 70 + context: + - Stage:Impact + dataset: + - https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/malware/reboot_logoff_commandline/sysmon.log + impact: 70 + kill_chain_phases: + - Exploitation + message: process that execute logoff commandline in $dest$ + mitre_attack_id: + - T1529 + nist: + - DE.CM + observable: + - name: dest + type: Hostname + role: + - Victim + product: + - Splunk Enterprise + - Splunk Enterprise Security + - Splunk Cloud + required_fields: + - _time + - Processes.dest + - Processes.user + - Processes.parent_process_name + - Processes.parent_process + - Processes.original_file_name + - Processes.process_name + - Processes.process + - Processes.process_id + - Processes.parent_process_path + - Processes.process_path + - Processes.parent_process_id + risk_score: 49 + security_domain: endpoint diff --git a/detections/endpoint/windows_system_reboot_commandline.yml b/detections/endpoint/windows_system_reboot_commandline.yml new file mode 100644 index 0000000000..fd9827856f --- /dev/null +++ b/detections/endpoint/windows_system_reboot_commandline.yml @@ -0,0 +1,74 @@ +name: Windows System Reboot CommandLine +id: 97fc2b60-c8eb-4711-93f7-d26fade3686f +version: 1 +date: '2022-07-27' +author: Teoderick Contreras, Splunk +type: TTP +datamodel: +- Endpoint +description: The following analytic identifies Windows commandlined to reboot a windows host machine. + This technique was seen in several APT, RAT like dcrat and other commodity malware to shutdown the machine to add more impact, + interrupt access, aid destruction of the system like wiping disk or inhibit system recovery. + This TTP is a good pivot to check why application trigger this commandline which is not so common way to reboot a machine. + Compare to shutdown and logoff shutdown.exe feature, reboot seen in some automation script like ansible to reboot the machine. +search: '| tstats `security_content_summariesonly` values(Processes.process) as process min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes + where (Processes.process_name = shutdown.exe OR Processes.original_file_name = shutdown.exe) Processes.process="*shutdown*" Processes.process="* /r*" Processes.process="* /t*" + by Processes.dest Processes.user Processes.parent_process 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_system_shutdown_commandline_filter`' +how_to_implement: To successfully implement this search, you need to be ingesting + logs with the process name, parent process, and command-line executions from your + endpoints. If you are using Sysmon, you must have at least version 6.0.4 of the + Sysmon TA. +known_false_positives: Administrator may execute this commandline to trigger shutdown or restart the host machine. +references: +- https://attack.mitre.org/techniques/T1529/ +- https://www.mandiant.com/resources/analyzing-dark-crystal-rat-backdoor +tags: + analytic_story: + - Source:Endpoint + - DarkCrystal RAT + asset_type: Endpoint + cis20: + - CIS 3 + - CIS 5 + - CIS 16 + confidence: 50 + context: + - Stage:Impact + dataset: + - https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/malware/reboot_logoff_commandline/sysmon.log + impact: 60 + kill_chain_phases: + - Exploitation + message: process that execute reboot commandline in $dest$ + mitre_attack_id: + - T1529 + nist: + - DE.CM + observable: + - name: dest + type: Hostname + role: + - Victim + product: + - Splunk Enterprise + - Splunk Enterprise Security + - Splunk Cloud + required_fields: + - _time + - Processes.dest + - Processes.user + - Processes.parent_process_name + - Processes.parent_process + - Processes.original_file_name + - Processes.process_name + - Processes.process + - Processes.process_id + - Processes.parent_process_path + - Processes.process_path + - Processes.parent_process_id + risk_score: 30 + security_domain: endpoint diff --git a/detections/endpoint/windows_system_shutdown_commandline.yml b/detections/endpoint/windows_system_shutdown_commandline.yml new file mode 100644 index 0000000000..43e4de6cbc --- /dev/null +++ b/detections/endpoint/windows_system_shutdown_commandline.yml @@ -0,0 +1,73 @@ +name: Windows System Shutdown CommandLine +id: 4fee57b8-d825-4bf3-9ea8-bf405cdb614c +version: 1 +date: '2022-07-27' +author: Teoderick Contreras, Splunk +type: TTP +datamodel: +- Endpoint +description: The following analytic identifies Windows commandlined to shutdown a windows host machine. + This technique was seen in several APT, RAT like dcrat and other commodity malware to shutdown the machine to add more impact, + interrupt access, aid destruction of the system like wiping disk or inhibit system recovery. + This TTP is a good pivot to check why application trigger this commandline which is not so common way to shutdown a machine. +search: '| tstats `security_content_summariesonly` values(Processes.process) as process min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes + where (Processes.process_name = shutdown.exe OR Processes.original_file_name = shutdown.exe) Processes.process="*shutdown*" Processes.process="* /s*" Processes.process="* /t*" + by Processes.dest Processes.user Processes.parent_process 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_system_shutdown_commandline_filter`' +how_to_implement: To successfully implement this search, you need to be ingesting + logs with the process name, parent process, and command-line executions from your + endpoints. If you are using Sysmon, you must have at least version 6.0.4 of the + Sysmon TA. +known_false_positives: Administrator may execute this commandline to trigger shutdown or restart the host machine. +references: +- https://attack.mitre.org/techniques/T1529/ +- https://www.mandiant.com/resources/analyzing-dark-crystal-rat-backdoor +tags: + analytic_story: + - Source:Endpoint + - DarkCrystal RAT + asset_type: Endpoint + cis20: + - CIS 3 + - CIS 5 + - CIS 16 + confidence: 70 + context: + - Stage:Impact + dataset: + - UPDATE_DATASET_URL + impact: 70 + kill_chain_phases: + - Exploitation + message: process that execute shutdown commandline in $dest$ + mitre_attack_id: + - T1529 + nist: + - DE.CM + observable: + - name: dest + type: Hostname + role: + - Victim + product: + - Splunk Enterprise + - Splunk Enterprise Security + - Splunk Cloud + required_fields: + - _time + - Processes.dest + - Processes.user + - Processes.parent_process_name + - Processes.parent_process + - Processes.original_file_name + - Processes.process_name + - Processes.process + - Processes.process_id + - Processes.parent_process_path + - Processes.process_path + - Processes.parent_process_id + risk_score: 49 + security_domain: endpoint diff --git a/tests/endpoint/windows_system_logoff_commandline.test.yml b/tests/endpoint/windows_system_logoff_commandline.test.yml new file mode 100644 index 0000000000..ccada98596 --- /dev/null +++ b/tests/endpoint/windows_system_logoff_commandline.test.yml @@ -0,0 +1,13 @@ +name: Windows System LogOff Commandline Unit Test +tests: +- name: Windows System LogOff Commandline + file: endpoint/windows_system_logoff_commandline.yml + pass_condition: '| stats count | where count > 0' + earliest_time: -24h + latest_time: now + attack_data: + - file_name: sysmon.log + data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/malware/dcrat/reboot_logoff_commandline/sysmon.log + source: XmlWinEventLog:Microsoft-Windows-Sysmon/Operational + sourcetype: xmlwineventlog + update_timestamp: true diff --git a/tests/endpoint/windows_system_reboot_commandline.test.yml b/tests/endpoint/windows_system_reboot_commandline.test.yml new file mode 100644 index 0000000000..fe9e81a0f0 --- /dev/null +++ b/tests/endpoint/windows_system_reboot_commandline.test.yml @@ -0,0 +1,13 @@ +name: Windows System Reboot CommandLine Unit Test +tests: +- name: Windows System Reboot CommandLine + file: endpoint/windows_system_reboot_commandline.yml + pass_condition: '| stats count | where count > 0' + earliest_time: -24h + latest_time: now + attack_data: + - file_name: sysmon.log + data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/malware/dcrat/reboot_logoff_commandline/sysmon.log + source: XmlWinEventLog:Microsoft-Windows-Sysmon/Operational + sourcetype: xmlwineventlog + update_timestamp: true diff --git a/tests/endpoint/windows_system_shutdown_commandline.test.yml b/tests/endpoint/windows_system_shutdown_commandline.test.yml new file mode 100644 index 0000000000..0fb26ee195 --- /dev/null +++ b/tests/endpoint/windows_system_shutdown_commandline.test.yml @@ -0,0 +1,13 @@ +name: Windows System Shutdown CommandLine Unit Test +tests: +- name: Windows System Shutdown CommandLine + file: endpoint/windows_system_shutdown_commandline.yml + pass_condition: '| stats count | where count > 0' + earliest_time: -24h + latest_time: now + attack_data: + - file_name: sysmon.log + data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/malware/dcrat/shutdown_commandline/sysmon.log + source: XmlWinEventLog:Microsoft-Windows-Sysmon/Operational + sourcetype: xmlwineventlog + update_timestamp: true From 07157ba511c48440261f4aef6bfd15badbe5c61e Mon Sep 17 00:00:00 2001 From: tccontre Date: Wed, 27 Jul 2022 15:23:34 +0200 Subject: [PATCH 02/17] dcrat-analytics2 --- detections/endpoint/windows_system_logoff_commandline.yml | 2 +- detections/endpoint/windows_system_reboot_commandline.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/detections/endpoint/windows_system_logoff_commandline.yml b/detections/endpoint/windows_system_logoff_commandline.yml index 2de971fd7c..3eedeecac0 100644 --- a/detections/endpoint/windows_system_logoff_commandline.yml +++ b/detections/endpoint/windows_system_logoff_commandline.yml @@ -16,7 +16,7 @@ search: '| tstats `security_content_summariesonly` values(Processes.process) as | `drop_dm_object_name(Processes)` | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)` - | `windows_system_shutdown_commandline_filter`' + | `windows_system_logoff_commandline_filter`' how_to_implement: To successfully implement this search, you need to be ingesting logs with the process name, parent process, and command-line executions from your endpoints. If you are using Sysmon, you must have at least version 6.0.4 of the diff --git a/detections/endpoint/windows_system_reboot_commandline.yml b/detections/endpoint/windows_system_reboot_commandline.yml index fd9827856f..09df254484 100644 --- a/detections/endpoint/windows_system_reboot_commandline.yml +++ b/detections/endpoint/windows_system_reboot_commandline.yml @@ -17,7 +17,7 @@ search: '| tstats `security_content_summariesonly` values(Processes.process) as | `drop_dm_object_name(Processes)` | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)` - | `windows_system_shutdown_commandline_filter`' + | `windows_system_reboot_commandline_filter`' how_to_implement: To successfully implement this search, you need to be ingesting logs with the process name, parent process, and command-line executions from your endpoints. If you are using Sysmon, you must have at least version 6.0.4 of the From 815df629ceb114cad4f917b094b26fd339f44f6a Mon Sep 17 00:00:00 2001 From: tccontre <26181693+tccontre@users.noreply.github.com> Date: Wed, 27 Jul 2022 15:27:10 +0200 Subject: [PATCH 03/17] Update windows_system_shutdown_commandline.yml --- detections/endpoint/windows_system_shutdown_commandline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/detections/endpoint/windows_system_shutdown_commandline.yml b/detections/endpoint/windows_system_shutdown_commandline.yml index 43e4de6cbc..1b018dcdb8 100644 --- a/detections/endpoint/windows_system_shutdown_commandline.yml +++ b/detections/endpoint/windows_system_shutdown_commandline.yml @@ -1,4 +1,4 @@ -name: Windows System Shutdown CommandLine +name: Windows System Shutdown CommandLine id: 4fee57b8-d825-4bf3-9ea8-bf405cdb614c version: 1 date: '2022-07-27' From b33f2bdee5e419b053e04b321988b1a995d51ef8 Mon Sep 17 00:00:00 2001 From: tccontre <26181693+tccontre@users.noreply.github.com> Date: Wed, 27 Jul 2022 15:27:35 +0200 Subject: [PATCH 04/17] Update windows_system_shutdown_commandline.yml --- detections/endpoint/windows_system_shutdown_commandline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/detections/endpoint/windows_system_shutdown_commandline.yml b/detections/endpoint/windows_system_shutdown_commandline.yml index 1b018dcdb8..8773126d01 100644 --- a/detections/endpoint/windows_system_shutdown_commandline.yml +++ b/detections/endpoint/windows_system_shutdown_commandline.yml @@ -38,7 +38,7 @@ tags: context: - Stage:Impact dataset: - - UPDATE_DATASET_URL + - https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/malware/dcrat/shutdown_commandline/sysmon.log impact: 70 kill_chain_phases: - Exploitation From 2697fc41166f5e97b3ae41f1e82868698c5320b4 Mon Sep 17 00:00:00 2001 From: tccontre Date: Wed, 27 Jul 2022 15:39:18 +0200 Subject: [PATCH 05/17] dcrat-analytics2 --- detections/endpoint/windows_system_logoff_commandline.yml | 1 + detections/endpoint/windows_system_reboot_commandline.yml | 1 + detections/endpoint/windows_system_shutdown_commandline.yml | 1 + 3 files changed, 3 insertions(+) diff --git a/detections/endpoint/windows_system_logoff_commandline.yml b/detections/endpoint/windows_system_logoff_commandline.yml index 3eedeecac0..9f06e29096 100644 --- a/detections/endpoint/windows_system_logoff_commandline.yml +++ b/detections/endpoint/windows_system_logoff_commandline.yml @@ -36,6 +36,7 @@ tags: - CIS 16 confidence: 70 context: + - Source:Endpoint - Stage:Impact dataset: - https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/malware/reboot_logoff_commandline/sysmon.log diff --git a/detections/endpoint/windows_system_reboot_commandline.yml b/detections/endpoint/windows_system_reboot_commandline.yml index 09df254484..ac51e2c6ea 100644 --- a/detections/endpoint/windows_system_reboot_commandline.yml +++ b/detections/endpoint/windows_system_reboot_commandline.yml @@ -37,6 +37,7 @@ tags: - CIS 16 confidence: 50 context: + - Source:Endpoint - Stage:Impact dataset: - https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/malware/reboot_logoff_commandline/sysmon.log diff --git a/detections/endpoint/windows_system_shutdown_commandline.yml b/detections/endpoint/windows_system_shutdown_commandline.yml index 8773126d01..a59b541009 100644 --- a/detections/endpoint/windows_system_shutdown_commandline.yml +++ b/detections/endpoint/windows_system_shutdown_commandline.yml @@ -36,6 +36,7 @@ tags: - CIS 16 confidence: 70 context: + - Source:Endpoint - Stage:Impact dataset: - https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/malware/dcrat/shutdown_commandline/sysmon.log From 37ad5a8675bfe61130267d9ca78c8aa63c04e3f9 Mon Sep 17 00:00:00 2001 From: tccontre Date: Wed, 27 Jul 2022 15:41:43 +0200 Subject: [PATCH 06/17] dcrat-analytics2 --- detections/endpoint/windows_system_logoff_commandline.yml | 3 +-- detections/endpoint/windows_system_reboot_commandline.yml | 3 +-- detections/endpoint/windows_system_shutdown_commandline.yml | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/detections/endpoint/windows_system_logoff_commandline.yml b/detections/endpoint/windows_system_logoff_commandline.yml index 9f06e29096..0513f7ab0f 100644 --- a/detections/endpoint/windows_system_logoff_commandline.yml +++ b/detections/endpoint/windows_system_logoff_commandline.yml @@ -27,7 +27,6 @@ references: - https://www.mandiant.com/resources/analyzing-dark-crystal-rat-backdoor tags: analytic_story: - - Source:Endpoint - DarkCrystal RAT asset_type: Endpoint cis20: @@ -37,7 +36,7 @@ tags: confidence: 70 context: - Source:Endpoint - - Stage:Impact + - Stage:Execution dataset: - https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/malware/reboot_logoff_commandline/sysmon.log impact: 70 diff --git a/detections/endpoint/windows_system_reboot_commandline.yml b/detections/endpoint/windows_system_reboot_commandline.yml index ac51e2c6ea..5e096c7d41 100644 --- a/detections/endpoint/windows_system_reboot_commandline.yml +++ b/detections/endpoint/windows_system_reboot_commandline.yml @@ -28,7 +28,6 @@ references: - https://www.mandiant.com/resources/analyzing-dark-crystal-rat-backdoor tags: analytic_story: - - Source:Endpoint - DarkCrystal RAT asset_type: Endpoint cis20: @@ -38,7 +37,7 @@ tags: confidence: 50 context: - Source:Endpoint - - Stage:Impact + - Stage:Execution dataset: - https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/malware/reboot_logoff_commandline/sysmon.log impact: 60 diff --git a/detections/endpoint/windows_system_shutdown_commandline.yml b/detections/endpoint/windows_system_shutdown_commandline.yml index a59b541009..af7316edf4 100644 --- a/detections/endpoint/windows_system_shutdown_commandline.yml +++ b/detections/endpoint/windows_system_shutdown_commandline.yml @@ -27,7 +27,6 @@ references: - https://www.mandiant.com/resources/analyzing-dark-crystal-rat-backdoor tags: analytic_story: - - Source:Endpoint - DarkCrystal RAT asset_type: Endpoint cis20: @@ -37,7 +36,7 @@ tags: confidence: 70 context: - Source:Endpoint - - Stage:Impact + - Stage:Execution dataset: - https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/malware/dcrat/shutdown_commandline/sysmon.log impact: 70 From 521fedf58acb83bb4104db23b251e9751e29852d Mon Sep 17 00:00:00 2001 From: tccontre Date: Thu, 28 Jul 2022 10:11:52 +0200 Subject: [PATCH 07/17] dcrat-analytics2 --- detections/endpoint/cmd_carry_out_string_command_parameter.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/detections/endpoint/cmd_carry_out_string_command_parameter.yml b/detections/endpoint/cmd_carry_out_string_command_parameter.yml index 37830f5cf9..3740b61486 100644 --- a/detections/endpoint/cmd_carry_out_string_command_parameter.yml +++ b/detections/endpoint/cmd_carry_out_string_command_parameter.yml @@ -37,6 +37,7 @@ tags: - Hermetic Wiper - Living Off The Land - Azorult + - DarkCrystal RAT automated_detection_testing: passed confidence: 50 context: From e99ab33a15f7860a90788fe9965e7f4c49ee4796 Mon Sep 17 00:00:00 2001 From: tccontre Date: Thu, 28 Jul 2022 15:29:25 +0200 Subject: [PATCH 08/17] dcrat-analytics2 --- ...s_command_shell_dcrat_forkbomb_payload.yml | 77 +++++++++++++++++++ ...dows_system_time_discovery_w32tm_delay.yml | 76 ++++++++++++++++++ ...mand_shell_dcrat_forkbomb_payload.test.yml | 13 ++++ ...system_time_discovery_w32tm_delay.test.yml | 13 ++++ 4 files changed, 179 insertions(+) create mode 100644 detections/endpoint/windows_command_shell_dcrat_forkbomb_payload.yml create mode 100644 detections/endpoint/windows_system_time_discovery_w32tm_delay.yml create mode 100644 tests/endpoint/windows_command_shell_dcrat_forkbomb_payload.test.yml create mode 100644 tests/endpoint/windows_system_time_discovery_w32tm_delay.test.yml diff --git a/detections/endpoint/windows_command_shell_dcrat_forkbomb_payload.yml b/detections/endpoint/windows_command_shell_dcrat_forkbomb_payload.yml new file mode 100644 index 0000000000..5659908f19 --- /dev/null +++ b/detections/endpoint/windows_command_shell_dcrat_forkbomb_payload.yml @@ -0,0 +1,77 @@ +name: Windows Command Shell DCRat ForkBomb Payload +id: 2bb1a362-7aa8-444a-92ed-1987e8da83e1 +version: 1 +date: '2022-07-28' +author: Teoderick Contreras, Splunk +type: TTP +datamodel: +- Endpoint +description: The following analytic identifies DCRat "forkbomb" payload feature. + This technique was seen in dark crystal RAT backdoor capabilities where it will execute several cmd child process + executing "notepad.exe & pause". This analytic detects the multiple cmd.exe and child process notepad.exe execution using batch script + in the targeted host within 30s timeframe. this TTP can be a good pivot to check DCRat infection. +search: '| tstats `security_content_summariesonly` values(Processes.process) as process values(Processes.parent_process) as parent_process values(Processes.parent_process_id) as parent_process_id values(Processes.process_id) as process_id dc(Processes.parent_process_id) as parent_process_id_count dc(Processes.process_id) as process_id_count + min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes + where Processes.parent_process_name= "cmd.exe" (Processes.process_name = "notepad.exe" OR Processes.original_file_name= "notepad.exe") Processes.parent_process = "*.bat*" + by Processes.parent_process_name Processes.process_name Processes.original_file_name Processes.parent_process Processes.dest Processes.user _time + span=30s | where parent_process_id_count>= 10 AND process_id_count >=10 + | `drop_dm_object_name(Processes)` + | `security_content_ctime(firstTime)` + | `security_content_ctime(lastTime)` + | `windows_command_shell_dcrat_forkbomb_payload_filter`' +how_to_implement: To successfully implement this search, you need to be ingesting + logs with the process name, parent process, and command-line executions from your + endpoints. If you are using Sysmon, you must have at least version 6.0.4 of the + Sysmon TA. Tune and filter known instances of wermgr.exe may be used. +known_false_positives: unknown +references: +- https://cert.gov.ua/article/405538 +- https://malpedia.caad.fkie.fraunhofer.de/details/win.dcrat +- https://www.mandiant.com/resources/analyzing-dark-crystal-rat-backdoor +tags: + analytic_story: + - DarkCrystal RAT + asset_type: Endpoint + cis20: + - CIS 3 + - CIS 5 + - CIS 16 + confidence: 90 + context: + - Source:Endpoint + - Stage:Execution + dataset: + - https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/malware/dcrat/dcrat_forkbomb/sysmon.log + impact: 90 + kill_chain_phases: + - Exploitation + message: a multiple cmd.exe process with child process of notepad.exe in $dest$ + mitre_attack_id: + - T1059.003 + - T1059 + nist: + - DE.CM + observable: + - name: dest + type: Hostname + role: + - Victim + product: + - Splunk Enterprise + - Splunk Enterprise Security + - Splunk Cloud + required_fields: + - _time + - Processes.dest + - Processes.user + - Processes.parent_process_name + - Processes.parent_process + - Processes.original_file_name + - Processes.process_name + - Processes.process + - Processes.process_id + - Processes.parent_process_path + - Processes.process_path + - Processes.parent_process_id + risk_score: 81 + security_domain: endpoint diff --git a/detections/endpoint/windows_system_time_discovery_w32tm_delay.yml b/detections/endpoint/windows_system_time_discovery_w32tm_delay.yml new file mode 100644 index 0000000000..ccd9bb57a8 --- /dev/null +++ b/detections/endpoint/windows_system_time_discovery_w32tm_delay.yml @@ -0,0 +1,76 @@ +name: Windows System Time Discovery W32tm Delay +id: b2cc69e7-11ba-42dc-a269-59c069a48870 +version: 1 +date: '2022-07-28' +author: Teoderick Contreras, Splunk +type: Anomaly +datamodel: +- Endpoint +description: The following analytic identifies DCRat delay time tactics using w32tm. + This technique was seen in DCRAT malware where it uses stripchart function of w32tm.exe application to delay the execution of its payload like + c2 communication , beaconing and execution. This anomaly detection may help the analyst to check other possible event like the process who + execute this command that may lead to DCRat attack. +search: '| tstats `security_content_summariesonly` values(Processes.process) as process min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes + where Processes.process_name = w32tm.exe Processes.process= "* /stripchart *" Processes.process= "* /computer:localhost *" + Processes.process= "* /period:*" Processes.process= "* /dataonly *" Processes.process= "* /samples:*" + by Processes.parent_process Processes.process_name Processes.original_file_name Processes.process + Processes.process_id Processes.parent_process_id Processes.dest Processes.user + | `drop_dm_object_name(Processes)` + | `security_content_ctime(firstTime)` + | `security_content_ctime(lastTime)` + | `windows_system_time_discovery_w32tm_delay_filter`' +how_to_implement: To successfully implement this search, you need to be ingesting + logs with the process name, parent process, and command-line executions from your + endpoints. If you are using Sysmon, you must have at least version 6.0.4 of the + Sysmon TA. Tune and filter known instances of wermgr.exe may be used. +known_false_positives: unknown +references: +- https://cert.gov.ua/article/405538 +- https://malpedia.caad.fkie.fraunhofer.de/details/win.dcrat +- https://www.mandiant.com/resources/analyzing-dark-crystal-rat-backdoor +tags: + analytic_story: + - UPDATE_STORY_NAME + asset_type: Endpoint + cis20: + - CIS 3 + - CIS 5 + - CIS 16 + confidence: 60 + context: + - Source:Endpoint + - Stage:Execution + dataset: + - https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/malware/dcrat/dcrat_delay_execution/sysmon.log + impact: 60 + kill_chain_phases: + - Reconnaissance + message: execute w32tm + mitre_attack_id: + - T1124 + nist: + - DE.CM + observable: + - name: dest + type: Hostname + role: + - Victim + product: + - Splunk Enterprise + - Splunk Enterprise Security + - Splunk Cloud + required_fields: + - _time + - Processes.dest + - Processes.user + - Processes.parent_process_name + - Processes.parent_process + - Processes.original_file_name + - Processes.process_name + - Processes.process + - Processes.process_id + - Processes.parent_process_path + - Processes.process_path + - Processes.parent_process_id + risk_score: 36 + security_domain: endpoint diff --git a/tests/endpoint/windows_command_shell_dcrat_forkbomb_payload.test.yml b/tests/endpoint/windows_command_shell_dcrat_forkbomb_payload.test.yml new file mode 100644 index 0000000000..de588caeb8 --- /dev/null +++ b/tests/endpoint/windows_command_shell_dcrat_forkbomb_payload.test.yml @@ -0,0 +1,13 @@ +name: Windows Command Shell DCRat ForkBomb Payload Unit Test +tests: +- name: Windows Command Shell DCRat ForkBomb Payload + file: endpoint/windows_command_shell_dcrat_forkbomb_payload.yml + pass_condition: '| stats count | where count > 0' + earliest_time: -24h + latest_time: now + attack_data: + - file_name: sysmon.log + data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/malware/dcrat/dcrat_forkbomb/sysmon.log + source: XmlWinEventLog:Microsoft-Windows-Sysmon/Operational + sourcetype: xmlwineventlog + update_timestamp: true diff --git a/tests/endpoint/windows_system_time_discovery_w32tm_delay.test.yml b/tests/endpoint/windows_system_time_discovery_w32tm_delay.test.yml new file mode 100644 index 0000000000..e8b88cb666 --- /dev/null +++ b/tests/endpoint/windows_system_time_discovery_w32tm_delay.test.yml @@ -0,0 +1,13 @@ +name: Windows System Time Discovery W32tm Delay Unit Test +tests: +- name: Windows System Time Discovery W32tm Delay + file: endpoint/windows_system_time_discovery_w32tm_delay.yml + pass_condition: '| stats count | where count > 0' + earliest_time: -24h + latest_time: now + attack_data: + - file_name: sysmon.log + data: https://media.githubusercontent.com/media/splunk/attack_data/master/datasets/malware/dcrat/dcrat_delay_execution/sysmon.log + source: XmlWinEventLog:Microsoft-Windows-Sysmon/Operational + sourcetype: xmlwineventlog + update_timestamp: true From c9611980c2741600bc1956797c61870fe3548177 Mon Sep 17 00:00:00 2001 From: tccontre <26181693+tccontre@users.noreply.github.com> Date: Thu, 28 Jul 2022 15:31:45 +0200 Subject: [PATCH 09/17] Update windows_system_time_discovery_w32tm_delay.yml --- .../endpoint/windows_system_time_discovery_w32tm_delay.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/detections/endpoint/windows_system_time_discovery_w32tm_delay.yml b/detections/endpoint/windows_system_time_discovery_w32tm_delay.yml index ccd9bb57a8..8187ac4bc1 100644 --- a/detections/endpoint/windows_system_time_discovery_w32tm_delay.yml +++ b/detections/endpoint/windows_system_time_discovery_w32tm_delay.yml @@ -30,7 +30,7 @@ references: - https://www.mandiant.com/resources/analyzing-dark-crystal-rat-backdoor tags: analytic_story: - - UPDATE_STORY_NAME + - DarkCrystal RAT asset_type: Endpoint cis20: - CIS 3 From 972bd7b1764c4caa89bf913fec1a3de11e38fb65 Mon Sep 17 00:00:00 2001 From: tccontre <26181693+tccontre@users.noreply.github.com> Date: Thu, 28 Jul 2022 16:12:20 +0200 Subject: [PATCH 10/17] Update windows_system_logoff_commandline.yml --- detections/endpoint/windows_system_logoff_commandline.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/detections/endpoint/windows_system_logoff_commandline.yml b/detections/endpoint/windows_system_logoff_commandline.yml index 0513f7ab0f..aca3a025aa 100644 --- a/detections/endpoint/windows_system_logoff_commandline.yml +++ b/detections/endpoint/windows_system_logoff_commandline.yml @@ -33,7 +33,7 @@ tags: - CIS 3 - CIS 5 - CIS 16 - confidence: 70 + confidence: 80 context: - Source:Endpoint - Stage:Execution @@ -69,5 +69,5 @@ tags: - Processes.parent_process_path - Processes.process_path - Processes.parent_process_id - risk_score: 49 + risk_score: 56 security_domain: endpoint From b2d1bdb62ef7928204d46f46d9a11490e490736f Mon Sep 17 00:00:00 2001 From: Bhavin Patel Date: Thu, 28 Jul 2022 13:23:07 -0700 Subject: [PATCH 11/17] Update windows_system_shutdown_commandline.yml --- detections/endpoint/windows_system_shutdown_commandline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/detections/endpoint/windows_system_shutdown_commandline.yml b/detections/endpoint/windows_system_shutdown_commandline.yml index af7316edf4..cda1ec3ef4 100644 --- a/detections/endpoint/windows_system_shutdown_commandline.yml +++ b/detections/endpoint/windows_system_shutdown_commandline.yml @@ -3,7 +3,7 @@ id: 4fee57b8-d825-4bf3-9ea8-bf405cdb614c version: 1 date: '2022-07-27' author: Teoderick Contreras, Splunk -type: TTP +type: Anomaly datamodel: - Endpoint description: The following analytic identifies Windows commandlined to shutdown a windows host machine. From 1498d090fe4cfb42cc139f97b13f1fe62b1ec9a2 Mon Sep 17 00:00:00 2001 From: Bhavin Patel Date: Thu, 28 Jul 2022 13:23:33 -0700 Subject: [PATCH 12/17] Update windows_system_reboot_commandline.yml --- detections/endpoint/windows_system_reboot_commandline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/detections/endpoint/windows_system_reboot_commandline.yml b/detections/endpoint/windows_system_reboot_commandline.yml index 5e096c7d41..79a4ccb8d9 100644 --- a/detections/endpoint/windows_system_reboot_commandline.yml +++ b/detections/endpoint/windows_system_reboot_commandline.yml @@ -3,7 +3,7 @@ id: 97fc2b60-c8eb-4711-93f7-d26fade3686f version: 1 date: '2022-07-27' author: Teoderick Contreras, Splunk -type: TTP +type: Anomaly datamodel: - Endpoint description: The following analytic identifies Windows commandlined to reboot a windows host machine. From 8f78e18334bd50c7ab28e23d5678e120be89083b Mon Sep 17 00:00:00 2001 From: Bhavin Patel Date: Thu, 28 Jul 2022 13:24:39 -0700 Subject: [PATCH 13/17] Update windows_system_logoff_commandline.yml --- detections/endpoint/windows_system_logoff_commandline.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/detections/endpoint/windows_system_logoff_commandline.yml b/detections/endpoint/windows_system_logoff_commandline.yml index aca3a025aa..f1bd6ed549 100644 --- a/detections/endpoint/windows_system_logoff_commandline.yml +++ b/detections/endpoint/windows_system_logoff_commandline.yml @@ -3,7 +3,7 @@ id: 74a8133f-93e7-4b71-9bd3-13a66124fd57 version: 1 date: '2022-07-27' author: Teoderick Contreras, Splunk -type: TTP +type: Anomaly datamodel: - Endpoint description: The following analytic identifies Windows commandlined to logoff a windows host machine. @@ -42,7 +42,7 @@ tags: impact: 70 kill_chain_phases: - Exploitation - message: process that execute logoff commandline in $dest$ + message: Process name $process_name$ is seen to execute logoff commandline on $dest$ mitre_attack_id: - T1529 nist: From c0427508a97e8b578fefb637744325b2d50d9f59 Mon Sep 17 00:00:00 2001 From: Bhavin Patel Date: Thu, 28 Jul 2022 13:25:36 -0700 Subject: [PATCH 14/17] Update windows_command_shell_dcrat_forkbomb_payload.yml --- .../endpoint/windows_command_shell_dcrat_forkbomb_payload.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/detections/endpoint/windows_command_shell_dcrat_forkbomb_payload.yml b/detections/endpoint/windows_command_shell_dcrat_forkbomb_payload.yml index 5659908f19..0616c2a06c 100644 --- a/detections/endpoint/windows_command_shell_dcrat_forkbomb_payload.yml +++ b/detections/endpoint/windows_command_shell_dcrat_forkbomb_payload.yml @@ -45,7 +45,7 @@ tags: impact: 90 kill_chain_phases: - Exploitation - message: a multiple cmd.exe process with child process of notepad.exe in $dest$ + message: Multiple cmd.exe processes with child process of notepad.exe executed on $dest$ mitre_attack_id: - T1059.003 - T1059 From d71ddb7e264158688d4db426fa0149da9e75b453 Mon Sep 17 00:00:00 2001 From: Bhavin Patel Date: Thu, 28 Jul 2022 13:26:54 -0700 Subject: [PATCH 15/17] Update windows_system_reboot_commandline.yml --- detections/endpoint/windows_system_reboot_commandline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/detections/endpoint/windows_system_reboot_commandline.yml b/detections/endpoint/windows_system_reboot_commandline.yml index 79a4ccb8d9..55ed3995c9 100644 --- a/detections/endpoint/windows_system_reboot_commandline.yml +++ b/detections/endpoint/windows_system_reboot_commandline.yml @@ -43,7 +43,7 @@ tags: impact: 60 kill_chain_phases: - Exploitation - message: process that execute reboot commandline in $dest$ + message: Process $process_name$ that executed reboot via commandline on $dest$ mitre_attack_id: - T1529 nist: From 979dd8046657e9867b4dd77fff401556758e42ee Mon Sep 17 00:00:00 2001 From: Bhavin Patel Date: Thu, 28 Jul 2022 13:28:00 -0700 Subject: [PATCH 16/17] Update windows_system_shutdown_commandline.yml --- detections/endpoint/windows_system_shutdown_commandline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/detections/endpoint/windows_system_shutdown_commandline.yml b/detections/endpoint/windows_system_shutdown_commandline.yml index cda1ec3ef4..9374e4c8d5 100644 --- a/detections/endpoint/windows_system_shutdown_commandline.yml +++ b/detections/endpoint/windows_system_shutdown_commandline.yml @@ -42,7 +42,7 @@ tags: impact: 70 kill_chain_phases: - Exploitation - message: process that execute shutdown commandline in $dest$ + message: Process $process_name$ seen to execute shutdown via commandline on $dest$ mitre_attack_id: - T1529 nist: From f2731454b12f0647dc6807ebf8a9f7d328353fc7 Mon Sep 17 00:00:00 2001 From: Bhavin Patel Date: Thu, 28 Jul 2022 13:30:37 -0700 Subject: [PATCH 17/17] Update windows_system_time_discovery_w32tm_delay.yml --- .../endpoint/windows_system_time_discovery_w32tm_delay.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/detections/endpoint/windows_system_time_discovery_w32tm_delay.yml b/detections/endpoint/windows_system_time_discovery_w32tm_delay.yml index 8187ac4bc1..bc9a0438ae 100644 --- a/detections/endpoint/windows_system_time_discovery_w32tm_delay.yml +++ b/detections/endpoint/windows_system_time_discovery_w32tm_delay.yml @@ -45,7 +45,7 @@ tags: impact: 60 kill_chain_phases: - Reconnaissance - message: execute w32tm + message: Process name w32tm.exe is using suspcicious command line arguments $process$ on host $dest$. mitre_attack_id: - T1124 nist: