Note: You are viewing an old, archived version of this content. The latest version is available in the 'main' branch.
ID: Process_injection_via_QueueUserApcRemoteApiCall_by_rare_or_unsigned_processes
OS: WindowsEndpoint, WindowsServer
FP Rate: Low
Author: FalconForce
License: BSD 3-Clause License
References: Link to medium post
Tactics: TA0004 - Privilege Escalation
Technique | Subtechnique | Technique Name |
---|---|---|
T1055 | 002 | Process Injection - Portable Executable Injection |
Log Provider | Event ID | Event Name | ATT&CK Data Source |
---|---|---|---|
MDE | DeviceEvents |
The query searches for unsigned processes with a low GlobalPrevalence that inject into other processes. This technique is commonly used by multiple attacker toolkits.
User
This rule detects the use of the QueueUserApcRemoteApiCall API call that is registered by MDE. The is a legitimate use for this, however when executed by a rare binary which is unsigned as well should be very uncommon.
Processes can be injected into in various different ways, this detection only focusses on the variant utilizing the QueueUserApcRemoteApiCall API call.
None expected.
The process injection coming coming from the following sources will not be detected:
- A DLL started by Rundll32.
- A DLL which is hijacked, running inside a trusted process.
- A COM object which lives inside a trusted process, such as dllhost.exe.
- Using AppInit_DLL to load your malicious DLL inside a trusted process.
- Use shims to load your malicious DLL inside a trusted process.
When the GlobalPrevalence of the used tool is too high this detection will not pick it up, the same is true for software signed with a validiated certificate. Additionally, when an attacker injects into a valid signed and common process through another method they will hide in the common signals.
Language: Kusto
Platform: M365 Security
Query:
let timeframe = (24h);
let QueueUserApcRemote = DeviceEvents
| where Timestamp > ago(timeframe)
| where ActionType == "QueueUserApcRemoteApiCall"
| distinct InitiatingProcessSHA1
| invoke FileProfile(InitiatingProcessSHA1, 1000)
| where GlobalPrevalence < 1000 or isempty(GlobalPrevalence) or SoftwareName startswith "Microsoft Office";
DeviceEvents
| where Timestamp > ago(timeframe)
| where InitiatingProcessSHA1 in~ ((QueueUserApcRemote | project InitiatingProcessSHA1))
| join kind=leftouter QueueUserApcRemote on InitiatingProcessSHA1
// Customer tuning