Stealth-focused Intel VT-x hypervisor (EAC/BE/ACs/AVs).
Stealth-focused Intel VT-x hypervisor (EAC/BE/ACs/AVs).
Intel VT-x Type-2 hypervisor that virtualizes an already running Windows system. Designed for stealth: passes common hypervisor detection checks and works with EAC/BE/AVs out of the box. (possibly more, these are the only that have been tested)
Ophion — Building a Stealth Intel VT-x Hypervisor for Windows
A detailed technical writeup covering the internals of Ophion — VMX bring-up, EPT construction, stealth mechanisms, and the lessons learned along the way. Thanks to WebSec for the motivation and for hosting it.
cpuid_entry_tsc + bare_metal_cost + offset. TSC_OFFSET never modified — zero drift.| Field | Value |
|---|---|
| Pin-based | External-interrupt exiting, NMI exiting, virtual NMIs |
| Primary proc | TSC offsetting, MSR bitmaps, I/O bitmaps, activate secondary. CR3/HLT/MOV-DR/RDTSC/INVLPG exiting may be forced by must-be-1 bits. |
| Secondary proc | EPT, VPID, RDTSCP, INVPCID, XSAVES/XRSTORS |
| Exit | 64-bit host, save debug controls, ACK interrupt on exit |
| Entry | IA-32e mode guest, load debug controls |
| PFEC mask/match | Both 0 — all #PFs go to guest |
| CR0 mask | 0 (full pass-through) |
| CR4 mask | Bit 13 (VMXE) when stealth enabled, 0 otherwise |
| MSR bitmap | Intercept RDMSR(0x10), IA32_FEATURE_CONTROL (0x3A), VMX capability MSRs (0x480-0x493) |
| I/O bitmaps | All zeros |
| EPT pointer | WB cache, 4-level walk |
| VPID | Tag 1 |
| HOST_CR3 | Private deep-copied kernel PTs (or system CR3 if disabled) |
| HOST_IDTR | Private IDT with controlled handlers (or system IDT if disabled) |
| HOST_GDTR | Per-core private GDT copy (or system GDT if disabled) |
…Requires Visual Studio 2022, WDK 10.0.26100.0, and MSVC with MASM (x64).
MSBuild.exe Ophion.sln /p:Configuration=Release /p:Platform=x64Output: build\bin\Release\Ophion.sys (test-signed).
sc create Ophion type= kernel binPath= "C:\path\to\Ophion.sys"
sc start OphionRequires test signing enabled (bcdedit /set testsigning on).
sc stop Ophion
sc delete OphionDefined in include/stealth.h:
| Toggle | Default | Description |
|---|---|---|
STEALTH_ENABLED |
1 | Master stealth switch |
STEALTH_HIDE_CR4_VMXE |
1 | Hide CR4.VMXE from guest via CR4 shadow |
STEALTH_COMPENSATE_TIMING |
1 | TSC compensation for RDTSC+CPUID+RDTSC timing attacks |
STEALTH_CPUID_CACHING |
1 | Cache native CPUID responses for invalid/hypervisor leaves |
USE_PRIVATE_HOST_CR3 |
1 | Isolated host page tables (deep-copied kernel PTs) |
USE_PRIVATE_HOST_IDT |
1 | Isolated host IDT (prevents NMI hijacking in VMX-root) |
USE_PRIVATE_HOST_GDT |
1 | Per-core isolated host GDT |
Passes with all stealth toggles enabled:
This project has not been thoroughly tested for long-term usage or stability. It is intended primarily as a learning resource and a foundation for further development. Use at your own risk.
MIT
No open issues yet, or sync has not completed.