Detection rules › Elastic
DLL Injection via MavInject Utility
Detects the utilization of the Microsoft MavInject utility to inject an arbitrary library into a remote process.
MITRE ATT&CK coverage
| Tactic | Techniques |
|---|---|
| Stealth |
Rule body
[rule]
description = "Detects the utilization of the Microsoft MavInject utility to inject an arbitrary library into a remote process."
id = "fccfdee7-b2be-4656-a3ab-9c2808aeff53"
license = "Elastic License v2"
name = "DLL Injection via MavInject Utility"
os_list = ["windows"]
reference = ["https://lolbas-project.github.io/lolbas/Binaries/Mavinject/"]
version = "1.0.5"
query = '''
sequence with maxspan=5s
[process where event.action == "start" and
(process.pe.original_file_name : "mavinject*.exe" or process.name : "mavinject*.exe") and
process.args : "/INJECTRUNNING" and not process.parent.executable : "?:\\Windows\\Sys*\\AppVClient.exe"] as event0
[library where process.pid != 4 and not dll.code_signature.status : "trusted" and
stringcontains~(event0.process.command_line, dll.name)]
'''
min_endpoint_version = "8.4.0"
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 0
[[actions]]
action = "kill_process"
field = "process.entity_id"
state = 1
[[optional_actions]]
action = "rollback"
field = "process.entity_id"
state = 0
[[threat]]
framework = "MITRE ATT&CK"
[[threat.technique]]
id = "T1055"
name = "Process Injection"
reference = "https://attack.mitre.org/techniques/T1055/"
[[threat.technique]]
id = "T1218"
name = "System Binary Proxy Execution"
reference = "https://attack.mitre.org/techniques/T1218/"
[threat.tactic]
id = "TA0005"
name = "Defense Evasion"
reference = "https://attack.mitre.org/tactics/TA0005/"
[internal]
min_endpoint_version = "8.4.0"
Stages and Predicates
Stage 1: process
[process where event.action == "start" and
(process.pe.original_file_name : "mavinject*.exe" or process.name : "mavinject*.exe") and
process.args : "/INJECTRUNNING" and not process.parent.executable : "?:\\Windows\\Sys*\\AppVClient.exe"] as event0
Stage 2: library
[library where process.pid != 4 and not dll.code_signature.status : "trusted" and
stringcontains~(event0.process.command_line, dll.name)]
Exclusions
The rule actively suppresses these predicates.
| Field | Kind | Excluded values | Search |
|---|---|---|---|
process.parent.executable | wildcard | ?:\Windows\Sys*\AppVClient.exe | excludes:process.parent.executable field:"process.parent.executable" value:"?:\Windows\Sys*\AppVClient.exe" |
dll.code_signature.status | eq | trusted | excludes:dll.code_signature.status field:"dll.code_signature.status" value:"trusted" |
Indicators
These rows show field, operator, and value matches.
| Field | Kind | Values | Search |
|---|---|---|---|
event.action | eq |
| field:"EventType" kind:eq value:"start" |
event0.process.command_line | contains |
| field:"event0.process.command_line" kind:contains value:"dll.name" |
process.args | wildcard |
| field:"process.args" kind:wildcard value:"/INJECTRUNNING" |
process.name | wildcard |
| field:"process_name" kind:wildcard value:"mavinject*.exe" |
process.pe.original_file_name | wildcard |
| field:"OriginalFileName" kind:wildcard value:"mavinject*.exe" |
process.pid | ne |
| field:"process_id" kind:ne value:"4" |