Detect Image File Execution Options Injection in Splunk
Adversaries may establish persistence and/or elevate privileges by executing malicious content triggered by Image File Execution Options (IFEO) debugger values. IFEO enables developers to attach debuggers to applications. Registry keys in HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\{binary}.exe can be set with a Debugger value that allows a debugger to be launched automatically when the specified binary is executed. Adversaries abuse this by setting the Debugger value to their malicious payload — whenever the target binary executes, Windows launches the adversary's payload instead (with the target binary name as an argument). This can be used to replace legitimate processes, persist on reboot, or escalate privileges.
MITRE ATT&CK
- Tactic
- Privilege Escalation Persistence
- Technique
- T1546 Event Triggered Execution
- Sub-technique
- T1546.012 Image File Execution Options Injection
- Canonical reference
- https://attack.mitre.org/techniques/T1546/012/
SPL Detection Query
index=wineventlog (sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" OR sourcetype="WinEventLog:Security")
| eval IsIFEO=if(
(EventCode=12 OR EventCode=13)
AND match(TargetObject, "Image File Execution Options"),
1, 0
)
| where IsIFEO=1
| eval IsDebugger=if(match(TargetObject, "Debugger"), 1, 0)
| eval IsGlobalFlag=if(match(TargetObject, "GlobalFlag") AND Details="512", 1, 0)
| eval TargetBinary=mvindex(split(TargetObject, "\\"), -2)
| eval IsAccessibilityBin=if(
match(lower(TargetBinary), "(sethc|utilman|osk|magnify|narrator|displayswitch|atbroker)\.exe"),
1, 0
)
| eval IsHighValueBin=if(
match(lower(TargetBinary), "(taskmgr|regedit|msconfig|cmd|powershell|mmc)\.exe"),
1, 0
)
| eval SuspiciousValue=if(
match(lower(Details), "(cmd\.exe|powershell|mshta|wscript|cscript|rundll32|regsvr32|appdata|\\\\temp\\\\|programdata)"),
1, 0
)
| eval DetectionType=case(
IsAccessibilityBin=1 AND IsDebugger=1, "IFEO_ACCESSIBILITY_BACKDOOR",
IsHighValueBin=1 AND IsDebugger=1, "IFEO_SYSBIN_HIJACK",
IsGlobalFlag=1, "IFEO_SILENT_EXIT",
SuspiciousValue=1 AND IsDebugger=1, "IFEO_SUSPICIOUS_DEBUGGER",
IsDebugger=1, "IFEO_DEBUGGER_SET",
1=1, "IFEO_KEY_MODIFIED"
)
| table _time, host, User, EventCode, DetectionType, TargetBinary, TargetObject, Details, Image, CommandLine
| sort - _time Detects IFEO injection with severity classification: IFEO_ACCESSIBILITY_BACKDOOR (highest — accessibility binary with Debugger set), IFEO_SYSBIN_HIJACK (system management tool targeted), IFEO_SILENT_EXIT (GlobalFlag=512 for SilentProcessExit monitoring), IFEO_SUSPICIOUS_DEBUGGER (Debugger points to LOLBin/scripting engine), and IFEO_DEBUGGER_SET (any Debugger value modification). Escalate ACCESSIBILITY_BACKDOOR immediately — this is always malicious.
Data Sources
Required Sourcetypes
False Positives & Tuning
- Developers attaching debuggers (Visual Studio vsjitdebugger.exe) during development
- JIT debugging configured by Visual Studio installation
- Application error reporting tools registering as crash debuggers
- Security products using IFEO for monitoring injection
Other platforms for T1546.012
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 1IFEO Debugger Injection on cmd.exe
Expected signal: Sysmon Event ID 13: TargetObject=Image File Execution Options\cmd.exe\Debugger, Details=C:\Windows\System32\notepad.exe. Process creation for reg.exe. If cmd.exe is then launched, notepad.exe starts with cmd.exe as its argument.
- Test 2IFEO GlobalFlag for SilentProcessExit
Expected signal: Sysmon Event ID 13 records: GlobalFlag set to 512 in IFEO\notepad.exe, and MonitorProcess set in SilentProcessExit\notepad.exe. The combination of GlobalFlag=512 and MonitorProcess registration is the SilentProcessExit technique.
- Test 3Enumerate All IFEO Debugger Registrations
Expected signal: Process creation for reg.exe with query /s flags. Read-only enumeration. Output reveals all IFEO Debugger and GlobalFlag values across all registered binaries.
References (5)
- https://attack.mitre.org/techniques/T1546/012/
- https://github.com/redcanaryco/atomic-red-team/blob/master/atomics/T1546.012/T1546.012.md
- https://docs.microsoft.com/en-us/windows-hardware/drivers/debugger/enabling-postmortem-debugging
- https://blogs.msdn.microsoft.com/mithuns/2009/08/14/image-file-execution-options-ifeo/
- https://www.deepinstinct.com/blog/lolbas-part-3
Unlock Pro Content
Get the full detection package for T1546.012 including response playbook, investigation guide, and atomic red team tests.