Detection rules › Splunk
iphlpapi.dll File Write to Appdata_Local_Microsoft (Sysmon)
Adversaries may execute their own malicious payloads by side-loading DLLs. Similar to DLL Search Order Hijacking, side-loading involves hijacking which DLL a program loads. But rather than just planting the DLL within the search order of a program then waiting for the victim application to be invoked, adversaries may directly side-load their payloads by planting then invoking a legitimate application that executes their payload(s). Researchers have reported that malicious documents can use DLL sideloading using Teams or OneDrive to establish C&C. This use case iphlpapi.dll file writes in a subfolder under the AppData\Local\Microsoft path, indicating potential abuse of Microsoft applications to sideload malicious DLLs.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Execution | T1574.002 Hijack Execution Flow: DLL Side-Loading |
| Stealth | T1574.002 Hijack Execution Flow: DLL Side-Loading |
References
Event coverage
| Provider | Event | Title |
|---|---|---|
| Sysmon | Event ID 11 | FileCreate |
Rule body yaml
id: '32477.57725'
title: iphlpapi.dll File Write to Appdata_Local_Microsoft
description: Adversaries may execute their own malicious payloads by side-loading
DLLs. Similar to DLL Search Order Hijacking, side-loading involves hijacking which
DLL a program loads. But rather than just planting the DLL within the search order
of a program then waiting for the victim application to be invoked, adversaries
may directly side-load their payloads by planting then invoking a legitimate application
that executes their payload(s). Researchers have reported that malicious documents
can use DLL sideloading using Teams or OneDrive to establish C&C. This use case
iphlpapi.dll file writes in a subfolder under the AppData\Local\Microsoft path,
indicating potential abuse of Microsoft applications to sideload malicious DLLs.
logic_format: Splunk
logic: '`get_endpoint_data` `get_endpoint_data_sysmon` (TERM(EventCode=11) OR "<EventID>11<")
"iphlpapi.dll" "\\AppData\\Local\\Microsoft" | regex TargetFilename="(?i)\x5cAppData\x5cLocal\x5cMicrosoft\x5c.*iphlpapi\.dll"
| table _time, host, user, process, process_*, file_* | bin span=1s | stats values(*)
as * by _time, host '
techniques:
- persistence:hijack execution flow:dll side-loading
technique_id:
- T1574.002
data_category:
- Windows Sysmon
references:
- https://attack.mitre.org/techniques/T1574/002/
- https://detection.fyi/sigmahq/sigma/windows/file/file_event/file_event_win_iphlpapi_dll_sideloading/
- https://cyble.com/blog/targeted-attacks-being-carried-out-via-dll-sideloading/
Stages and Predicates
Stage 1: search
`get_endpoint_data` `get_endpoint_data_sysmon` (TERM(EventCode=11) OR "<EventID>11<") "iphlpapi.dll" "\\AppData\\Local\\Microsoft"
Stage 2: regex
| regex TargetFilename="(?i)\x5cAppData\x5cLocal\x5cMicrosoft\x5c.*iphlpapi\.dll"
Stage 3: table
| table _time, host, user, process, process_*, file_*
Stage 4: bucket
| bin span=1s
Stage 5: stats
| stats values(*) as * by _time, host
Indicators
Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.
| Field | Kind | Values |
|---|---|---|
EventCode | eq |
|
TargetFilename | regex_match |
|
Search terms
Bare-string tokens in the SPL search body. Splunk matches each token against _raw (the untyped raw event text) anywhere it appears, not against a specific field. These don't surface in the Indicators table because they aren't predicates on a known field.
| Stage | Term |
|---|---|
| 1 | TERM |
| 1 | "<EventID>11<" |
| 1 | "iphlpapi.dll" |
| 1 | "\\AppData\\Local\\Microsoft" |