Detection rules › Kusto Query Language
Suspicious Process Injection from Office application
This query detects process injections using CreateRemoteThread, QueueUserAPC or SetThread context APIs, originating from an Office process (only Word/Excel/PowerPoint)that might contains macros. Performing process injection from a macro is a common technique by attackers to escape out of the Office process into something longer running.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Execution | T1204 User Execution |
Event coverage
| Provider | Event ID | Title |
|---|---|---|
| Sysmon | 8 | CreateRemoteThread |
| Defender-DeviceEvents | 9007004 | CreateRemoteThread API call |
Stages and Predicates
Stage 1: source
DeviceEvents
Stage 2: where
ActionType in ["CreateRemoteThreadApiCall", "QueueUserApcRemoteApiCall", "SetThreadContextRemoteApiCall"]
Stage 3: where
InitiatingProcessFileName in ["excel.exe", "powerpnt.exe", "winword.exe"]
Stage 4: where
not
InitiatingProcessCommandLine contains "/dde"
Stage 5: where
not
InitiatingProcessCommandLine match [".docx", "dotx", ".xlsx", ".xltx", ".pptx"]
Exclusions
Top-level NOT(...) conjuncts — predicates this rule actively suppresses.
| Stage | Field | Kind | Excluded values |
|---|---|---|---|
| 1 | CommandLine | contains | /dde |
| 1 | CommandLine | match | .docx, dotx, .xlsx, .xltx, .pptx |
Indicators
Each row is a field, operator, and value that the rule matches. The corpus column counts how many other rules in the catalog look for the same combination: high numbers point to widely-used, community-vetted indicators. Blank or 1 shows that the indicator is specific to this rule.
| Field | Kind | Values |
|---|---|---|
ActionType | in |
|
InitiatingProcessFileName | in |
|