Understanding APC injection
In this section, we’ll embark on a journey that unravels the concept of asynchronous procedure call (APC) injection, from its basics to advanced implementation strategies, providing a roadmap to both potential threats and vigilant defenders.
A practical example of APC injection
In the preceding sections, we discussed traditional code injection and traditional DLL injection. I will discuss an early bird APC injection technique in this section. Here, we will examine QueueUserAPC (https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-queueuserapc), which utilizes an APC to queue a particular thread.
Every thread has a separate APC queue. The QueueUserAPC function is invoked by an application to queue an APC to a thread. In the QueueUserAPC call, the contacting thread specifies the address of an APC function. APC queuing is a request for the thread to invoke the APC function.
Initially, our malicious program...