Bypass [verified] - Vm Detection
Mastering VM Detection Bypass: Techniques, Evasion, and Counter-Strategies
Bypass Techniques
Here are proven ways to defeat VM detection, ordered from simplest to most advanced.
3.7 Kernel-Level Evasion
For advanced red teams, use a rootkit or driver to hook functions that malware calls:
- Hook
NtQuerySystemInformation(SystemInformationClass 0x5 – SystemProcessInformation) to hide VM processes. - Filter
ZwQueryValueKeyfor registry queries containing "vmware" – returnSTATUS_OBJECT_NAME_NOT_FOUND. - Patch
cpuidin real-time using a kernel driver and VMX rootkit (requires nested virtualization or VMCALL hooks).
One open-source project demonstrating this is vmhide (Linux kernel module) and Anti-VM-Stealth (Windows driver). vm detection bypass
Part 4: Automated Frameworks for Bypass
Manual hardening is tedious. Several tools automate VM detection bypass:
- Hyper-V with Shielded VM – Combines hardware virtualization with isolation, but still leaves timing artifacts.
- Intel Houdini (InviZible) – Research project to run malware in a completely undetectable VM using Intel PT and virtualization cloaking.
- Al-khaser (by checkpoint) – A public anti-debug/anti-VM stress test – run it inside your hardened VM to test remaining leaks.
- Pafish (Paranoid Fish) – Another testing tool. Keep running until Pafish reports zero red flags.
For red team campaigns: Custom Python/PowerShell scripts that modify the VM on the fly. One open-source project demonstrating this is vmhide (Linux
Example PowerShell to remove registry traces (run as admin):
Get-ChildItem "HKLM:\HARDWARE\DESCRIPTION\System" -Recurse | ForEach-Object VirtualBox
1. Hardware & Registry Artifacts
- MAC addresses – OUI prefixes for VMware (
00:0C:29,00:50:56) or VirtualBox (08:00:27). - Registry keys –
HKLM\SOFTWARE\VMware, Inc.\VMware ToolsorHKLM\HARDWARE\DESCRIPTION\System\VideoBiosVersion. - Running processes –
vmtoolsd.exe,VBoxService.exe.
2.2 CPU Instructions & Red Pills
The sidt (Store Interrupt Descriptor Table) instruction – returns different values on real hardware vs. VMs. Similarly: edx to "VMwareVMware"
sgdt(Store Global Descriptor Table)sldt(Store Local Descriptor Table)cpuid(with leaf0x40000000– returns hypervisor signature like "VMwareVMware")
Example check in C:
__asm
mov eax, 0x40000000
cpuid
; compare ebx, ecx, edx to "VMwareVMware"