You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/windows-hardening/windows-local-privilege-escalation/dll-hijacking/README.md
+73-14Lines changed: 73 additions & 14 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -31,7 +31,7 @@ and just show the **File System Activity**:
31
31
.png>)
32
32
33
33
If you are looking for **missing dlls in general** you **leave** this running for some **seconds**.\
34
-
If you are looking for a **missing dll inside an specific executable** you should set **another filter like "Process Name" "contains" "\<exec name>", execute it, and stop capturing events**.
34
+
If you are looking for a **missing dll inside an specific executable** you should set **another filter like "Process Name" "contains" `<exec name>`, execute it, and stop capturing events**.
35
35
36
36
## Exploiting Missing Dlls
37
37
@@ -76,6 +76,9 @@ Notes/limitations
76
76
77
77
Minimal C example (ntdll, wide strings, simplified error handling):
78
78
79
+
<details>
80
+
<summary>Full C example: forcing DLL sideloading via RTL_USER_PROCESS_PARAMETERS.DllPath</summary>
81
+
79
82
```c
80
83
#include<windows.h>
81
84
#include<winternl.h>
@@ -147,6 +150,8 @@ int wmain(void) {
147
150
}
148
151
```
149
152
153
+
</details>
154
+
150
155
Operational usage example
151
156
- Place a malicious xmllite.dll (exporting the required functions or proxying to the real one) in your DllPath directory.
152
157
- Launch a signed binary known to look up xmllite.dll by name using the above technique. The loader resolves the import via the supplied DllPath and sideloads your DLL.
@@ -187,7 +192,7 @@ for %%A in ("%path:;=";"%") do ( cmd.exe /c icacls "%%~A" 2>nul | findstr /i "(F
187
192
188
193
You can also check the imports of an executable and the exports of a dll with:
Note that in several cases the Dll that you compile must **export several functions** that are going to be loaded by the victim process, if these functions doesn't exist the **binary won't be able to load** them and the **exploit will fail**.
## Case Study: Narrator OneCore TTS Localization DLL Hijack (Accessibility/ATs)
346
+
347
+
Windows Narrator.exe still probes a predictable, language-specific localization DLL on start that can be hijacked for arbitrary code execution and persistence.
// Suspend/quiet Narrator main thread, then run payload
365
+
// (see PoC for implementation details)
366
+
}
367
+
return TRUE;
368
+
}
369
+
```
370
+
371
+
OPSEC silence
372
+
- A naive hijack will speak/highlight UI. To stay quiet, on attach enumerate Narrator threads, open the main thread (`OpenThread(THREAD_SUSPEND_RESUME)`) and `SuspendThread` it;continuein your own thread. See PoC for full code.
373
+
374
+
Trigger and persistence via Accessibility configuration
- RDP to the host, at the logon screen press CTRL+WIN+ENTER to launch Narrator; your DLL executes as SYSTEM on the secure desktop.
382
+
- Execution stops when the RDP session closes—inject/migrate promptly.
383
+
384
+
Bring Your Own Accessibility (BYOA)
385
+
- You can clone a built-in Accessibility Tool (AT) registry entry (e.g., CursorIndicator), edit it to point to an arbitrary binary/DLL, import it, thenset`configuration` to that AT name. This proxies arbitrary execution under the Accessibility framework.
386
+
387
+
Notes
388
+
- Writing under `%windir%\System32` and changing HKLM values requires admin rights.
389
+
- All payload logic can live in`DLL_PROCESS_ATTACH`; no exports are needed.
390
+
325
391
## Case Study: CVE-2025-1729 - Privilege Escalation Using TPQMAssistant.exe
326
392
327
393
This case demonstrates **Phantom DLL Hijacking**in Lenovo's TrackPoint Quick Menu (`TPQMAssistant.exe`), tracked as **CVE-2025-1729**.
3. If an administrator is logged in when the task executes, the malicious DLL runs in the administrator's session at medium integrity.
357
423
4. Chain standard UAC bypass techniques to elevate from medium integrity to SYSTEM privileges.
358
424
359
-
### Mitigation
360
-
361
-
Lenovo released UWP version **1.12.54.0** via the Microsoft Store, which installs TPQMAssistant under `C:\Program Files (x86)\Lenovo\TPQM\TPQMAssistant\`, removes the vulnerable scheduled task, and uninstalls the legacy Win32 components.
362
-
363
425
## References
364
426
365
427
- [CVE-2025-1729 - Privilege Escalation Using TPQMAssistant.exe](https://trustedsec.com/blog/cve-2025-1729-privilege-escalation-using-tpqmassistant-exe)
366
428
- [Microsoft Store - TPQM Assistant UWP](https://apps.microsoft.com/detail/9mz08jf4t3ng)
- [Check Point Research – Nimbus Manticore Deploys New Malware Targeting Europe](https://research.checkpoint.com/2025/nimbus-manticore-deploys-new-malware-targeting-europe/)
432
+
- [TrustedSec – Hack-cessibility: When DLL Hijacks Meet Windows Helpers](https://trustedsec.com/blog/hack-cessibility-when-dll-hijacks-meet-windows-helpers)
0 commit comments