diff --git a/detections/endpoint/office_application_drop_executable.yml b/detections/endpoint/office_application_drop_executable.yml index 3d970d16e8..25b2f1dfa7 100644 --- a/detections/endpoint/office_application_drop_executable.yml +++ b/detections/endpoint/office_application_drop_executable.yml @@ -15,13 +15,16 @@ description: This search is to detect a suspicious MS office application that dr 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` - count min(_time) as firstTime max(_time) as lastTime FROM datamodel=Endpoint.Filesystem + 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`' + 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/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 51% rename from detections/endpoint/regsvr32_silent_param_dll_loading.yml rename to detections/endpoint/regsvr32_silent_and_install_param_dll_loading.yml index 0a2c1bb9ea..56621954a8 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' @@ -8,20 +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 like remcos, njrat and APT's to load their malicious dll in 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 - 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 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)` - | `security_content_ctime(lastTime)` | `regsvr32_silent_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. + 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: @@ -40,7 +41,9 @@ 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 @@ -53,6 +56,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 diff --git a/detections/endpoint/suspicious_icedid_regsvr32_cmdline.yml b/detections/endpoint/regsvr32_with_known_silent_switch_cmdline.yml similarity index 54% rename from detections/endpoint/suspicious_icedid_regsvr32_cmdline.yml rename to detections/endpoint/regsvr32_with_known_silent_switch_cmdline.yml index 2e9fe3108a..b61635b3ea 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' @@ -6,16 +6,20 @@ 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 - dll that will download the 2nd stage loader that will download and decrypt the config - payload. +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` 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` 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,9 +29,11 @@ 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 + - Suspicious Regsvr32 Activity automated_detection_testing: passed confidence: 80 context: @@ -38,19 +44,28 @@ 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 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_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 64% rename from tests/endpoint/suspicious_icedid_regsvr32_cmdline.test.yml rename to tests/endpoint/regsvr32_with_known_silent_switch_cmdline.test.yml index 6d0535e5e8..3386ddfb46 100644 --- a/tests/endpoint/suspicious_icedid_regsvr32_cmdline.test.yml +++ b/tests/endpoint/regsvr32_with_known_silent_switch_cmdline.test.yml @@ -1,9 +1,9 @@ -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' + earliest_time: '-150d' latest_time: 'now' attack_data: - file_name: windows-sysmon.log