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 | |
| Stealth |
References
Telemetry coverage
| Provider | Record / event type |
|---|---|
| Sysmon | Event ID 11: FileCreate |
Rule body
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
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
EventCode | eq |
| field:"EventID" kind:eq value:"11" |
TargetFilename | regex_match |
| field:"TargetFilename" kind:regex_match |
Search terms
These SPL tokens match against raw event text.
| Stage | Term |
|---|---|
| 1 | "<EventID>11<" |
| 1 | "iphlpapi.dll" |
| 1 | "\\AppData\\Local\\Microsoft" |