Persistence
IFEO and Winlogon persistence
IFEO and Winlogon cheat sheet: Debugger hijacks, GlobalFlag and SilentProcessExit, sticky keys backdoors, Userinit/Shell, Notify and AppInit_DLLs.
- Location
- SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\<exe>
- Proves
- A program launch, process exit or user logon was hijacked to run another binary
- Timestamps
- IFEO, SilentProcessExit and Winlogon key LastWrite as FILETIME, UTC; replaced accessibility binaries carry NTFS $SI/$FN times
- Retention
- Values persist until removed; older values in hive transaction logs, shadow copies and unallocated hive space
- Access
- Administrator; SOFTWARE and NTUSER.DAT locked live: reg query works live, otherwise raw NTFS (KAPE) or VSS
- Evidence of
- Persistence
- Type
- Registry
- Windows
- XPVista / 78 / 8.11011
- KAPE target
- RegistryHivesSystemRegistryHivesUser
- Velociraptor
- Windows.Triage.Targets:RegistryHivesSystemRegistryHivesUser
Tools
Compare all toolsWhat it is
This page groups registry-based persistence that hijacks built-in Windows behaviour instead of adding an obvious autostart entry. All of it lives in the SOFTWARE hive (plus a per-user Winlogon key) and needs administrative rights to set up.
- Image File Execution Options (IFEO) is a debugging feature: a
Debuggervalue underIFEO\<name>.exemakes Windows launch the "debugger" instead of the program, with the program's path as an argument. Pointing it at a payload hijacks every launch of that executable. - Silent process exit monitoring (Windows 7 and later) launches a
MonitorProcesswhen a monitored program exits. - Accessibility backdoors replace or hijack
sethc.exe,utilman.exeand similar binaries so that a key combination at the logon screen opens a SYSTEM shell. - Winlogon values (
Userinit,Shell, and on XPNotify) define what runs at each logon. - AppInit_DLLs loads DLLs into every process that loads
user32.dll.
Location
| Mechanism | Location | Windows versions |
|---|---|---|
| IFEO Debugger / GlobalFlag | SOFTWARE: Microsoft\Windows NT\CurrentVersion\Image File Execution Options\<exe> (and WOW6432Node\...) | All |
| Silent process exit | SOFTWARE: Microsoft\Windows NT\CurrentVersion\SilentProcessExit\<exe> | 7 and later |
| Accessibility binaries | C:\Windows\System32\sethc.exe, utilman.exe, osk.exe, Magnify.exe, Narrator.exe, DisplaySwitch.exe, AtBroker.exe (file or IFEO) | All |
| Winlogon (machine) | SOFTWARE: Microsoft\Windows NT\CurrentVersion\Winlogon (values Userinit, Shell) | All |
| Winlogon (user) | NTUSER.DAT: Software\Microsoft\Windows NT\CurrentVersion\Winlogon (Shell) | All |
| Winlogon notification packages | SOFTWARE: ...\Winlogon\Notify\<name> (DLLName) | XP / Server 2003 only |
| AppInit_DLLs | SOFTWARE: Microsoft\Windows NT\CurrentVersion\Windows (AppInit_DLLs, LoadAppInit_DLLs, RequireSignedAppInit_DLLs) and WOW6432Node\... | All; disabled by Secure Boot on 8+ |
What it proves
- A hijack was configured: the executable targeted and the binary or command that replaces or follows it.
- Privilege: writing these keys (and replacing System32 binaries) requires administrator or SYSTEM rights, so a hit implies prior privileged access.
- Pre-logon access for accessibility backdoors: anyone reaching the logon screen, locally or over RDP without Network Level Authentication, gets a SYSTEM process.
- It does not prove the hijack fired. Look for execution of the payload and, for accessibility abuse, for
sethc.exe/utilman.exespawningcmd.exe.
Key fields
| Value | Meaning |
|---|---|
IFEO\<exe>\Debugger | Program launched instead of <exe>; a legitimate value is rare outside developer machines |
IFEO\<exe>\GlobalFlag | Bit 0x200 (FLG_MONITOR_SILENT_PROCESS_EXIT) enables silent-exit monitoring |
SilentProcessExit\<exe>\ReportingMode | Bit flags: 0x1 launch monitor process, 0x2 write dumps, 0x4 show notification |
SilentProcessExit\<exe>\MonitorProcess | Command line run when <exe> exits |
SilentProcessExit\<exe>\LocalDumpFolder | Where dumps go when ReportingMode includes 0x2 |
Winlogon\Userinit | Default C:\Windows\system32\userinit.exe,; extra comma-separated entries also run |
Winlogon\Shell | Default explorer.exe; anything else replaces or adds to the shell |
Winlogon\Notify\<name>\DLLName | DLL loaded by Winlogon on XP |
AppInit_DLLs / LoadAppInit_DLLs | DLL list and on/off switch (1 = load) |
Timestamps
| Timestamp | Set when | Format | Pitfalls |
|---|---|---|---|
IFEO\<exe> key LastWrite | Values under the key change | FILETIME, UTC | Many IFEO subkeys exist legitimately and are touched by updates |
SilentProcessExit\<exe> LastWrite | Monitor configured | FILETIME, UTC | Key is absent on most systems, so its presence is already notable |
Winlogon key LastWrite | Any Winlogon value changes | FILETIME, UTC | Windows and installers also update unrelated values in this key |
| Accessibility binary $SI / $FN times | File replaced | NTFS, UTC | Copy tools may preserve source times; compare $FN, size and hash with a clean build |
Retention and clearing
- Registry values stay until removed; old values can survive in hive transaction logs, volume shadow copies and unallocated hive space.
- A replaced accessibility binary may be restored by Windows File Protection or System File Checker, so a clean file today does not rule out past abuse; check the USN journal for renames and overwrites in
System32. - When a monitored process exits silently, the Application log records an entry from the Process Exit Monitor source.
ReportingMode0x2withLocalDumpFolderis also abused to make Windows write a memory dump oflsass.exe; aSilentProcessExit\lsass.exekey is credential-theft evidence.
Collection
- KAPE target:
RegistryHivesSystem(SOFTWARE) andRegistryHivesUser(per-user Winlogon). No dedicated target exists; the accessibility binaries are not collected by these targets, so hash them from the image or add a file collection forSystem32. - Velociraptor (
Windows.Triage.Targets):RegistryHivesSystem,RegistryHivesUser. Live:Windows.Persistence.Debug(IFEO Debugger) andWindows.Persistence.SilentProcessExit. - Built-in:
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options" /s /v Debugger
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\SilentProcessExit" /s
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v Userinit
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v Shell
reg query "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Windows" /v AppInit_DLLs
certutil -hashfile C:\Windows\System32\sethc.exe SHA256
Parsing tools
- Registry Explorer / RECmd (Eric Zimmerman): review the keys and export them with community batch files.
- RegRipper:
imagefile(IFEO Debugger, includingWOW6432Node),winlogon_tln(alerts on non-defaultUserinitandShell) andappinitdlls. - Autoruns (Sysinternals, free): Image Hijacks, Winlogon and AppInit tabs, live or offline. Oddvar Moe showed in 2018 that GlobalFlag/SilentProcessExit persistence was not displayed by Autoruns at the time, so check those keys directly.
- Velociraptor:
Windows.Persistence.Debug,Windows.Persistence.SilentProcessExit. - Plaso:
winlogonregistry plugin.
Investigation tips
- List every IFEO subkey with a
Debuggervalue; accessibility binaries and security tools are common targets. Process Explorer's "Replace Task Manager" option sets a legitimateDebuggerontaskmgr.exe, so check the value's target. - Check
GlobalFlagvalues for bit0x200and match each one to aSilentProcessExitsubkey. - Hash
sethc.exe,utilman.exe,osk.exe,Magnify.exe,Narrator.exe,DisplaySwitch.exeandAtBroker.exe: a hash equal tocmd.exeorexplorer.exe, or a mismatched version resource, is a replaced binary. - Look for
Userinitwith more than one entry and forShellvalues other thanexplorer.exe, in both HKLM and every user's NTUSER.DAT. - A
LoadAppInit_DLLsof 1 on a Secure Boot machine is inert but still shows intent. - Confirm execution with Prefetch of the payload, Security 4688 process creation (if audited), and WER or dump files for silent-exit abuse. Payloads are often LOLBins.
Related artifacts
- Run keys and Startup foldersRun keys and Startup folders cheat sheet: Run, RunOnce, Wow6432Node and Policies paths, StartupApproved enabled/disabled bytes, timestamps and pitfalls.
- Windows ServicesWindows services cheat sheet: Services key values (ImagePath, Start, Type, ServiceDll), 7045 and 4697 install events, PsExec traces and pitfalls.
- Scheduled TasksScheduled tasks cheat sheet: task XML and .job files, TaskCache registry keys, DynamicInfo times, hidden tasks, TaskScheduler and 4698 events.
- Registry hivesRegistry hives cheat sheet: SYSTEM, SOFTWARE, SAM, SECURITY, NTUSER.DAT, UsrClass.dat, transaction logs, RegBack, LastWrite times and collection.
- Windows Error Reporting (WER)Windows Error Reporting cheat sheet: Report.wer folders, AppPath and SHA-1 fields, Application events 1000/1001/1002, LocalDumps crash dumps and retention.
- Prefetch Files (.pf)Windows Prefetch cheat sheet: .pf location per version, run count, the last eight run times, referenced files, retention limits and how to parse.
Glossary terms
- PersistenceMechanisms that let malware or an attacker survive reboots and logoffs, such as Run keys, services, scheduled tasks or WMI subscriptions.
- Registry key LastWrite timeThe single FILETIME stored in every registry key that records when the key or one of its values was last changed, in UTC.
- Registry HiveAn on-disk file that backs part of the Windows Registry, such as `SYSTEM`, `SOFTWARE`, or `NTUSER.DAT`.
- LOLBin (living-off-the-land binary)A legitimate, signed Windows binary that attackers abuse to download, execute or hide payloads without dropping their own tools.