Try in Splunk Security Cloud

Description

The following analytic detects when DLLs with known abuse history are loaded from an unusual location. This activity may represent an attacker performing a DLL search order or sideload hijacking technique. These techniques are used to gain persistence as well as elevate privileges on the target system. This detection relies on Sysmon EID7 and is compatible with all Officla Sysmon TA versions.

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

  • Last Updated: 2024-04-06
  • Author: Steven Dick
  • ID: dd6d1f16-adc0-4e87-9c34-06189516b803

Annotations

ATT&CK

ATT&CK

ID Technique Tactic
T1574.001 DLL Search Order Hijacking Persistence, Privilege Escalation, Defense Evasion
T1574.002 DLL Side-Loading Persistence, Privilege Escalation, Defense Evasion
T1574 Hijack Execution Flow Persistence, Privilege Escalation, Defense Evasion
Kill Chain Phase
  • Installation
  • Exploitation
NIST
  • DE.CM
CIS20
  • CIS 10
CVE
1
2
3
4
5
6
7
8
9
10
11
12
13
`sysmon` ImageLoaded EventCode=7 NOT ImageLoaded IN ("*\\Program Files*","*\\system32\\*", "*\\syswow64\\*","*\\winsxs\\*","*\\wbem\\*") 
| stats latest(ProcessGuid) as process_guid, count, min(_time) as firstTime, max(_time) as lastTime by User, Computer, Image, ImageLoaded 
| rename User as user, Computer as dest, Image as process, ImageLoaded as loaded_file 
| eval process_name = case(isnotnull(process),replace(process,"(.*\\\)(?=.*(\.\w*)$
|(\w+)$)","")), loaded_file_path = case(isnotnull(loaded_file), replace(loaded_file, "(:[\w\. ]+)", "")), loaded_file = case(isnotnull(loaded_file),replace(loaded_file,"(.*\\\)(?=.*(\.\w*)$
|(\w+)$)","")), user = case(NOT user IN ("-"), replace(user, "(.*)\\\(.+)$","\2")) 
| lookup hijacklibs_loaded library AS loaded_file OUTPUT islibrary comment as desc 
| lookup hijacklibs_loaded library AS loaded_file excludes as loaded_file_path OUTPUT islibrary as excluded 
| search islibrary = TRUE AND excluded = false 
| stats values(*) as * by dest, process_name, process, process_guid, loaded_file, loaded_file_path 
| `security_content_ctime(firstTime)` 
| `security_content_ctime(lastTime)` 
| `windows_known_abused_dll_loaded_suspiciously_filter`

Macros

The SPL above uses the following Macros:

:information_source: windows_known_abused_dll_loaded_suspiciously_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
  • Image
  • ImageLoaded
  • Computer
  • ProcessGuid

How To Implement

The following analytic requires Sysmon operational logs to be imported, with EID7 being mapped to the process_name field. Modify the sysmon macro as needed to match the sourcetype or add index.

Known False Positives

DLLs being loaded by user mode programs for legitimate reasons.

Associated Analytic Story

RBA

Risk Score Impact Confidence Message
10.0 40 25 The module [$loaded_file$] was loaded from an unusual location by [$process$]

: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: 2