The Draugr toolset provides a robust framework for performing synthetic stack frame manipulation, primarily designed to bypass modern Endpoint Detection and Response (EDR) systems.
It includes two key components: Draugr-Template and Draugr-Strike, which enable developers to implement advanced techniques such as return address spoofing and remote process injection.
The Draugr-Template is a Cobalt Strike BOF (Beacon Object File) template that facilitates the creation of synthetic stack frames. This technique is essential for evading detection by EDRs that monitor stack frames during sensitive API calls.
By mimicking legitimate thread start conditions, Draugr-Template ensures that the stack frame appears less suspicious.
To use Draugr-Template, dynamically resolve the function address and call it using the SPOOF_CALL macro:
HMODULE pKernel32 = GetModuleHandleA("Kernel32.dll");
void* pVirtualAlloc = (void*)GetProcAddress(pKernel32, "VirtualAlloc");
void* pAllocatedAddr = SPOOF_CALL(&stackFrame, pVirtualAlloc, NULL, 1024 * 1024, MEM_COMMIT, PAGE_EXECUTE_READWRITE); Here, SYNTHETIC_STACK_FRAME structures manage the spoofed stack frames.
Developers can modify the code in src/core/Spoof.c to customize gadgets or fake stack frames. For example:
BaseThreadInitThunk, RtlUserThreadStart).FindGadget for alternate implementations.The Draugr-Strike demonstrates how to use Draugr-Template for remote process injection. It includes steps like memory allocation, shellcode injection, memory protection changes, and creating a spoofed thread at a specific offset.
This code is a proof of concept (PoC) and may occasionally fail during injection. It is not intended for production use.
Draugr provides a powerful set of tools for synthetic stack frame manipulation and process injection. While its primary use case is educational and experimental, it highlights advanced evasion techniques against EDR systems.
However, users must exercise caution and adhere to ethical guidelines when employing these tools.
Redis is an open-source, in-memory data structure store used as a database, cache, and message broker.…
Ubuntu 18.04 LTS (Bionic Beaver) was released on April 26, 2018, with five years of official…
Apache Virtual Hosts let you run multiple websites on a single server. Each site gets its…
Django is a free, open-source Python web framework built for developing secure, scalable, and maintainable web…
MySQL replication is the process of automatically copying data from one database server to one or…
Joomla is one of the most popular open-source content management systems in the world. It is…