Try in Splunk Security Cloud

Description

The following hunting analytic is query built against a accidental feature using the latest Sysmon TA 3.0 (https://splunkbase.splunk.com/app/5709/) which maps the module load (ImageLoaded) to process_name. This analytic will deprecate once this is fixed. This hunting analytic identifies known libraries in Windows that may be used in a DLL search order hijack or DLL Sideloading setting. This may require recompiling the DLL, moving the DLL or moving the vulnerable process. The query looks for any running out of system32 or syswow64. Some libraries natively run out of other application paths and will need to be added to the exclusion as needed. The lookup is comprised of Microsoft native libraries identified within the Hijacklibs.net project.

  • Type: Hunting
  • Product: Splunk Enterprise, Splunk Enterprise Security, Splunk Cloud

  • Last Updated: 2023-11-07
  • Author: Michael Haag, Splunk
  • ID: 79c7d1fc-64c7-91be-a616-ccda752efe81

Annotations

ATT&CK

ATT&CK

ID Technique Tactic
T1574.001 DLL Search Order Hijacking Persistence, Privilege Escalation, Defense Evasion
T1574 Hijack Execution Flow Persistence, Privilege Escalation, Defense Evasion
Kill Chain Phase
  • Installation
  • Exploitation
NIST
  • DE.AE
CIS20
  • CIS 10
CVE
1
2
3
4
5
6
`sysmon` EventCode=7 NOT (process_path IN ("*\\system32\\*", "*\\syswow64\\*","*\\winsxs\\*","*\\wbem\\*")) 
| lookup hijacklibs library AS process_name OUTPUT islibrary 
| search islibrary = True 
|rename process_name AS ImageLoaded process_path AS Module_Path 
| stats count values(parent_process_name) as parent_process_name by _time dest ImageLoaded Module_Path 
| `windows_dll_search_order_hijacking_hunt_with_sysmon_filter`

Macros

The SPL above uses the following Macros:

:information_source: windows_dll_search_order_hijacking_hunt_with_sysmon_filter is a empty macro by default. It allows the user to filter out any results (false positives) without editing the SPL.

Lookups

The SPL above uses the following Lookups:

Required fields

List of fields required to use this analytic.

  • _time
  • dest
  • ImageLoaded
  • Module_Path

How To Implement

The latest Sysmon TA 3.0 https://splunkbase.splunk.com/app/5709 will add the ImageLoaded name to the process_name field, allowing this query to work. Use as an example and implement for other products.

Known False Positives

False positives will be present based on paths. Filter or add other paths to the exclusion as needed.

Associated Analytic Story

RBA

Risk Score Impact Confidence Message
1.0 10 10 Potential Windows DLL Search Order Hijacking detected on $dest$

:information_source: The Risk Score is calculated by the following formula: Risk Score = (Impact * Confidence/100). Initial Confidence and Impact is set by the analytic author.

Reference

Test Dataset

Replay any dataset to Splunk Enterprise by using our replay.py tool or the UI. Alternatively you can replay a dataset into a Splunk Attack Range

source | version: 3