Description
🔥 Learn How To Detect Suspicious Threads
👨💻 Buy Our Courses: https://guidedhacking.com/register/
💰 Donate on Patreon: https://patreon.com/guidedhacking
❤️ Follow us on Social Media: https://linktr.ee/guidedhacking
GuidedHacking® - The Game Hacking Bible® - © 2025 Guided Hacking LLC. All Rights Reserved.
#reverseengineering #gamehacking #cpp
In this tutorial, we're addressing a common challenge in DLL injection: the detection of injected DLLs due to suspicious-looking threads. We'll dive into the mechanics of threads, specifically focusing on injected threads, and provide solutions to mitigate detection risks.
The Basics of Thread Creation and Hooking
When a new thread is created, the base thread initialization thunk (BaseThreadInitThunk) is invoked. This process involves setting an address to the original function and implementing a function hook. For demonstration, we use a while true loop in our program, which includes our base thread and its hook.
Identifying Thread Start Addresses
The start address of a thread is crucial for detection. In our example, using GH Injector to inject a DLL, we note two types of start addresses:
Randomly Allocated Memory: Appears as an arbitrary memory address.
Valid Address: Resembles a legitimate memory address.
Using Cheat Engine, we can differentiate these addresses. A valid address might point to a module in the system (e.g., ntdll.dll), whereas a randomly allocated address may not exist in memory post-injection.
Detecting Suspicious Threads
The key to thread detection lies in analyzing the memory type of the thread start address. We utilize VirtualQuery to obtain memory information and check if the type is MEM_IMAGE. If not, it indicates an invalid or suspicious address. This method effectively flags threads originating from a load library injector.
Additional Detection Methods
Another approach involves comparing the start address against a predefined threshold. If the address is below this threshold, it's marked as suspicious. Combining these checks (invalid address type and address threshold) enhances the detection capability.
Evading Detection
To avoid detection:
Avoid using CreateRemoteThread and NtCreateThreadEx.
Opt for alternative methods like thread hijacking, kernel callbacks, or user APCs.
Change shellcode execution methods, especially in manual mapping scenarios.
Using these techniques, you can effectively bypass common detection vectors, ensuring your injected DLL remains undetected.