Detect Mavinject in CrowdStrike LogScale
Adversaries may abuse mavinject.exe to proxy execution of malicious code. Mavinject.exe is the Microsoft Application Virtualization Injector, a Windows utility that can inject code into external processes as part of Microsoft Application Virtualization (App-V). Adversaries abuse it to inject malicious DLLs into running processes (DLL injection) using the /INJECTRUNNING flag. Since mavinject.exe is a signed Microsoft binary, it can bypass application control. TONESHELL malware has been observed using mavinject.exe for process injection.
MITRE ATT&CK
- Tactic
- Defense Evasion
- Technique
- T1218 System Binary Proxy Execution
- Sub-technique
- T1218.013 Mavinject
- Canonical reference
- https://attack.mitre.org/techniques/T1218/013/
LogScale Detection Query
#event_simpleName=ProcessRollup2
| ImageFileName = /(?i).*\\mavinject\.exe$/
| CommandLine = /.*/ // ensure field is present
| eval InjectRunning = if(match(CommandLine, /(?i)\/INJECTRUNNING/), 1, 0)
| eval SuspiciousPath = if(match(CommandLine, /(?i)(Temp|AppData|Downloads|Public|Desktop)/), 1, 0)
| eval SuspiciousParent = if(match(ParentBaseFileName, /(?i)(cmd|powershell|wscript|cscript|mshta|winword|excel)\.exe/), 1, 0)
| eval RiskScore = InjectRunning + SuspiciousPath + SuspiciousParent
| where RiskScore > 0
| table([@timestamp, ComputerName, UserName, CommandLine, ParentBaseFileName, InjectRunning, SuspiciousPath, SuspiciousParent, RiskScore])
| sort(field=@timestamp, order=desc) CrowdStrike LogScale (Falcon) query detecting mavinject.exe process execution events using ProcessRollup2 telemetry. Scores each event based on /INJECTRUNNING flag, suspicious DLL path locations, and high-risk parent processes matching T1218.013 indicators.
Data Sources
Required Tables
False Positives & Tuning
- Legitimate Microsoft App-V usage in enterprise environments where mavinject.exe is invoked as part of approved application virtualization workflows managed by IT
- Endpoint detection and response tooling or forensic agents that invoke mavinject.exe for authorized process instrumentation or monitoring on managed endpoints
- Software deployment or packaging automation that calls mavinject.exe from cmd.exe or PowerShell during sanctioned application installation or compatibility testing
Other platforms for T1218.013
Testing Methodology
Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.
- Test 1Mavinject DLL Injection into Running Process
Expected signal: Sysmon Event ID 1: mavinject.exe with /INJECTRUNNING and a PID in command line. Sysmon Event ID 8 (CreateRemoteThread) from notepad.exe. Sysmon Event ID 7 (Image Load) on notepad.exe for the injected DLL. Security Event ID 4688.
- Test 2Mavinject from PowerShell Parent
Expected signal: Sysmon Event ID 1: powershell.exe then mavinject.exe with ParentImage=powershell.exe and /INJECTRUNNING in command line. SuspiciousParent and InjectRunning both fire.
- Test 3Mavinject with DLL from Temp Directory
Expected signal: Sysmon Event ID 11: DLL written to Temp. Sysmon Event ID 1: mavinject.exe with /INJECTRUNNING and Temp path. The injection will fail (PID 4 is SYSTEM) but the process creation and file creation events fire.
References (4)
- https://attack.mitre.org/techniques/T1218/013/
- https://lolbas-project.github.io/lolbas/Binaries/Mavinject/
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1218.013/T1218.013.md
- https://www.trendmicro.com/en_us/research/25/b/earth-preta-campaign-uses-ppam-files-and-encrypted-payloads-to-evade-detection.html
Unlock Pro Content
Get the full detection package for T1218.013 including response playbook, investigation guide, and atomic red team tests.