Evade Microsoft Defender detection when injecting #18
Labels
area: injection
Issues related to the assembly injection APIs.
state: approved
Enhancements and tasks that have been approved.
Milestone
I just observed Microsoft Defender flagging the
hook
sample locally:We open a process, allocate memory in the process, write code to the memory, mark the memory executable, and then create a thread that executes that memory. It's not too surprising that this gets flagged since it's a classic way of injecting malicious code into a process.
I believe it's either our
CreateProcess
call (inSystem.Diagnostics.Process
) orCreateRemoteThread
call (inVezel.Ruptura.Injection.TargetProcess
) that tips Microsoft Defender off. Or maybe both. It's well-documented that Microsoft Defender hooks APIs such as these.One workaround might be direct system calls. We would extract the actual system call numbers from
ntdll.dll
to avoid hardcoding them; they do change between Windows updates. We would then assemble some functions in the injecting process which perform the system calls. I don't think Microsoft Defender has any way of detecting this, and it's relatively simple.The text was updated successfully, but these errors were encountered: