GhostInjector is a stealthy DLL injector that avoids traditional APIs like OpenProcess, CreateRemoteThread, or WriteProcessMemory. Instead, it uses thread hijacking combined with pre-existing gadgets in the target process to call LoadLibraryA. Powered by the woldann/NThread library.
- ❌ No
OpenProcess - ❌ No
CreateRemoteThread - ✅ Thread hijacking with
LoadLibraryAcall - ✅ Uses existing remote gadgets (e.g.,
malloc,memset,fread) - ✅ Injects DLL path using target’s own memory management functions
- ✅ Highly stealthy — avoids common injection detection vectors
- Identifies a thread in the target process (either specified directly or found by scanning).
- Finds the address of
LoadLibraryAwithin the remote process. - Allocates memory for the DLL path using
msvcrt.dll!mallocinside the target. - Writes the DLL path using existing functions like
memsetorfread. - Hijacks the target thread to call
LoadLibraryAwith the injected DLL path. - If a thread ID is provided, it attempts direct hijack. If it's a process ID, it enumerates threads and selects the first responsive one.
ghostinjector.exe <thread_id:DWORD or process_id:DWORD> <dll_path:string>