- DLLHijackHunter (GhostVector Academy, MIT) tự động hoá toàn bộ pipeline DLL hijacking trên Windows — Discovery, Filtration, Canary Confirmation, Scoring — và khác biệt ở chỗ thật sự build canary DLL, drop vào hijack path, trigger binary để chứng minh execution thay vì chỉ đoán.
TL;DR
- DLLHijackHunter là tool Windows open-source (MIT, .NET 8) của GhostVector Academy tự động hoá DLL hijacking discovery + validation + exploitation confirmation.
- Khác biệt lớn nhất: canary DLL build bằng MSVC
cl.exe, drop vào hijack path, auto-trigger service/task/COM để chứng minh thật sự load — ghi PID, privilege, integrity level. - Phủ 11 loại hijack: phantom, search order, side-loading, .local redirect, KnownDLL bypass, ENV PATH, CWD, AppInit_DLLs, IFEO, AppCertDLLs.
- 5 scan profile (aggressive / strict / safe / redteam / uac-bypass) để phù hợp lab, production, red team, blue team.
- Filter pipeline 2 tầng (hard gate + soft gate) để loại false positive — kiểm tra ACL writability, API set, KnownDLL, signature.
What's new
Phần lớn tool DLL hijacking hiện có (DLLSpy, Robber, WinPEAS, Procmon) dừng ở mức "DLL này có thể bị hijack". DLLHijackHunter đẩy thêm một bước: nó build một canary DLL vô hại ngay trong runtime bằng Microsoft Visual C++ compiler (cl.exe), thả vào vị trí hijack, rồi chủ động trigger binary victim — khởi động service, chạy scheduled task, activate COM object — để chứng minh canary thật sự load được.
Khi canary load thành công, nó ghi một file xác nhận chứa PID, quyền thực thi, và integrity level. Đây là bằng chứng execution không thể chối cãi, biến một "misconfig có thể khai thác" thành "privesc path đã được verify".
Why it matters
DLL hijacking được MITRE ATT&CK phân loại là T1574.001, thuộc nhóm Hijack Execution Flow, dùng cho cả persistence, privilege escalation, và defense evasion. Cơ chế gốc rất đơn giản: khi Windows cần load một DLL mà binary không chỉ absolute path, OS sẽ tìm lần lượt qua (1) thư mục app, (2) System32, (3) 16-bit system, (4) Windows dir, (5) current working directory, (6) thư mục trong PATH. Nếu attacker ghi được DLL độc hại vào bất kỳ vị trí nào trước location hợp lệ, OS sẽ load nó thay vì file thật.
Vấn đề với offensive/defensive workflow truyền thống: chứng minh một path hijackable thực sự dẫn tới code execution rất mất công — phải viết DLL giả, deploy, trigger bằng tay, quan sát log. DLLHijackHunter đóng gói toàn bộ chu trình đó thành một CLI chạy được trong lab lẫn production (với profile safe read-only).
Technical facts
Kiến trúc 4 phase:
- Phase 1 — Discovery: Static engine enum services, scheduled tasks, startup items, COM objects, run keys. AutoElevate engine scan System32/SysWOW64 tìm EXE có
<autoElevate>true</autoElevate>trong manifest + COM UAC bypass. PE Analyzer đọc import tables, delay loads, manifest, exports. ETW engine monitor DLL load real-time. Search Order Calculator tính thứ tự search cho từng binary. - Phase 2 — Filter Pipeline. Hard gates (binary kill): loại API set schema
api-ms-*/ext-ms-*, loại KnownDLL, verify ACL writability. Soft gates (confidence adjust): WinSxS manifest penalty, privilege delta, LoadLibraryEx mitigation, signature check, graceful error-handling penalty. - Phase 3 — Canary Confirmation: build canary bằng
cl.exe→ deploy vào hijack path → trigger binary (start service / run task / COM activate) → canary ghi confirmation file → tool record CONFIRMED và cleanup. - Phase 4 — Output: tiered scorer + console / JSON / HTML report.
Scan profile:
| Profile | Canary | ETW | UAC | Min Conf | Triggers |
|---|---|---|---|---|---|
| aggressive | ✅ | ✅ | ✅ | 15% | Svc, Task, COM |
| strict | ✅ | ✅ | ❌ | 80% | Svc, Task |
| safe | ❌ | ❌ | ❌ | 50% | None |
| redteam | ✅ | ✅ | ❌ | 50% | Svc, Task, COM |
| uac-bypass | ❌ | ❌ | ✅ | 20% | AutoElevate only |
Phủ 11 hijack type: Phantom, Search Order, Side-Loading, .local Redirect, KnownDLL Bypass, ENV PATH, CWD, AppInit_DLLs, IFEO, AppCertDLLs.
Comparison
So với các tool phổ biến trong cùng category:
| Feature | DLLHijackHunter | DLLSpy | Robber | WinPEAS | Procmon |
|---|---|---|---|---|---|
| Automated discovery | ✅ | ✅ | ✅ | ✅ | ❌ |
| Phantom DLL detection | ✅ | ✅ | ❌ | ❌ | ✅ |
| Search order analysis | ✅ | ❌ | ❌ | ❌ | ❌ |
| ACL writability check | ✅ (full) | ❌ | Partial | Basic | ❌ |
| ETW real-time monitoring | ✅ | ❌ | ❌ | ❌ | ✅ |
| Canary confirmation | ✅ | ❌ | ❌ | ❌ | ❌ |
| UAC bypass discovery | ✅ | ❌ | ❌ | ❌ | ❌ |
| Confidence scoring | ✅ | ❌ | ❌ | ❌ | ❌ |
| Auto trigger (svc/task/COM) | ✅ | ❌ | ❌ | ❌ | ❌ |
| HTML/JSON reporting | ✅ | ❌ | ❌ | TXT | ❌ |
DLLSpy (CyberArk) là tool gần nhất về scope — cả hai đều có phantom DLL detection và static/dynamic scan — nhưng DLLSpy dừng ở detection. DLLHijackHunter thêm toàn bộ lớp validation + auto-exploitation + UAC bypass.
Use cases
- Red team / pentester: dùng profile
redteamhoặcaggressiveđể có báo cáo chỉ chứa confirmed findings. Profileuac-bypasschuyên hunt AutoElevate vector, kết hợp side-load simulation cho binary không gọiSetDllDirectory/SetDefaultDllDirectories. - Blue team / IT audit: profile
safe(read-only, không drop DLL, không trigger) để triage production — chỉ list hijackable path với confidence ≥50%, export JSON/HTML để track và vá misconfig. - Security researcher: ETW real-time DLL load monitoring + HijackLibs-style threat intel correlation giúp nghiên cứu pattern third-party app ship cùng binary Windows hợp lệ.
Limitations & pricing
- License: MIT — open source, miễn phí hoàn toàn.
- Requirement: Windows 10/11 hoặc Server 2016+, .NET 8 runtime (hoặc self-contained build). Admin privilege khuyến nghị cho ETW, canary deployment, service trigger.
- Canary mode ghi file DLL lên disk → có thể bị EDR/AV pick up; không dùng trên production thật.
- Trigger có thể start/stop service/task tạm thời — vì thế
safelà default cho production triage. - Proxy/export-forwarding canary là experimental: có thể fail với target có ordinal-only exports, decorated export names, calling-convention mismatch. Fail proxy canary không có nghĩa hijack path impossible.
What's next
Tool đang ở giai đoạn community-driven (MIT, topics bug-bounty / red-team / dll-sideloading trên GitHub). README flag proxy canary là experimental và knowledge base kiểu HijackLibs đang mở rộng. Nếu bạn làm Windows security, đây là addition đáng add vào lab — ít nhất để hiểu cách một chain từ "file có thể writable" → "SYSTEM shell" được verify end-to-end.
Nhắc lại tuyên bố trong README: tool dành cho defensive research, lab validation, auditing, và red-team simulation trong môi trường được phép. Dùng trên hệ thống không có ủy quyền = vi phạm pháp luật.
Nguồn: GitHub ghostvectoracademy/DLLHijackHunter, MITRE ATT&CK T1574.001, Red Canary, CrowdStrike, CyberArk DLLSpy.

