PowerShell PInvoke Process Injection API Chain
The following analytic detects PowerShell Script Block Logging (Event ID 4104) evidence of a complete P/Invoke process-injection API chain at either the compile phase or the execution phase. Portions of this search…
Description
The following analytic detects PowerShell Script Block Logging (Event ID 4104) evidence of a complete P/Invoke process-injection API chain at either the compile phase or the execution phase. Portions of this search were modified to retain the same functionality while preventing antivirus products from alerting on the detection itself
Detection logic
Detection requirements
- Platform
- LinuxmacOSWindows
The rule states no platform. This is derived from the 3 ATT&CK techniques it maps to.
- Log source category
- powershell_script_block_logging_4104
Known benign triggers
- No false positives have been identified at this time.
MITRE ATT&CK mappings
1 exclusive technique.This is coverage no other published rule has; it is not this rule's total technique count.
- T1055Process InjectionAlso under Stealth.
- T1055.001Dynamic-link Library Injection12 detections cover this technique
- T1055.003Thread Execution Hijacking4 detections cover this technique
- T1055.004Asynchronous Procedure Call2 detections cover this technique
- T1055.012Process Hollowing9 detections cover this technique
- T1055.013Process Doppelgänging1 detection covers this technique
References
| Reference | Cited by |
|---|---|
| attack.mitre.org/techniques/T1055/ | Only this detection cites it |
| attack.mitre.org/techniques/T1620/ | Only this detection cites it |
| learn.microsoft.com/en-us/dotnet/api/system.runtime.interopservices.dllimportattribute | Only this detection cites it |
| www.broadcom.com/support/security-center/protection-bulletin/vip-keylogger-spreads-via-multi-org-impersonation-campaign | 3 |
| www.ired.team/offensive-security/code-injection-process-injection | Only this detection cites it |
From the source
- At source
- Open at source
- Upstream identifier
- 3f1a2b4c-d5e6-7890-abcd-ef1234567890
- Tagged by the source as
- Phantom StealerVIP KeyloggerEndpointendpointSplunk CloudSplunk EnterpriseSplunk Enterprise Securityendpoint
Licence
- Published under
- Apache License 2.0Read the licence
- Attribution
- Required
- Obtained under
- Apache-2.0Read the origin licence
Authorship
- Written by
- Published
- Aug 26, 2026
- Version
- 1