You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{ VM::brands::AZURE_HYPERV, "Azure Hyper-V is Microsoft's cloud-optimized hypervisor variant powering Azure VMs. Implements Azure-specific virtual devices like NVMe Accelerated Networking and vTPMs. Supports nested virtualization for running Hyper-V/containers within Azure VMs, enabling cloud-based CI/CD pipelines and dev/test environments." },
192
192
{ VM::brands::SIMPLEVISOR, "SimpleVisor is a minimalist Intel VT-x hypervisor by Alex Ionescu for Windows/Linux research. Demonstrates EPT-based memory isolation and hypercall handling. Used to study VM escapes and hypervisor rootkits, with hooks for intercepting CR3 changes and MSR accesses." },
193
193
{ VM::brands::HYPERV_ROOT, "VMAware detected Hyper-V operating as a type 1 hypervisor, not as a guest virtual machine. This prevents false positives, as Windows sometimes runs under Hyper-V." },
194
+
{ VM::brands::HYPERV_SPOOF, "VMAware detected another hypervisor impersonating Microsoft Hyper-V." },
194
195
{ VM::brands::UML, "User-Mode Linux (UML) allows running Linux kernels as user-space processes using ptrace-based virtualization. Primarily used for kernel debugging and network namespace testing. Offers lightweight isolation without hardware acceleration, but requires host/guest kernel version matching for stable operation." },
195
196
{ VM::brands::POWERVM, "IBM PowerVM is a type 1 hypervisor for POWER9/10 systems, supporting Live Partition Mobility and Shared Processor Pools. Implements VIOS (Virtual I/O Server) for storage/networking virtualization, enabling concurrent AIX, IBM i, and Linux workloads with RAS features like predictive failure analysis." },
196
197
{ VM::brands::GCE, "Google Compute Engine (GCE) utilizes KVM-based virtualization with custom Titanium security chips for hardware root of trust. Features live migration during host maintenance and shielded VMs with UEFI secure boot. Underpins Google Cloud's Confidential Computing offering using AMD SEV-SNP memory encryption." },
Copy file name to clipboardExpand all lines: src/vmaware.hpp
+96-16Lines changed: 96 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -638,6 +638,7 @@ struct VM {
638
638
AZURE_HYPERV,
639
639
SIMPLEVISOR,
640
640
HYPERV_ROOT,
641
+
HYPERV_SPOOF,
641
642
UML,
642
643
POWERVM,
643
644
GCE,
@@ -3893,7 +3894,7 @@ struct VM {
3893
3894
return memo::hyperx::fetch();
3894
3895
}
3895
3896
3896
-
// Check if hypervisor feature bit in CPUID Leaf 1, ECX bit 31 is enabled
3897
+
// check if hypervisor feature bit in CPUID Leaf 1, ECX bit 31 is enabled
3897
3898
auto is_hyperv_present = []() noexcept -> bool {
3898
3899
u32 unused, ecx = 0;
3899
3900
cpu::cpuid(unused, unused, ecx, unused, 1);
@@ -3911,11 +3912,11 @@ struct VM {
3911
3912
};
3912
3913
3913
3914
/**
3914
-
* On Hyper-V virtual machines, the cpuid function reports an EAX value of 11
3915
-
* This value is tied to the Hyper-V partition model, where each virtual machine runs as a child partition
3916
-
* These child partitions have limited privileges and access to hypervisor resources,
3915
+
* on Hyper-V virtual machines, the cpuid function reports an EAX value of 11
3916
+
* this value is tied to the Hyper-V partition model, where each virtual machine runs as a child partition
3917
+
* these child partitions have limited privileges and access to hypervisor resources,
3917
3918
* which is reflected in the maximum input value for hypervisor CPUID information as 11
3918
-
* Essentially, it indicates that the hypervisor is managing the VM and that the VM is not running directly on hardware but rather in a virtualized environment
3919
+
* essentially, it indicates that the hypervisor is managing the VM and that the VM is not running directly on hardware but rather in a virtualized environment
3919
3920
*/
3920
3921
auto eax = []() noexcept -> u32 {
3921
3922
u32 eax_reg, unused = 0;
@@ -3925,7 +3926,7 @@ struct VM {
3925
3926
return eax_reg & 0xFF;
3926
3927
};
3927
3928
3928
-
// Check whether a hypervisor is nested within a Hyper-V partition
3929
+
// check whether a hypervisor is nested within a Hyper-V partition
3929
3930
auto is_hyperv_nested = []() noexcept -> bool {
3930
3931
u32 eax = 0, ebx = 0, ecx = 0, edx = 0;
3931
3932
cpu::cpuid(eax, ebx, ecx, edx, 0x40000004);
@@ -3935,6 +3936,72 @@ struct VM {
3935
3936
return nested_partition_bit;
3936
3937
};
3937
3938
3939
+
// check if the Windows Hypervisor Platform interface is responsive and confirms a running hypervisor
3940
+
auto is_hyperv_interface_present = []() noexcept -> bool {
// if running under Hyper-V in AMD64 (doesnt matter the VTL/partition level), this value is hardcoded and intercepted/emulated at kernel level
4077
+
// if running under Hyper-V in AMD64 (doesnt matter the VTL/partition level), this value is hardcoded and emulated at kernel level to prevent kernel address leakage
4011
4078
// specifically at KiPreprocessFault -> KiOpDecode -> KiOpLocateDecodeEntry (KiOp_SLDTSTRSMSW)
4012
-
// this is intercepted by the kernel before handling execution to the hypervisor, so it's a decent safeguard against basic cpuid spoofing
case brand_enum::AZURE_HYPERV: return VM::brands::AZURE_HYPERV;
4862
4940
case brand_enum::SIMPLEVISOR: return VM::brands::SIMPLEVISOR;
4863
4941
case brand_enum::HYPERV_ROOT: return VM::brands::HYPERV_ROOT;
4942
+
case brand_enum::HYPERV_SPOOF: return VM::brands::HYPERV_SPOOF;
4864
4943
case brand_enum::UML: return VM::brands::UML;
4865
4944
case brand_enum::POWERVM: return VM::brands::POWERVM;
4866
4945
case brand_enum::GCE: return VM::brands::GCE;
@@ -13970,7 +14049,8 @@ struct VM {
13970
14049
case brand_enum::BAREVISOR: return "Hypervisor (type 1)";
13971
14050
case brand_enum::HYPERPLATFORM: return "Hypervisor (type 1)";
13972
14051
case brand_enum::MINIVISOR: return "Hypervisor (type 1)";
13973
-
case brand_enum::HYPERV_ROOT: return "Host machine"; // This refers to the type 1 hypervisor where Windows normally runs under, we put "Host machine" to clarify you're not running under a traditional VM if this is detected
14052
+
case brand_enum::HYPERV_ROOT: return "Host machine"; // this refers to the type 1 hypervisor where Windows normally runs under, we put "Host machine" to clarify you're not running under a traditional VM if this is detected
14053
+
case brand_enum::HYPERV_SPOOF: return "Unknown"; // this refers to any hypervisor trying to disguise itself as a legitimate Hyper-V instance
0 commit comments