DLL sideloading: hunting it with Tanium Threat Response
DLL sideloading: hunting it with Tanium Threat Response
A signed executable you trust loads a DLL you do not. That is the whole technique, and it is why DLL sideloading turns up in Iranian espionage, Chinese PlugX operations, Russian diplomatic phishing, and Black Basta ransomware intrusions inside the same eighteen months. This walkthrough is written for hunters who already work in the question builder: it covers the Threat Response recorder questions that find the load event, the file write that preceded it, and the benign population you have to subtract before either one is useful. It does not cover in-memory module loading, and it does not cover macOS or Linux.
Key takeaways
-
DLL abuse is now one ATT&CK sub-technique, T1574.001 (Hijack Execution Flow: DLL). As of ATT&CK v19 it covers sideloading, search-order hijacking, DLL redirection and phantom hijacking together, and the former T1574.002 redirects to it.
-
It works because Windows resolves an unqualified DLL name against the application's own directory before
System32, so a planted DLL beside a signed binary wins. -
The discriminator is not the signature on the executable, which is genuine. It is the directory: a trusted binary loading a module out of
AppData,ProgramData,Temp,DownloadsorUsers\Public. -
Attackers pick the host binary for its reputation, not for a CVE. Recent campaigns sideloaded through PowerPoint, an Electronic Arts game client, a Fortemedia audio-driver utility and a signed SentinelOne component.
-
Phantom hijacking and loader-path redirection need different questions, because no planted file sits beside the executable in a predictable place.
-
Trace Image Loadsanswers the load event andTrace File Operationsanswers who wrote the file. The pair is what separates a hijack from an untidy install directory. -
The recorder already holds the history, so the lookback needs nothing deployed in advance for this hunt.
Prerequisites
|
Requirement |
Detail |
|
Modules |
Threat Response, with the recorder collecting image-load and file-operation events. |
|
Endpoints |
Windows. |
|
RBAC |
|
Not covered: reflective and in-memory module loading, AppInit_DLLs and other registry-driven load paths, and anything on a non-Windows endpoint.
How DLL sideloading works
When an application calls LoadLibrary("version.dll") rather than passing a full path, Windows resolves the name against a fixed search order that begins with the directory the application itself was loaded from and only then reaches System32. An attacker who can write a file next to a signed executable therefore wins before the operating system looks anywhere useful. The malicious code then runs inside a process with a legitimate vendor signature, a legitimate parent, and a legitimate name, and nothing new appears in the process list.
DLLs named in HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\KnownDlls are the exception. Those always resolve from System32 and cannot be hijacked this way, which is worth knowing before you spend triage time on a kernel32.dll sitting in an application folder.
Which binaries attackers pick, and where the DLL lands
They pick binaries whose directories nobody questions. Check Point's review of a decade of DLL hijacking, published in September 2024, found that just over half the surveyed MITRE-catalogued campaigns used the simplest possible form, a benign executable and a malicious DLL shipped together in one folder, and that attackers reach repeatedly for credible-sounding applications from well-known vendors, security products among them.
The 2025 and 2026 casework bears that out, and the staging directories are the part a hunter can act on.
In Check Point's April 2025 analysis of APT29, a wine-tasting phishing lure delivered an archive holding a legitimate PowerPoint executable, wine.exe, alongside ppcore.dll, the GRAPELOADER loader, executed through PowerPoint's delayed imports. It persisted by copying the archive to C:\Users\User\AppData\Local\POWERPNT\ and pointing a Run key at it. Trend Micro's February 2025 write-up on Earth Preta has a dropper placing a legitimate Electronic Arts binary, OriginLegacyCLI.exe, into ProgramData\session\ to sideload EACore.dll, a TONESHELL variant that branches its injection method depending on whether ESET processes are running.
Sophos's January 2025 report on two ransomware campaigns puts both halves of the technique in user-writable space. In the cluster Sophos tracks as STAC5777, which overlaps with Storm-1811 and ended in an attempted Black Basta deployment, a Microsoft-signed OneDriveStandaloneUpdater.exe was staged in C:\Users\<username>\AppData\Local\OneDriveUpdate\ next to a malicious winhttp.dll carrying version metadata copied from a legitimate ESET file. In the STAC5143 cluster, a dropped ProtonVPN.exe in C:\users\public\downloads\ sideloaded nethost.dll.
Symantec's Threat Hunter Team reported in May 2026 that Seedworm staged two sideload pairs together under %USERPROFILE%\AppData\Local\[RANDOM]\: Fortemedia's fmapp.exe with fmapp.dll, and a signed SentinelOne component, sentinelmemoryscanner.exe, with sentinelagentcore.dll. Recorded Future's January 2025 RedDelta reporting lists the same shape across an eighteen-month PlugX campaign, in directories including C:\Users\Public\SecurityScan\ and C:\ProgramData\SamsungDriver\, each holding a decoy binary such as ONENOTEM.exe beside a DLL named hid.dll or msi.dll.
Every one of those directories is writable by an ordinary user, which is what the questions below key on.
Choosing which paths and DLL names to hunt
Two of the questions below take an identifier you supply, and neither is a placeholder to leave alone.
For directories, start with the user-writable set the campaigns above keep using: AppData in both its Local and Roaming forms, ProgramData, Temp, Downloads and Users\Public. Elastic Security Labs, writing in 2023 about hunting suspicious Windows libraries, states that the most commonly targeted user-writable directories are ?:\Users\Public and ?:\ProgramData. Add whatever your own estate makes writable: a per-user application install root, a mapped share, a build output directory.
For DLL names, the HijackLibs project maintains a curated index of hijackable DLLs mapped to the executables that load them, with Sigma rules and a JSON and CSV feed. Cross-reference it against the software you actually run rather than hunting a generic top-ten list. The names in the reports above, version.dll, dwmapi.dll, uxtheme.dll, profapi.dll, cryptbase.dll and wtsapi32.dll, are a reasonable opening set: small, widely imported, and rarely outside the system directories for a legitimate reason.
Every question here needs the platform READ_SENSOR privilege, and content-set scoping means your results may be narrower than a full-rights operator's.
Step 1: unsigned images loaded from user-writable directories
Start broad. This asks the recorder which Windows endpoints loaded an unsigned image whose path passes through a user-writable directory in the last three days.
Get "Trace Image Loads"["3 days","","1","0","100","0","",".*([Tt][Ee][Mm][Pp]|[Aa][Pp][Pp][Dd][Aa][Tt][Aa]|[Dd][Oo][Ww][Nn][Ll][Oo][Aa][Dd][Ss]|[Pp][Rr][Oo][Gg][Rr][Aa][Mm][Dd][Aa][Tt][Aa]|[Pp][Uu][Bb][Ll][Ii][Cc]).*","","No",""] from all machines with "Is Windows" equals "True"
Returns Endpoint Name, Load Time (UTC), Process Name, Image Path, Image Hash and Signing Entity, one row per load event. Process Name carries the full path of the loading process, which is the sideload host; Image Path is the module it loaded. On unsigned rows Signing Entity is empty and Image Hash is frequently absent, so plan the pivot on path and loading process rather than on hash.
Three parameter choices shape that result, because the defaults are tuned for a different job. MakeStackable, at position 6, is "0" here, which keeps Endpoint Name and the timestamps in the output; at its default of "1" the sensor omits those columns and returns a prevalence view instead. MaxResultsPerHost, at position 5, is 100, the maximum; its default of 1 returns only the most recent matching event per endpoint. TreatInputAsRegEx, at position 3, must be "1" for the path filter to be read as a pattern at all.
The sensor caches for 900 seconds, so a read can predate a load event by up to fifteen minutes. On a large fleet this returns a lot before you have subtracted the baseline described below, so narrow the time range before widening the directory list.
Writing the path filter so it matches
The TreatInputAsRegEx parameter's own help text states the two rules that govern every filter in this post: matching is case-sensitive, and each expression must match the entire field's contents.
Both bite. Recorder image paths arrive in whatever case the loader used, which is not reliably the case you typed, so AppData written literally will miss appdata. And because the pattern is matched against the whole path rather than searched within it, a bare AppData matches nothing at all. It has to be wrapped as .*AppData.*.
The query above handles case with per-character classes, [Aa][Pp][Pp][Dd][Aa][Tt][Aa]. The (?i) prefix does the same job more readably and is the form Tanium's own shipped examples on these sensors use: the Trace File Operations sensor ships a built-in example whose file-path filter reads (?i).*\\wwwroot\\.*\.(asp|aspx|cfm|php|jsp)$. Either is fine. Leaving both out is what produces a filter that matches nothing.
Step 2: known hijack targets outside the system directories
Once you have a candidate DLL name list, invert the filter and hunt the name anywhere except the directories it legitimately belongs in. Negative lookaheads carry the exclusion.
Get "Trace Image Loads"["3 days","","1","0","100","0","","^(?!.*[\\/]([Ss][Yy][Ss][Tt][Ee][Mm]32|[Ss][Yy][Ss][Ww][Oo][Ww]64|[Ww][Ii][Nn][Ss][Xx][Ss])[\\/]).*[\\/](([Ss][Ss][Ss][Hh][Ii][Mm]\.[Dd][Ll][Ll])|([Cc][Bb][Ss][Pp][Rr][Oo][Vv][Ii][Dd][Ee][Rr]\.[Dd][Ll][Ll])|([Dd][Ii][Ss][Mm][Pp][Rr][Oo][Vv]\.[Dd][Ll][Ll])|([Oo][Ss][Pp][Rr][Oo][Vv][Ii][Dd][Ee][Rr]\.[Dd][Ll][Ll])|([Ll][Oo][Gg][Pp][Rr][Oo][Vv][Ii][Dd][Ee][Rr]\.[Dd][Ll][Ll]))$","","Either",""] from all machines with "Is Windows" equals "True"
Same columns as Step 1. Three things about the pattern are reusable whichever names you put in it. The separator is written as the character class [\\/] so it matches either slash direction. The exclusion is a lookahead anchored at ^, which lets you say "this name, but not from System32, SysWOW64 or WinSxS" inside the one parameter rather than filtering in the grid afterwards. And IsSigned, at position 10, is "Either" rather than "No", because a stolen or abused certificate is exactly the case you do not want filtered away: the Sophos DLL above carried forged ESET metadata, and the loaders in Check Point's September 2025 Nimbus Manticore analysis were signed with SSL.com certificates issued to shells impersonating European IT firms.
Swap in the names from your own HijackLibs cross-reference. An empty result means those specific names did not appear outside the system directories within the lookback, which is a narrower statement than "no sideloading here".
Step 3: how the DLL got there
A load event tells you a module was mapped. It does not tell you who wrote the file, and the writing process is usually the more interesting half. In the Sophos cases it was a Java stage and a remote-control session; in the Earth Preta case, a dropper built with a commercial installer builder.
Get "Trace File Operations"["3 days","","1","0","100","0",".*[Tt][Ee][Mm][Pp].*\.[Dd][Ll][Ll]$","","","",""] from all machines with "Is Windows" equals "True"
Get "Trace File Operations"["3 days","","1","0","100","0",".*([Dd]ownloads|[Pp]rogram[Dd]ata|[Pp]ublic).*\.[Dd][Ll][Ll]","","","",""] from all machines with "Is Windows" equals "True"
Both return Endpoint Name, Timestamp, File Path, Operation, Process Path, Domain and Username. Process Path is the answer you came for. Username and Domain tell you whether a DLL landed in a system path under a standard user's token, which is a strong signal on its own.
There is no Computer Name joined to either question, and there should not be. With MakeStackable at "0" the Trace sensors already return Endpoint Name as their first column, so joining Computer Name buys you a second copy of the same identity and a second sensor on the question. Save the join for the stacked case, where MakeStackable at "1" strips Endpoint Name and you genuinely need identity back.
Note the second pattern varies case only on the leading letters of each directory name. That covers the spellings Windows actually writes, but it is a reminder of the rule from Step 1: the match is case-sensitive, so a path stored in an unexpected case slips past.
Note too what is left empty. The Operation parameter sits at position 8 and accepts Create, Write, Delete, PermissionsChanged, Move or Open. Leave it blank on the first pass and read the Operation column instead. A single DLL routinely appears three times in these results, as Create, Write and Delete within the same second, and the three can carry different values in Process Path: one process compiles or extracts the file, another loads it, a third cleans it up. Picking one operation before you have seen that pattern throws away the part of the sequence that names the interesting process. Narrow on the second pass.
Trace File Operations is implemented on Windows, macOS and Linux, unlike Trace Image Loads. The questions above are scoped to Windows because the load-event half of the pair is Windows-only.
Reading the results
Run Step 1 against a healthy Windows fleet and the great majority of what comes back is Windows servicing. That population is stable and recurring, and worth naming once so you can subtract it permanently.
-
ssshim.dllloaded fromC:\Windows\SystemTemp\{GUID}\, bysvchost.exe,MoUsoCoreWorker.exeortaskhostw.exe. The Windows Update servicing stack, and the largest single source of unsigned image loads out of a temp path. -
CbsProvider.dll,DismProv.dll,DismCorePS.dll,OSProvider.dllandLogProvider.dllloaded fromC:\Windows\Temp\<GUID>\byDismHost.exein that same directory. This is component servicing, and it is structurally identical to a sideload: a host binary and its dependencies extracted together into a temp folder with a random name. A detection that fires on "signed executable loads its dependencies from a temp GUID directory" will fire on this. -
Installer bootstrappers, such as a Visual C++ redistributable executing from
C:\Windows\Temp\{GUID}\.be\, and browser updaters unpacking into their own named subdirectory underC:\Windows\SystemTemp\. -
Long-lived application state in
C:\ProgramData\<VendorName>\, where a vendor chose a writable location for a helper process instead ofProgram Files.
Step 3 adds two more that are worth knowing before they cost you an afternoon.
-
Randomly named DLLs written into
C:\Users\<name>\AppData\Local\Temp\<GUID>\bycsc.exeandpowershell.exe. This is the .NET compiler building a dynamic assembly, which is what PowerShell'sAdd-Typedoes. The filenames are eight random characters, the directory is a fresh GUID every time, and the file is deleted seconds later. It is also a technique attackers use, so the discriminator here is the command line of the PowerShell session, not the file. -
mpengine.dllandoffreg.*.dllcycling throughC:\ProgramData\Microsoft\Windows Defender\Definition Updates\{GUID}\, written byMsMpEng.exe. Defender definition updates, and the single largest source of.dllwrite events underProgramData.
Triage what survives in this order. A DLL in a per-user path outranks one in a machine-wide path, because C:\Windows\Temp is writable by servicing and C:\Users\<name>\AppData is not. A DLL whose name matches a system DLL but whose path does not outranks one with a vendor-specific name. A DLL written by a scripting or archive host such as powershell.exe, wscript.exe, mshta.exe, certutil.exe or a renamed archiver outranks one written by an installer. Last, sort on rarity: prevalence is the discriminator that survives contact with a signed attacker binary, since signature status will not separate these and the directory alone produces the servicing noise above.
To characterise that baseline rather than hunt it, set MakeStackable to "1". The sensor then drops Endpoint Name and the timestamps and returns a prevalence view, which is the right shape for "which module names does my fleet load from outside the system directories, and how widely".
The variants these questions do not cover
HijackLibs separates four subtypes, and the questions above are built for one of them. The distinction matters for what an empty result means.
Phantom DLL hijacking targets a module an application looks for but which does not ship with it. There is no legitimate file to compare against, only a load event for a name that should not have resolved at all. Step 2 catches it when the name is on your list; Step 1 catches it only when the planted file is unsigned and lands in a directory you filtered for.
Loader-path redirection does not plant the DLL beside the target binary. Check Point's September 2025 Nimbus Manticore analysis, linked above, describes a chain in which a first-stage sideload calls RtlCreateProcessParameters and sets the DllPath field so that a second, unrelated legitimate binary, a Windows Defender Advanced Threat Protection component, resolves xmllite.dll out of the attacker's archive directory. Trace Image Loads still sees the load, but the directory relationship these questions rely on is gone.
Environment-variable hijacking points a variable at an attacker-controlled directory, so the give-away is the variable rather than the file layout. Reflective and in-memory loading produces no image-load record for a file on disk, because there is no file, and needs a different data source entirely.
What this hunt does and does not establish
A row from Step 1 establishes that a process mapped a module from a given path at a given time. It does not establish that the module did anything, or that the load was unwanted. The servicing baseline above is the proof of that.
Your lookback is your recorder retention. A three-day window answers a three-day question. A sideload established six weeks ago and loading quietly ever since will show recent load events but no origin, because the file write that created it has aged out of the file-operation history. When Step 3 returns nothing for a path Step 1 flagged, read that as "the write predates the window", not as "nothing wrote it".
The unsigned filter is a convenience, not a test of intent. Signature status answers whether Windows could validate a chain, which is a different question from whether the vendor meant to ship that file. Several of the campaigns above used validly signed payloads, and the servicing DLLs in the baseline are unsigned in the recorder's view while being entirely legitimate. That is also why the two sensors have to be run together: Trace Image Loads sees the load and Trace File Operations sees the write, and one without the other leaves you either a module with no provenance or a dropped file with no evidence it was ever used.
Next steps
Build the baseline before you need it. Run Step 1 with MakeStackable set to "1" on a schedule, keep the resulting module-name and directory prevalence, and re-run it after every servicing wave so you can tell a new benign population from a new hostile one.
Then cross-reference your own software inventory against HijackLibs and turn the intersection into Step 2's name list instead of carrying a generic one. Start with the remote-management, backup and security agents in your estate: they are signed, they are installed everywhere, and their directories draw the least scrutiny.
-
Learn how you can stay ahead of the next zero-day with Tanium Security Operations and HuntIQ
About HuntIQ
HuntIQ is Tanium's threat hunting practice. Our hunters go hands-on-keyboard in customer environments, running hunt campaigns against live telemetry, triaging what surfaces, pivoting from one endpoint to the whole estate, and escalating with the evidence already attached. Alongside that we build the durable content behind it, the Signals, hunt packages, and recurring hunts your own analysts can run without us.