Skip to content

Image File Execution Options: Debugger Hijacks

How IFEO Debugger values, Sticky Keys backdoors, VerifierDlls and SilentProcessExit monitors hijack Windows programs, and how to find and remove them.

Tactics
Persistence, Privilege escalation
Runs
When a program starts
Set up by
Administrators
Locations
  • HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options
  • HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows NT\CurrentVersion\Image File Execution Options
  • HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SilentProcessExit
  • C:\Windows\System32\sethc.exe
  • C:\Windows\System32\utilman.exe

How it works

Image File Execution Options (IFEO) is a registry key that holds per-program settings for the loader and for debuggers. Each subkey is named after an executable's file name, such as notepad.exe, with no folder: the settings apply to every copy of that name, wherever it runs from.

Three values under a program's subkey change what happens when it starts:

ValueEffect
DebuggerWhen a process starts the program through CreateProcess (directly, or through ShellExecute and Explorer), Windows runs this command instead, with the original command line appended. The program runs only if the "debugger" starts it. A process created for debugging skips the check, which is how real debuggers launch their target.
GlobalFlagBit flags for the loader. 0x100 turns on Application Verifier; 0x200 turns on silent process exit monitoring.
VerifierDllsDLL names that Application Verifier loads into the program at its start, before the program's own code, when GlobalFlag has 0x100.

Silent process exit monitoring, added in Windows 7, has its own key: SilentProcessExit\<program>. When the IFEO subkey's GlobalFlag has 0x200 and ReportingMode has bit 0x1, Windows Error Reporting starts the MonitorProcess command each time the program exits on its own or is killed by another process.

The replacement runs as whoever started the program, and that is what makes the accessibility tools special. At the sign-in screen, winlogon.exe starts sethc.exe (Sticky Keys) after five presses of Shift, and utilman.exe from the accessibility button or Win+U; the other tools on that menu (osk.exe, magnify.exe, narrator.exe) start the same way. They run as SYSTEM, before anyone has signed in. A debugger set on one of them, or a copy of cmd.exe saved over the binary, gives a SYSTEM shell to anyone at the console, and over Remote Desktop when Network Level Authentication is off.

Where it lives

LocationWhatWho can write it
HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\<name>.exeDebugger, GlobalFlag, VerifierDllsAdministrators, SYSTEM
HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\<name>.exeThe same key in the 32-bit view; check bothAdministrators, SYSTEM
HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SilentProcessExit\<name>.exeReportingMode, MonitorProcessAdministrators, SYSTEM
C:\Windows\System32\sethc.exe, utilman.exe, osk.exe, magnify.exe, narrator.exeThe accessibility programsTrustedInstaller; an administrator must take ownership first

There is no per-user variant: every form needs administrator rights. A stock Windows 10 or 11 system has IFEO subkeys of its own, holding settings such as mitigation options, but no Debugger, VerifierDlls or MonitorProcess. Legitimate Debugger values come from Process Explorer's "Replace Task Manager" option (set on taskmgr.exe), from Visual Studio's debug-on-launch (vsjitdebugger.exe), and from administrators who block a program by pointing its debugger at nothing useful.

How attackers use it

The Sticky Keys backdoor is the best known form. One value is enough:

reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\sethc.exe" /v Debugger /t REG_SZ /d "C:\Windows\System32\cmd.exe" /f

The older variant replaces the file itself after takeown /f C:\Windows\System32\sethc.exe and icacls C:\Windows\System32\sethc.exe /grant Administrators:F. Either way, the attacker gets SYSTEM from the sign-in screen with no account and no password, and the access survives password resets. ATT&CK lists APT29 and APT3 among the groups that used it.

Other forms:

  • Hijacking a program that runs often. A Debugger on a browser, an updater or notepad.exe runs the payload at each start. To stay unnoticed, the wrapper then starts the real program; it must create it as a debugger would (and detach), or it would trigger itself again.
  • Blocking security tools. A Debugger on an antivirus or analysis tool's file name, pointing at a program that exits at once, keeps it from ever starting.
  • Silent process exit. GlobalFlag set to 512 on the IFEO subkey, ReportingMode 1 and MonitorProcess set to the payload under SilentProcessExit: the payload runs each time the program closes. Checks that only look for Debugger miss it.
  • Verifier DLLs. Like AppInit DLLs, but aimed at one program. DoubleAgent (Cybellum, 2017) used Application Verifier to load its DLL into antivirus processes before their own code: a DLL in System32, its name in VerifierDlls, GlobalFlag 0x100.

How to check a host

On a live machine, from an elevated prompt:

reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options" /s /v Debugger
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options" /s /v VerifierDlls
reg query "HKLM\SOFTWARE\WOW6432Node\Microsoft\Windows NT\CurrentVersion\Image File Execution Options" /s /v Debugger
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SilentProcessExit" /s
autorunsc -accepteula -a h -s -h

In PowerShell, list every subkey with one of the values set:

Get-ChildItem 'HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options' | Get-ItemProperty | Where-Object { $_.Debugger -or $_.VerifierDlls -or $_.GlobalFlag } | Select-Object PSChildName, Debugger, VerifierDlls, GlobalFlag

Registry checks do not show a replaced binary. Compare the accessibility programs with what they should be:

Get-Item C:\Windows\System32\sethc.exe, C:\Windows\System32\utilman.exe | Select-Object Name, Length, LastWriteTime, @{n='Description'; e={$_.VersionInfo.FileDescription}}
sfc /verifyfile=C:\Windows\System32\sethc.exe

A sethc.exe whose description reads "Windows Command Processor", or with the size and hash of cmd.exe, has been swapped.

Offline, open the SOFTWARE hive (C:\Windows\System32\config\SOFTWARE) and read Microsoft\Windows NT\CurrentVersion\Image File Execution Options and SilentProcessExit. A subkey's last-write time is when one of its values last changed; feature updates rewrite many keys, so compare it with its neighbours. Prefetch files for SETHC.EXE or UTILMAN.EXE, and process creation events (4688 with command-line auditing, Sysmon 1) showing cmd.exe or powershell.exe started by winlogon.exe as SYSTEM, point to use of the backdoor. With registry auditing on the key, event 4657 records the change; Sysmon 13 records it with the writing process.

Suspicious: any debugger on an accessibility tool; a debugger outside Program Files or a known developer tool; any MonitorProcess; VerifierDlls on a machine where nobody uses Application Verifier.

What Windows Persistence flags

The tool reads the SOFTWARE hive: every subkey of Image File Execution Options and of SilentProcessExit, and the AeDebug key, each in the native and WOW6432Node views. It makes one entry per value:

  • A non-empty Debugger on sethc.exe, utilman.exe, osk.exe, magnify.exe, narrator.exe, displayswitch.exe or atbroker.exe raises Debugger on an accessibility tool: program (high).
  • Any other Debugger raises Debugger replaces program (high). It drops to low for Process Explorer (procexp.exe or procexp64.exe) set on taskmgr.exe, and for vsjitdebugger.exe on any program.
  • A non-empty VerifierDlls raises Verifier DLL injected into program: high, and marked enabled, when the subkey's GlobalFlag has 0x100; medium otherwise, since the DLLs do not load. The details show GlobalFlag.
  • A MonitorProcess under SilentProcessExit raises Monitor runs when program exits (high). The entry is marked enabled only when the matching IFEO subkey's GlobalFlag has 0x200 and ReportingMode has bit 0x1; the details show both.
  • The Debugger in AeDebug is the crash debugger, which Windows starts when any program crashes, without asking when Auto is 1 (the entry is then marked enabled). A debugger in Windows' folders or Program Files that raises no other flag is shown without one; Windows' own is hidden by the "Hide Windows entries" filter. Anything else raises Crash debugger is not Windows' own: high with Auto 1, medium otherwise.

The command-line rules then run on the value, as for a machine-wide autostart: Runs from a temporary or public folder, System-wide autostart from a writable folder, Windows program name in the wrong place, Name one letter away from a Windows program, Encoded PowerShell command and the others. Across mechanisms, Written date marks a key written in the 7 days before the newest time in the collection, Inside a Defender exclusion (path) a program Defender skips, and program also runs from mechanisms a program started some other way too. Apart from a quiet crash debugger, every entry here carries a flag, so the filter does not hide it.

Limits: the tool reads the registry, not the programs, so it cannot see a sethc.exe overwritten with cmd.exe; check the files as shown above. It does not read the per-path filter subkeys an IFEO key can hold when UseFilter is set.

Cleaning up

  1. Preserve: reg export "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\sethc.exe" C:\IR\ifeo-sethc.reg, the same for the SilentProcessExit subkey, and a copy of the payload with its hash.
  2. Delete the value, not the subkey: reg delete "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\sethc.exe" /v Debugger /f. Windows or other software may keep settings in the same subkey.
  3. For verifier DLLs, delete VerifierDlls and clear 0x100 from GlobalFlag. For a silent exit monitor, delete the SilentProcessExit\<program> key and clear 0x200; delete GlobalFlag only if it held nothing else.
  4. For a replaced binary, run sfc /scanfile=C:\Windows\System32\sethc.exe, preceded by DISM /Online /Cleanup-Image /RestoreHealth if the component store is damaged, then confirm the description and owner (icacls C:\Windows\System32\sethc.exe /setowner "NT SERVICE\TrustedInstaller").
  5. Stop any wrapper or monitor still running and delete the payload.

A Sticky Keys backdoor means someone had administrator rights and left a way to SYSTEM without credentials. Review local accounts, services and scheduled tasks, turn on Network Level Authentication for Remote Desktop, look for the same value on other hosts, and rotate credentials used on the machine.

See also

On Windows Forensics

The artifacts behind this technique, in the Windows Forensics reference: