From 2230e866b41cd863556689409a69af0ff9b85fa9 Mon Sep 17 00:00:00 2001 From: tccontre Date: Tue, 9 Nov 2021 11:47:06 +0100 Subject: [PATCH 01/14] fix_issues --- .../cmdline_tool_not_executed_in_cmd_shell.yml | 12 ++++++------ .../office_application_spawn_rundll32_process.yml | 12 ++++++------ ...svr32_silent_and_install_param_dll_loading.yml} | 4 ++-- ... regsvr32_with_known_silent_switch_cmdline.yml} | 14 ++++++++------ ..._silent_and_install_param_dll_loading.test.yml} | 6 +++--- ...vr32_with_known_silent_switch_cmdline.test.yml} | 6 +++--- 6 files changed, 28 insertions(+), 26 deletions(-) rename detections/endpoint/{regsvr32_silent_param_dll_loading.yml => regsvr32_silent_and_install_param_dll_loading.yml} (94%) rename detections/endpoint/{suspicious_icedid_regsvr32_cmdline.yml => regsvr32_with_known_silent_switch_cmdline.yml} (81%) rename tests/endpoint/{regsvr32_silent_param_dll_loading.test.yml => regsvr32_silent_and_install_param_dll_loading.test.yml} (67%) rename tests/endpoint/{suspicious_icedid_regsvr32_cmdline.test.yml => regsvr32_with_known_silent_switch_cmdline.test.yml} (68%) diff --git a/detections/endpoint/cmdline_tool_not_executed_in_cmd_shell.yml b/detections/endpoint/cmdline_tool_not_executed_in_cmd_shell.yml index 67ac89ff4d..3b64b015eb 100644 --- a/detections/endpoint/cmdline_tool_not_executed_in_cmd_shell.yml +++ b/detections/endpoint/cmdline_tool_not_executed_in_cmd_shell.yml @@ -6,12 +6,12 @@ author: Teoderick Contreras, Splunk type: TTP datamodel: - Endpoint -description: This search is to detect a suspicious parent process execution of commandline - tool not in shell commandline. This technique was seen in FIN7 JSSLoader .net compile - payload where it run ipconfig.exe and systeminfo.exe using .net application. This - event cause some good TTP since those tool are commonly run in commandline not by - another application. This TTP is a good indicator for application gather host information - either an attacker or an automated tool made by admin. +description: This search is to detect a suspicious non-command shell process (e.g. cmd.exe, powershell.exe) + spawning windows console application (e.g ipconfig.exe, systeminfo.exe). + This technique was seen in FIN7 loader implant that executes existing windows console tools or application + to gather system information from the compromised host. + This TTP is a good indicator for possible advesaries implant, malware doing a recon on a target host + or a third party application run by administrator for audit purposes. search: '| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes where (Processes.process_name = "ipconfig.exe" OR Processes.process_name = "systeminfo.exe") AND NOT (Processes.parent_process_name diff --git a/detections/endpoint/office_application_spawn_rundll32_process.yml b/detections/endpoint/office_application_spawn_rundll32_process.yml index 28228cc7b7..68ca92df2d 100644 --- a/detections/endpoint/office_application_spawn_rundll32_process.yml +++ b/detections/endpoint/office_application_spawn_rundll32_process.yml @@ -10,12 +10,12 @@ description: this detection was designed to identifies suspicious spawned proces of known MS office application due to macro or malicious code. this technique can be seen in so many malware like trickbot that used MS office as its weapon or attack vector to initially infect the machines. -search: '| tstats `security_content_summariesonly` count values(Processes.process) - min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes - where (Processes.parent_process_name = "winword.exe" OR Processes.parent_process_name - = "excel.exe" OR Processes.parent_process_name = "powerpnt.exe") `process_rundll32` by - Processes.parent_process Processes.process_name Processes.process_id Processes.process_guid - Processes.user Processes.dest | `drop_dm_object_name("Processes")` | `security_content_ctime(firstTime)`|`security_content_ctime(lastTime)` +search: '| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes + where (Processes.parent_process_name = "winword.exe" OR Processes.parent_process_name = "excel.exe" OR Processes.parent_process_name = "powerpnt.exe") AND `process_rundll32` + by Processes.parent_process Processes.process_name Processes.process_id Processes.process_guid Processes.process Processes.user Processes.dest + | `drop_dm_object_name("Processes")` + | `security_content_ctime(firstTime)` + |`security_content_ctime(lastTime)` | `office_application_spawn_rundll32_process_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 diff --git a/detections/endpoint/regsvr32_silent_param_dll_loading.yml b/detections/endpoint/regsvr32_silent_and_install_param_dll_loading.yml similarity index 94% rename from detections/endpoint/regsvr32_silent_param_dll_loading.yml rename to detections/endpoint/regsvr32_silent_and_install_param_dll_loading.yml index 0a2c1bb9ea..818b641c0f 100644 --- a/detections/endpoint/regsvr32_silent_param_dll_loading.yml +++ b/detections/endpoint/regsvr32_silent_and_install_param_dll_loading.yml @@ -1,4 +1,4 @@ -name: Regsvr32 Silent Param Dll Loading +name: Regsvr32 Silent and Install Param Dll Loading id: f421c250-24e7-11ec-bc43-acde48001122 version: 1 date: '2021-10-04' @@ -17,7 +17,7 @@ search: '| tstats `security_content_summariesonly` count min(_time) as firstTime Processes.process="*/i*" Processes.process="*/s*" by Processes.dest Processes.parent_process Processes.process Processes.parent_process_name Processes.process_name Processes.original_file_name Processes.user | `drop_dm_object_name(Processes)` | `security_content_ctime(firstTime)` - | `security_content_ctime(lastTime)` | `regsvr32_silent_param_dll_loading_filter`' + | `security_content_ctime(lastTime)` | `regsvr32_silent_and_install_param_dll_loading_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/suspicious_icedid_regsvr32_cmdline.yml b/detections/endpoint/regsvr32_with_known_silent_switch_cmdline.yml similarity index 81% rename from detections/endpoint/suspicious_icedid_regsvr32_cmdline.yml rename to detections/endpoint/regsvr32_with_known_silent_switch_cmdline.yml index 2e9fe3108a..5f19e7df8a 100644 --- a/detections/endpoint/suspicious_icedid_regsvr32_cmdline.yml +++ b/detections/endpoint/regsvr32_with_known_silent_switch_cmdline.yml @@ -1,4 +1,4 @@ -name: Suspicious IcedID Regsvr32 Cmdline +name: Regsvr32 with Known Silent Switch Cmdline id: c9ef7dc4-eeaf-11eb-b2b6-acde48001122 version: 2 date: '2021-07-27' @@ -11,11 +11,13 @@ description: this search is to detect a suspicious regsvr32 commandline "-s" to dll that will download the 2nd stage loader that will download and decrypt the config payload. search: '| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time) - as lastTime from datamodel=Endpoint.Processes where `process_regsvr32` Processes.process=*-s* - by Processes.process_name Processes.process Processes.parent_process_name Processes.original_file_name - Processes.parent_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)` | `suspicious_icedid_regsvr32_cmdline_filter`' + as lastTime from datamodel=Endpoint.Processes where `process_regsvr32` + (Processes.process="*/i*" AND Processes.process="*/s*") OR Processes.process="*/si*" OR Processes.process="*-si*" by Processes.dest Processes.parent_process + Processes.process Processes.parent_process_name Processes.process_name Processes.original_file_name Processes.user + | `drop_dm_object_name(Processes)` + | `security_content_ctime(firstTime)` + | `security_content_ctime(lastTime)` + | `regsvr32_with_known_silent_switch_cmdline_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, diff --git a/tests/endpoint/regsvr32_silent_param_dll_loading.test.yml b/tests/endpoint/regsvr32_silent_and_install_param_dll_loading.test.yml similarity index 67% rename from tests/endpoint/regsvr32_silent_param_dll_loading.test.yml rename to tests/endpoint/regsvr32_silent_and_install_param_dll_loading.test.yml index a28aa579c6..11f1f4e2ab 100644 --- a/tests/endpoint/regsvr32_silent_param_dll_loading.test.yml +++ b/tests/endpoint/regsvr32_silent_and_install_param_dll_loading.test.yml @@ -1,7 +1,7 @@ -name: Regsvr32 Silent Param Dll Loading Unit Test +name: Regsvr32 Silent and Install Param Dll Loading Unit Test tests: -- name: Regsvr32 Silent Param Dll Loading - file: endpoint/regsvr32_silent_param_dll_loading.yml +- name: Regsvr32 Silent and Install Param Dll Loading + file: endpoint/regsvr32_silent_and_install_param_dll_loading.yml pass_condition: '| stats count | where count > 0' earliest_time: '-24h' latest_time: 'now' diff --git a/tests/endpoint/suspicious_icedid_regsvr32_cmdline.test.yml b/tests/endpoint/regsvr32_with_known_silent_switch_cmdline.test.yml similarity index 68% rename from tests/endpoint/suspicious_icedid_regsvr32_cmdline.test.yml rename to tests/endpoint/regsvr32_with_known_silent_switch_cmdline.test.yml index 6d0535e5e8..227303b0e9 100644 --- a/tests/endpoint/suspicious_icedid_regsvr32_cmdline.test.yml +++ b/tests/endpoint/regsvr32_with_known_silent_switch_cmdline.test.yml @@ -1,7 +1,7 @@ -name: Suspicious IcedID Regsvr32 Cmdline Unit Test +name: Regsvr32 with Known Silent Switch Cmdline Unit Test tests: -- name: Suspicious IcedID Regsvr32 Cmdline - file: endpoint/suspicious_icedid_regsvr32_cmdline.yml +- name: Regsvr32 with Known Silent Switch Cmdline + file: endpoint/regsvr32_with_known_silent_switch_cmdline.yml pass_condition: '| stats count | where count > 0' earliest_time: '-24h' latest_time: 'now' From 6b10f0549a9dc35cecfe5dc05c51df1aafbc6395 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 9 Nov 2021 11:21:57 +0000 Subject: [PATCH 02/14] Added detection testing service results inRegsvr32 Silent and Install Param Dll Loading From dbce330eb065f17611470ed39b66b145082e0dd4 Mon Sep 17 00:00:00 2001 From: tccontre Date: Tue, 9 Nov 2021 13:14:31 +0100 Subject: [PATCH 03/14] fix_issues --- .../office_application_drop_executable.yml | 18 ++++++++++++------ ...office_application_drop_executable.test.yml | 2 +- ...2_with_known_silent_switch_cmdline.test.yml | 2 +- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/detections/endpoint/office_application_drop_executable.yml b/detections/endpoint/office_application_drop_executable.yml index 3d970d16e8..5172053895 100644 --- a/detections/endpoint/office_application_drop_executable.yml +++ b/detections/endpoint/office_application_drop_executable.yml @@ -14,14 +14,20 @@ description: This search is to detect a suspicious MS office application that dr application search: '| tstats `security_content_summariesonly` count FROM datamodel=Endpoint.Processes where Processes.process_name IN ("winword.exe","excel.exe","powerpnt.exe","mspub.exe","visio.exe","wordpad.exe","wordview.exe") - by _time span=1h Processes.process_id Processes.process_name Processes.process Processes.dest - | `drop_dm_object_name(Processes)` | join process_guid, _time [| tstats `security_content_summariesonly` + by _time span=1h Processes.process_id Processes.process_name Processes.process Processes.dest Processes.process_guid + | `drop_dm_object_name(Processes)` + |rename process_guid as proc_guid + |join proc_guid, _time [| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time) as lastTime FROM datamodel=Endpoint.Filesystem where Filesystem.file_name IN ("*.exe","*.dll","*.pif","*.scr","*.js","*.vbs","*.vbe","*.ps1") - by _time span=1h Filesystem.dest Filesystem.file_create_time Filesystem.file_name - Filesystem.file_path | `drop_dm_object_name(Filesystem)` | fields _time dest file_create_time - file_name file_path process_name process_path process] | dedup file_create_time - | table dest, process_name, process, file_create_time, file_name, file_path | `office_application_drop_executable_filter`' + by _time span=1h Filesystem.dest Filesystem.file_create_time Filesystem.file_name Filesystem.process_guid + Filesystem.file_path + | `drop_dm_object_name(Filesystem)` + | rename process_guid as proc_guid + | fields _time dest file_create_time file_name file_path process_name process_path process proc_guid] + | dedup file_create_time + | table dest, process_name, process, file_create_time, file_name, file_path, proc_guid + | `office_application_drop_executable_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/tests/endpoint/office_application_drop_executable.test.yml b/tests/endpoint/office_application_drop_executable.test.yml index 397acb8085..cd4fc7a718 100644 --- a/tests/endpoint/office_application_drop_executable.test.yml +++ b/tests/endpoint/office_application_drop_executable.test.yml @@ -3,7 +3,7 @@ tests: - name: Office Application Drop Executable file: endpoint/office_application_drop_executable.yml pass_condition: '| stats count | where count > 0' - earliest_time: '-24h' + earliest_time: '-120d' latest_time: 'now' attack_data: - file_name: sysmon.log diff --git a/tests/endpoint/regsvr32_with_known_silent_switch_cmdline.test.yml b/tests/endpoint/regsvr32_with_known_silent_switch_cmdline.test.yml index 227303b0e9..3386ddfb46 100644 --- a/tests/endpoint/regsvr32_with_known_silent_switch_cmdline.test.yml +++ b/tests/endpoint/regsvr32_with_known_silent_switch_cmdline.test.yml @@ -3,7 +3,7 @@ tests: - name: Regsvr32 with Known Silent Switch Cmdline file: endpoint/regsvr32_with_known_silent_switch_cmdline.yml pass_condition: '| stats count | where count > 0' - earliest_time: '-24h' + earliest_time: '-150d' latest_time: 'now' attack_data: - file_name: windows-sysmon.log From 275c33f0e08f36ce5726e3be8ae014dfa32b0cc2 Mon Sep 17 00:00:00 2001 From: root Date: Tue, 9 Nov 2021 13:01:06 +0000 Subject: [PATCH 04/14] Added detection testing service results inOffice Application Drop Executable --- .../office_application_drop_executable.yml | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/detections/endpoint/office_application_drop_executable.yml b/detections/endpoint/office_application_drop_executable.yml index 5172053895..25b2f1dfa7 100644 --- a/detections/endpoint/office_application_drop_executable.yml +++ b/detections/endpoint/office_application_drop_executable.yml @@ -14,19 +14,16 @@ description: This search is to detect a suspicious MS office application that dr application search: '| tstats `security_content_summariesonly` count FROM datamodel=Endpoint.Processes where Processes.process_name IN ("winword.exe","excel.exe","powerpnt.exe","mspub.exe","visio.exe","wordpad.exe","wordview.exe") - by _time span=1h Processes.process_id Processes.process_name Processes.process Processes.dest Processes.process_guid - | `drop_dm_object_name(Processes)` - |rename process_guid as proc_guid - |join proc_guid, _time [| tstats `security_content_summariesonly` - count min(_time) as firstTime max(_time) as lastTime FROM datamodel=Endpoint.Filesystem + by _time span=1h Processes.process_id Processes.process_name Processes.process Processes.dest + Processes.process_guid | `drop_dm_object_name(Processes)` |rename process_guid as + proc_guid |join proc_guid, _time [| tstats `security_content_summariesonly` count + min(_time) as firstTime max(_time) as lastTime FROM datamodel=Endpoint.Filesystem where Filesystem.file_name IN ("*.exe","*.dll","*.pif","*.scr","*.js","*.vbs","*.vbe","*.ps1") - by _time span=1h Filesystem.dest Filesystem.file_create_time Filesystem.file_name Filesystem.process_guid - Filesystem.file_path - | `drop_dm_object_name(Filesystem)` - | rename process_guid as proc_guid - | fields _time dest file_create_time file_name file_path process_name process_path process proc_guid] - | dedup file_create_time - | table dest, process_name, process, file_create_time, file_name, file_path, proc_guid + by _time span=1h Filesystem.dest Filesystem.file_create_time Filesystem.file_name + Filesystem.process_guid Filesystem.file_path | `drop_dm_object_name(Filesystem)` + | rename process_guid as proc_guid | fields _time dest file_create_time file_name + file_path process_name process_path process proc_guid] | dedup file_create_time + | table dest, process_name, process, file_create_time, file_name, file_path, proc_guid | `office_application_drop_executable_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 From 6952e230252145f99c1bad860a9ea26dd439322f Mon Sep 17 00:00:00 2001 From: tccontre Date: Tue, 9 Nov 2021 14:31:18 +0100 Subject: [PATCH 05/14] fix_issue --- detections/endpoint/cmdline_tool_not_executed_in_cmd_shell.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/detections/endpoint/cmdline_tool_not_executed_in_cmd_shell.yml b/detections/endpoint/cmdline_tool_not_executed_in_cmd_shell.yml index 3b64b015eb..81e81e95c0 100644 --- a/detections/endpoint/cmdline_tool_not_executed_in_cmd_shell.yml +++ b/detections/endpoint/cmdline_tool_not_executed_in_cmd_shell.yml @@ -6,7 +6,7 @@ author: Teoderick Contreras, Splunk type: TTP datamodel: - Endpoint -description: This search is to detect a suspicious non-command shell process (e.g. cmd.exe, powershell.exe) +description: This search is to detect a suspicious non-command shell process (example of cmd shell process are cmd.exe, powershell.exe) spawning windows console application (e.g ipconfig.exe, systeminfo.exe). This technique was seen in FIN7 loader implant that executes existing windows console tools or application to gather system information from the compromised host. From 3df936ccc90107e597e51b2dc5d6782459751903 Mon Sep 17 00:00:00 2001 From: tccontre Date: Tue, 9 Nov 2021 15:24:18 +0100 Subject: [PATCH 06/14] fix_issues --- .../cmdline_tool_not_executed_in_cmd_shell.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/detections/endpoint/cmdline_tool_not_executed_in_cmd_shell.yml b/detections/endpoint/cmdline_tool_not_executed_in_cmd_shell.yml index 81e81e95c0..67ac89ff4d 100644 --- a/detections/endpoint/cmdline_tool_not_executed_in_cmd_shell.yml +++ b/detections/endpoint/cmdline_tool_not_executed_in_cmd_shell.yml @@ -6,12 +6,12 @@ author: Teoderick Contreras, Splunk type: TTP datamodel: - Endpoint -description: This search is to detect a suspicious non-command shell process (example of cmd shell process are cmd.exe, powershell.exe) - spawning windows console application (e.g ipconfig.exe, systeminfo.exe). - This technique was seen in FIN7 loader implant that executes existing windows console tools or application - to gather system information from the compromised host. - This TTP is a good indicator for possible advesaries implant, malware doing a recon on a target host - or a third party application run by administrator for audit purposes. +description: This search is to detect a suspicious parent process execution of commandline + tool not in shell commandline. This technique was seen in FIN7 JSSLoader .net compile + payload where it run ipconfig.exe and systeminfo.exe using .net application. This + event cause some good TTP since those tool are commonly run in commandline not by + another application. This TTP is a good indicator for application gather host information + either an attacker or an automated tool made by admin. search: '| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes where (Processes.process_name = "ipconfig.exe" OR Processes.process_name = "systeminfo.exe") AND NOT (Processes.parent_process_name From a5203495a7b99deaf307cbed419a711c952e4b8c Mon Sep 17 00:00:00 2001 From: tccontre Date: Tue, 9 Nov 2021 16:42:56 +0100 Subject: [PATCH 07/14] fix_issues --- .../regsvr32_silent_and_install_param_dll_loading.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/detections/endpoint/regsvr32_silent_and_install_param_dll_loading.yml b/detections/endpoint/regsvr32_silent_and_install_param_dll_loading.yml index 818b641c0f..dc8db508ac 100644 --- a/detections/endpoint/regsvr32_silent_and_install_param_dll_loading.yml +++ b/detections/endpoint/regsvr32_silent_and_install_param_dll_loading.yml @@ -13,10 +13,11 @@ description: This analytic is to detect a loading of dll using regsvr32 applicat pivot the parent process, parent commandline and commandline of the file that execute this regsvr32. search: '| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time) - as lastTime from datamodel=Endpoint.Processes where Processes.process_name = regsvr32.exe - Processes.process="*/i*" Processes.process="*/s*" by Processes.dest Processes.parent_process - Processes.process Processes.parent_process_name Processes.process_name Processes.original_file_name - Processes.user | `drop_dm_object_name(Processes)` | `security_content_ctime(firstTime)` + as lastTime from datamodel=Endpoint.Processes where `process_regsvr32` AND + ((Processes.process="*/i*" AND Processes.process="*/s*") OR Processes.process="*/si*" OR Processes.process="*-si*") by Processes.dest Processes.parent_process + Processes.process Processes.parent_process_name Processes.process_name Processes.original_file_name Processes.user + | `drop_dm_object_name(Processes)` + | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)` | `regsvr32_silent_and_install_param_dll_loading_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 From 97da96df03829978d359e9cdcf8225180e080b63 Mon Sep 17 00:00:00 2001 From: tccontre Date: Tue, 9 Nov 2021 16:47:05 +0100 Subject: [PATCH 08/14] fix_issues --- .../endpoint/regsvr32_with_known_silent_switch_cmdline.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/detections/endpoint/regsvr32_with_known_silent_switch_cmdline.yml b/detections/endpoint/regsvr32_with_known_silent_switch_cmdline.yml index 5f19e7df8a..d7fa8f944c 100644 --- a/detections/endpoint/regsvr32_with_known_silent_switch_cmdline.yml +++ b/detections/endpoint/regsvr32_with_known_silent_switch_cmdline.yml @@ -11,9 +11,9 @@ description: this search is to detect a suspicious regsvr32 commandline "-s" to dll that will download the 2nd stage loader that will download and decrypt the config payload. search: '| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time) - as lastTime from datamodel=Endpoint.Processes where `process_regsvr32` - (Processes.process="*/i*" AND Processes.process="*/s*") OR Processes.process="*/si*" OR Processes.process="*-si*" by Processes.dest Processes.parent_process - Processes.process Processes.parent_process_name Processes.process_name Processes.original_file_name Processes.user + as lastTime from datamodel=Endpoint.Processes where `process_regsvr32` AND Processes.process=*-s* + by Processes.process_name Processes.process Processes.parent_process_name Processes.original_file_name + Processes.parent_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)` From 0687655d8cfaab4f1525eb3619da10c0e8e374af Mon Sep 17 00:00:00 2001 From: root Date: Tue, 9 Nov 2021 16:08:37 +0000 Subject: [PATCH 09/14] Added detection testing service results inRegsvr32 with Known Silent Switch Cmdline --- .../regsvr32_with_known_silent_switch_cmdline.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/detections/endpoint/regsvr32_with_known_silent_switch_cmdline.yml b/detections/endpoint/regsvr32_with_known_silent_switch_cmdline.yml index d7fa8f944c..692bd3c3f7 100644 --- a/detections/endpoint/regsvr32_with_known_silent_switch_cmdline.yml +++ b/detections/endpoint/regsvr32_with_known_silent_switch_cmdline.yml @@ -13,11 +13,9 @@ description: this search is to detect a suspicious regsvr32 commandline "-s" to search: '| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes where `process_regsvr32` AND Processes.process=*-s* by Processes.process_name Processes.process Processes.parent_process_name Processes.original_file_name - Processes.parent_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)` - | `regsvr32_with_known_silent_switch_cmdline_filter`' + Processes.parent_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)` | `regsvr32_with_known_silent_switch_cmdline_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, From 84b0ef1c943cc9c38f0e1e0de0fa7a64a290c4c4 Mon Sep 17 00:00:00 2001 From: Michael Haag <5632822+MHaggis@users.noreply.github.com> Date: Tue, 9 Nov 2021 15:15:23 -0700 Subject: [PATCH 10/14] Modified queries --- .../endpoint/regsvr32_silent_and_install_param_dll_loading.yml | 2 +- .../endpoint/regsvr32_with_known_silent_switch_cmdline.yml | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/detections/endpoint/regsvr32_silent_and_install_param_dll_loading.yml b/detections/endpoint/regsvr32_silent_and_install_param_dll_loading.yml index dc8db508ac..1105f69008 100644 --- a/detections/endpoint/regsvr32_silent_and_install_param_dll_loading.yml +++ b/detections/endpoint/regsvr32_silent_and_install_param_dll_loading.yml @@ -14,7 +14,7 @@ description: This analytic is to detect a loading of dll using regsvr32 applicat this regsvr32. search: '| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes where `process_regsvr32` AND - ((Processes.process="*/i*" AND Processes.process="*/s*") OR Processes.process="*/si*" OR Processes.process="*-si*") by Processes.dest Processes.parent_process + Processes.process="*/i*" AND (Processes.process="*/s*" OR Processes.process="*-s*") by Processes.dest Processes.parent_process Processes.process Processes.parent_process_name Processes.process_name Processes.original_file_name Processes.user | `drop_dm_object_name(Processes)` | `security_content_ctime(firstTime)` diff --git a/detections/endpoint/regsvr32_with_known_silent_switch_cmdline.yml b/detections/endpoint/regsvr32_with_known_silent_switch_cmdline.yml index 692bd3c3f7..1f7f1b18b7 100644 --- a/detections/endpoint/regsvr32_with_known_silent_switch_cmdline.yml +++ b/detections/endpoint/regsvr32_with_known_silent_switch_cmdline.yml @@ -11,7 +11,7 @@ description: this search is to detect a suspicious regsvr32 commandline "-s" to dll that will download the 2nd stage loader that will download and decrypt the config payload. search: '| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time) - as lastTime from datamodel=Endpoint.Processes where `process_regsvr32` AND Processes.process=*-s* + as lastTime from datamodel=Endpoint.Processes where `process_regsvr32` AND (Processes.process=*-s* Processes.process=*/s*) by Processes.process_name Processes.process Processes.parent_process_name Processes.original_file_name Processes.parent_process Processes.process_id Processes.parent_process_id Processes.dest Processes.user | `drop_dm_object_name(Processes)` | `security_content_ctime(firstTime)` @@ -28,6 +28,7 @@ references: tags: analytic_story: - IcedID + - Suspicious Regsvr32 Activity automated_detection_testing: passed confidence: 80 context: From da26a79fa75b8596990c171e5d8fada0aeb2b32d Mon Sep 17 00:00:00 2001 From: Michael Haag <5632822+MHaggis@users.noreply.github.com> Date: Tue, 9 Nov 2021 15:17:11 -0700 Subject: [PATCH 11/14] missing OR --- .../endpoint/regsvr32_with_known_silent_switch_cmdline.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/detections/endpoint/regsvr32_with_known_silent_switch_cmdline.yml b/detections/endpoint/regsvr32_with_known_silent_switch_cmdline.yml index 1f7f1b18b7..b509720cda 100644 --- a/detections/endpoint/regsvr32_with_known_silent_switch_cmdline.yml +++ b/detections/endpoint/regsvr32_with_known_silent_switch_cmdline.yml @@ -11,7 +11,7 @@ description: this search is to detect a suspicious regsvr32 commandline "-s" to dll that will download the 2nd stage loader that will download and decrypt the config payload. search: '| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time) - as lastTime from datamodel=Endpoint.Processes where `process_regsvr32` AND (Processes.process=*-s* Processes.process=*/s*) + as lastTime from datamodel=Endpoint.Processes where `process_regsvr32` AND (Processes.process=*-s* OR Processes.process=*/s*) by Processes.process_name Processes.process Processes.parent_process_name Processes.original_file_name Processes.parent_process Processes.process_id Processes.parent_process_id Processes.dest Processes.user | `drop_dm_object_name(Processes)` | `security_content_ctime(firstTime)` From d992ded8856c4a16db2218092c3d7f09d5246577 Mon Sep 17 00:00:00 2001 From: mhaag-spl <5632822+MHaggis@users.noreply.github.com> Date: Wed, 10 Nov 2021 12:11:12 -0700 Subject: [PATCH 12/14] :aww-yeah: - now with more where match --- ...2_silent_and_install_param_dll_loading.yml | 25 ++++++++------ ...svr32_with_known_silent_switch_cmdline.yml | 34 ++++++++++++------- 2 files changed, 36 insertions(+), 23 deletions(-) diff --git a/detections/endpoint/regsvr32_silent_and_install_param_dll_loading.yml b/detections/endpoint/regsvr32_silent_and_install_param_dll_loading.yml index 1105f69008..bcdc1298b7 100644 --- a/detections/endpoint/regsvr32_silent_and_install_param_dll_loading.yml +++ b/detections/endpoint/regsvr32_silent_and_install_param_dll_loading.yml @@ -8,21 +8,18 @@ datamodel: - Endpoint description: This analytic is to detect a loading of dll using regsvr32 application with silent parameter and dllinstall execution. This technique was seen in several - RAT malware like remcos, njrat and APT's to load their malicious dll in the compromised + RAT malware similar to remcos, njrat and adversaries to load their malicious DLL on the compromised machine. This TTP may executed by normal 3rd party application so it is better to - pivot the parent process, parent commandline and commandline of the file that execute + pivot by the parent process, parent command-line and command-line of the file that execute this regsvr32. search: '| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes where `process_regsvr32` AND - Processes.process="*/i*" AND (Processes.process="*/s*" OR Processes.process="*-s*") by Processes.dest Processes.parent_process + Processes.process="*/i*" by Processes.dest Processes.parent_process Processes.process Processes.parent_process_name Processes.process_name Processes.original_file_name Processes.user | `drop_dm_object_name(Processes)` | `security_content_ctime(firstTime)` - | `security_content_ctime(lastTime)` | `regsvr32_silent_and_install_param_dll_loading_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. + | `security_content_ctime(lastTime)` | where match(process,"(?i)[\-|\/]s(il*e*n*t*)*") | `regsvr32_silent_and_install_param_dll_loading_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: Other third part application may used this parameter but not so common in base windows environment. references: @@ -41,7 +38,7 @@ tags: impact: 60 kill_chain_phases: - Exploitation - message: regsvr32 process with $process$ commandline in $dest$ + message: An instance of $parent_process_name$ spawning $process_name$ was identified on endpoint $dest$ by user $user$ attempting to load a DLL using the silent and dllinstall parameter. mitre_attack_id: - T1218 - T1218.010 @@ -54,6 +51,14 @@ tags: type: Hostname role: - Victim + - name: parent_process_name + type: Parent Process + role: + - Parent Process + - name: process_name + type: Process + role: + - Child Process product: - Splunk Enterprise - Splunk Enterprise Security @@ -72,4 +77,4 @@ tags: - Processes.process_path - Processes.parent_process_id risk_score: 36 - security_domain: endpoint + security_domain: endpoint \ No newline at end of file diff --git a/detections/endpoint/regsvr32_with_known_silent_switch_cmdline.yml b/detections/endpoint/regsvr32_with_known_silent_switch_cmdline.yml index b509720cda..17c34ca34d 100644 --- a/detections/endpoint/regsvr32_with_known_silent_switch_cmdline.yml +++ b/detections/endpoint/regsvr32_with_known_silent_switch_cmdline.yml @@ -6,16 +6,15 @@ author: Teoderick Contreras, Splunk type: TTP datamodel: - Endpoint -description: this search is to detect a suspicious regsvr32 commandline "-s" to execute - a dll files. This technique was seen in IcedID malware to execute its initial downloader +description: 'The following analytic identifies Regsvr32.exe utilizing the silent switch to load DLLs. This technique has most recently been seen in IcedID campaigns to load its initial dll that will download the 2nd stage loader that will download and decrypt the config - payload. + payload. The switch type may be either a hyphen `-` or forward slash `/`. This behavior is typically found with `-s`, and it is possible there are more switch types that may be used. \ + During triage, review parallel processes and capture any artifacts that may have landed on disk. Isolate and contain the endpoint as necessary.' search: '| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time) - as lastTime from datamodel=Endpoint.Processes where `process_regsvr32` AND (Processes.process=*-s* OR Processes.process=*/s*) - by Processes.process_name Processes.process Processes.parent_process_name Processes.original_file_name - Processes.parent_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)` | `regsvr32_with_known_silent_switch_cmdline_filter`' + as lastTime from datamodel=Endpoint.Processes where `process_regsvr32` by Processes.user + Processes.process_name Processes.process Processes.parent_process_name Processes.original_file_name + Processes.dest Processes.process_id | `drop_dm_object_name(Processes)` | `security_content_ctime(firstTime)` + | `security_content_ctime(lastTime)` | where match(process,"(?i)[\-|\/]s(il*e*n*t*)*") | `regsvr32_with_known_silent_switch_cmdline_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, @@ -25,6 +24,7 @@ known_false_positives: minimal. but network operator can use this application to dll. references: - https://app.any.run/tasks/56680cba-2bbc-4b34-8633-5f7878ddf858/ +- https://regexr.com/699e2 tags: analytic_story: - IcedID @@ -39,19 +39,27 @@ tags: impact: 70 kill_chain_phases: - Exploitation - message: regsvr32 process $process_name$ with commandline $process$ in host $dest$ + message: An instance of $parent_process_name$ spawning $process_name$ was identified on endpoint $dest$ by user $user$ attempting to load a DLL using the silent parameter. mitre_attack_id: - T1218 - T1218.010 observable: + - name: user + type: User + role: + - Victim - name: dest type: Hostname role: - Victim - - name: process_name - type: process name + - name: parent_process_name + type: Parent Process role: - - Attacker + - Parent Process + - name: process_name + type: Process + role: + - Child Process product: - Splunk Enterprise - Splunk Enterprise Security @@ -70,4 +78,4 @@ tags: - Processes.process_path - Processes.parent_process_id risk_score: 56 - security_domain: endpoint + security_domain: endpoint \ No newline at end of file From e784fbf50e355c49977666050a1b1b5812d38a34 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 10 Nov 2021 21:32:24 +0000 Subject: [PATCH 13/14] Added detection testing service results inRegsvr32 with Known Silent Switch Cmdline --- ...svr32_with_known_silent_switch_cmdline.yml | 26 ++++++++++++------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/detections/endpoint/regsvr32_with_known_silent_switch_cmdline.yml b/detections/endpoint/regsvr32_with_known_silent_switch_cmdline.yml index 17c34ca34d..b61635b3ea 100644 --- a/detections/endpoint/regsvr32_with_known_silent_switch_cmdline.yml +++ b/detections/endpoint/regsvr32_with_known_silent_switch_cmdline.yml @@ -6,15 +6,20 @@ author: Teoderick Contreras, Splunk type: TTP datamodel: - Endpoint -description: 'The following analytic identifies Regsvr32.exe utilizing the silent switch to load DLLs. This technique has most recently been seen in IcedID campaigns to load its initial - dll that will download the 2nd stage loader that will download and decrypt the config - payload. The switch type may be either a hyphen `-` or forward slash `/`. This behavior is typically found with `-s`, and it is possible there are more switch types that may be used. \ - During triage, review parallel processes and capture any artifacts that may have landed on disk. Isolate and contain the endpoint as necessary.' +description: The following analytic identifies Regsvr32.exe utilizing the silent switch + to load DLLs. This technique has most recently been seen in IcedID campaigns to + load its initial dll that will download the 2nd stage loader that will download + and decrypt the config payload. The switch type may be either a hyphen `-` or forward + slash `/`. This behavior is typically found with `-s`, and it is possible there + are more switch types that may be used. \ During triage, review parallel processes + and capture any artifacts that may have landed on disk. Isolate and contain the + endpoint as necessary. search: '| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time) - as lastTime from datamodel=Endpoint.Processes where `process_regsvr32` by Processes.user - Processes.process_name Processes.process Processes.parent_process_name Processes.original_file_name - Processes.dest Processes.process_id | `drop_dm_object_name(Processes)` | `security_content_ctime(firstTime)` - | `security_content_ctime(lastTime)` | where match(process,"(?i)[\-|\/]s(il*e*n*t*)*") | `regsvr32_with_known_silent_switch_cmdline_filter`' + as lastTime from datamodel=Endpoint.Processes where `process_regsvr32` by Processes.user + Processes.process_name Processes.process Processes.parent_process_name Processes.original_file_name + Processes.dest Processes.process_id | `drop_dm_object_name(Processes)` | `security_content_ctime(firstTime)` + | `security_content_ctime(lastTime)` | where match(process,"(?i)[\-|\/]s(il*e*n*t*)*") + | `regsvr32_with_known_silent_switch_cmdline_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, @@ -39,7 +44,8 @@ tags: impact: 70 kill_chain_phases: - Exploitation - message: An instance of $parent_process_name$ spawning $process_name$ was identified on endpoint $dest$ by user $user$ attempting to load a DLL using the silent parameter. + message: An instance of $parent_process_name$ spawning $process_name$ was identified + on endpoint $dest$ by user $user$ attempting to load a DLL using the silent parameter. mitre_attack_id: - T1218 - T1218.010 @@ -78,4 +84,4 @@ tags: - Processes.process_path - Processes.parent_process_id risk_score: 56 - security_domain: endpoint \ No newline at end of file + security_domain: endpoint From 4f784a6d0e38aab60b596d5d77be4e32d81baf8d Mon Sep 17 00:00:00 2001 From: root Date: Wed, 10 Nov 2021 21:32:56 +0000 Subject: [PATCH 14/14] Added detection testing service results inRegsvr32 Silent and Install Param Dll Loading --- ...2_silent_and_install_param_dll_loading.yml | 31 +++++++++++-------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/detections/endpoint/regsvr32_silent_and_install_param_dll_loading.yml b/detections/endpoint/regsvr32_silent_and_install_param_dll_loading.yml index bcdc1298b7..56621954a8 100644 --- a/detections/endpoint/regsvr32_silent_and_install_param_dll_loading.yml +++ b/detections/endpoint/regsvr32_silent_and_install_param_dll_loading.yml @@ -8,18 +8,21 @@ datamodel: - Endpoint description: This analytic is to detect a loading of dll using regsvr32 application with silent parameter and dllinstall execution. This technique was seen in several - RAT malware similar to remcos, njrat and adversaries to load their malicious DLL on the compromised - machine. This TTP may executed by normal 3rd party application so it is better to - pivot by the parent process, parent command-line and command-line of the file that execute - this regsvr32. + RAT malware similar to remcos, njrat and adversaries to load their malicious DLL + on the compromised machine. This TTP may executed by normal 3rd party application + so it is better to pivot by the parent process, parent command-line and command-line + of the file that execute this regsvr32. search: '| tstats `security_content_summariesonly` count min(_time) as firstTime max(_time) - as lastTime from datamodel=Endpoint.Processes where `process_regsvr32` AND - Processes.process="*/i*" by Processes.dest Processes.parent_process - Processes.process Processes.parent_process_name Processes.process_name Processes.original_file_name Processes.user - | `drop_dm_object_name(Processes)` - | `security_content_ctime(firstTime)` - | `security_content_ctime(lastTime)` | where match(process,"(?i)[\-|\/]s(il*e*n*t*)*") | `regsvr32_silent_and_install_param_dll_loading_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. + as lastTime from datamodel=Endpoint.Processes where `process_regsvr32` AND Processes.process="*/i*" + by Processes.dest Processes.parent_process Processes.process Processes.parent_process_name + Processes.process_name Processes.original_file_name Processes.user | `drop_dm_object_name(Processes)` + | `security_content_ctime(firstTime)` | `security_content_ctime(lastTime)` | where + match(process,"(?i)[\-|\/]s(il*e*n*t*)*") | `regsvr32_silent_and_install_param_dll_loading_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: Other third part application may used this parameter but not so common in base windows environment. references: @@ -38,7 +41,9 @@ tags: impact: 60 kill_chain_phases: - Exploitation - message: An instance of $parent_process_name$ spawning $process_name$ was identified on endpoint $dest$ by user $user$ attempting to load a DLL using the silent and dllinstall parameter. + message: An instance of $parent_process_name$ spawning $process_name$ was identified + on endpoint $dest$ by user $user$ attempting to load a DLL using the silent and + dllinstall parameter. mitre_attack_id: - T1218 - T1218.010 @@ -77,4 +82,4 @@ tags: - Processes.process_path - Processes.parent_process_id risk_score: 36 - security_domain: endpoint \ No newline at end of file + security_domain: endpoint