Blog
WINDOWS APPLICATION SECURITY

DLL Search-Order Hijacking to RCE on a Business Automation Client

PROC MON // SEARCH ORDER // CODE EXECUTION

Summary

A Windows business-automation desktop client loaded libraries using relative search order without integrity checks. Planting a DLL in a preferred search location ran code when the application started. The first proof was a benign Calculator payload. The same load then accepted a remote-access payload.

A row of pale folders with one crimson folder set in the line

Theory: why desktop clients still pay

Web apps get most of the attention in bug bounty programs. Desktop line-of-business tools often ship with:

The working theory:

If Procmon shows NAME NOT FOUND for a DLL in a directory the user (or a low-priv process) can write, you likely have a loader bug — not a malware technique demo.

DLL search-order primer (attacker view)

When an application calls LoadLibrary("foo.dll") without a full path, Windows walks a search order. Exact order depends on SafeDllSearchMode and API variants, but the practical attacker preference is:

  1. Application directory (often writable on poorly packaged enterprise tools)
  2. Other early entries before system directories

If the real dependency lives later in the order — or is optional and missing — a planted foo.dll wins.

Enumeration methodology

1) Baseline with Process Monitor

Filter on the target PID/process name:

2) Rank candidates

Prefer DLLs that:

Exploitation path

Proof payload

Generate a DLL that executes a non-destructive proof (e.g., launch Calculator) to confirm:

  1. load order preference
  2. no signature gate
  3. stability (app doesn’t crash before your DllMain runs)

Plant

Copy the payload to the winning path identified in Procmon, matching the expected filename.

Validate

On next start:

Escalate

The same load accepted a second payload that opened a session. Without a signature check, the loader treats the planted file as a dependency.

Impact

Root causes

Mitigations (vendor)

Takeaway

DLL hijacking is “old,” but it remains high-signal against niche enterprise clients. The research skill is not generating the payload — it is seeing the missing load as a vulnerability class and proving impact with a clean chain from Procmon to shell.

Back to top