Detect Mavinject in Google Chronicle
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/
YARA-L Detection Query
rule t1218_013_mavinject_injection {
meta:
author = "Argus Detection Engineering"
description = "Detects abuse of mavinject.exe (Microsoft Application Virtualization Injector) for DLL injection via /INJECTRUNNING flag. Covers T1218.013 signed binary proxy execution."
mitre_attack = "T1218.013"
severity = "HIGH"
confidence = "HIGH"
created = "2026-04-13"
version = "1.0"
events:
$e.metadata.event_type = "PROCESS_LAUNCH"
$e.principal.process.file.full_path = /(?i).*\\mavinject\.exe$/
(
$e.target.process.command_line = /(?i).*\/INJECTRUNNING.*/
or $e.target.process.command_line = /(?i).*(Temp|AppData|Downloads|Public|Desktop).*/
or $e.principal.process.file.full_path = /(?i).*(cmd|powershell|wscript|cscript|mshta|winword|excel)\.exe$/
)
match:
$e.principal.hostname over 5m
outcome:
$risk_score = max(
if($e.target.process.command_line = /(?i).*\/INJECTRUNNING.*/, 40, 0) +
if($e.target.process.command_line = /(?i).*(Temp|AppData|Downloads|Public|Desktop).*/, 30, 0) +
if($e.principal.process.file.full_path = /(?i).*(cmd|powershell|wscript|cscript|mshta|winword|excel)\.exe$/, 30, 0)
)
$hostname = $e.principal.hostname
$user = $e.principal.user.userid
$command_line = $e.target.process.command_line
$parent_process = $e.principal.process.file.full_path
condition:
$e and $risk_score > 0
} Google Chronicle YARA-L 2.0 rule detecting mavinject.exe invocation with /INJECTRUNNING flag or suspicious DLL paths or invocation from script interpreters. Computes a composite risk score across three indicators mapped to T1218.013.
Data Sources
Required Tables
False Positives & Tuning
- Microsoft App-V infrastructure in enterprise environments where mavinject.exe is used legitimately to inject virtualized application components
- Automated DevOps pipelines that invoke mavinject.exe from PowerShell or cmd.exe scripts during application packaging or compatibility testing
- Security orchestration tooling that launches mavinject.exe in sandboxed environments for malware analysis or detonation purposes
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.