这个项目由一个简单的 C++ 自注入 Dropper 组成,专注于 EDR 规避 POC。为了实现它,我结合使用了 Windows Thread Pooling 来隐藏调用栈,并使用 indirect syscalls 来避免 NTDLL 中的挂钩。
2023-10-08-23-22-35-Trim
image
image
image
image
从图片中可以看出,在 Cordyceps 代码中,它执行了一次跳转到 ntdll,以利用其中的一条 syscall 指令。这应被视为恶意行为;然而,在执行 ntdll 中的返回后,我们会返回到位于 ntdll 内的 tpWorker 代码。因此,从杀毒软件(AV)的角度来看,ntdll 似乎是在调用 ntdll 的另一部分,这并不被认为是恶意的。
nasm -f win64 .\Assembly.asm -o .\Assembly.obj
g++ -o poc.exe main.cpp Assembly.obj
https://0xdarkvortex.dev/hiding-in-plainsight/
https://redops.at/en/blog/direct-syscalls-vs-indirect-syscalls
https://captmeelo.com/redteam/maldev/2022/05/10/ntcreateuserprocess.html
https://klezvirus.github.io/RedTeaming/AV_Evasion/StackSpoofing/
https://medium.com/@sruthk/cracking-assembly-fastcall-calling-convention-in-x64-c6d77b51ea86