When running software inside a virtual machine (VM), some programs can detect the VM environment and behave differently or refuse to run. This guide provides a detailed walkthrough on configuring your VMware virtual machine to minimize detection by software running inside it.
The .vmx
file contains the configuration for your VMware virtual machine. By tweaking some of its parameters, you can disguise the VM to make it less detectable. Below are the sections with modifications and explanations for each.
These changes alter the virtual CPU's behavior to mask certain VMware-specific features that may be detectable by software.
# Disable extended registers to hide APIC information
cpuid.disable_apicExtRegs = "TRUE"
# Provide full CPUID information
monitor_control.enable_fullcpuid="TRUE"
# Mask the CPU identification (modify these values as needed)
cpuid.1.eax = "0---:----:----:----:----:----:----:----"
cpuid.1.ecx = "0---:----:----:----:----:----:----:----"
cpuid.1.edx = "0---:----:----:----:----:----:----:----"
These options prevent the VM from being identified by common backdoor and hypervisor detection techniques.
# Restrict VMware backdoor
monitor_control.restrict_backdoor = "TRUE"
# Disable direct execution to limit detection
monitor_control.disable_directexec = "TRUE"
# Disable several VMware-specific instructions
monitor_control.disable_chksimd = "TRUE"
monitor_control.disable_ntreloc = "TRUE"
monitor_control.disable_selfmod = "TRUE"
monitor_control.disable_reloc = "TRUE"
monitor_control.disable_btinout = "TRUE"
monitor_control.disable_btmemspace = "TRUE"
monitor_control.disable_btpriv = "TRUE"
monitor_control.disable_btseg = "TRUE"
These settings further modify how the virtual machine reports timing and CPU-related information.
# Enable extended core features and paravirtualization
monitor_control.enable_extended_core = "TRUE"
monitor_control.enable_paravirt = "TRUE"
# Control time-stamp counter (TSC) behavior
monitor_control.virtual_rdtsc = "FALSE"
These lines prevent VMware-specific tools from exposing VM information to guest software.
# Disable various isolation tools that can leak VM information
isolation.tools.getPtrLocation.disable = "TRUE"
isolation.tools.setPtrLocation.disable = "TRUE"
isolation.tools.getVersion.disable = "TRUE"
isolation.tools.setVersion.disable = "TRUE"
# Disable shared folders (HGFS)
isolation.tools.hgfs.disable = "TRUE"
The SMBIOS (System Management BIOS) can reveal that a system is virtualized. These settings help reflect host machine information instead.
# Reflect the host's system information instead of VMware defaults
SMBIOS.reflecthost = "TRUE"
SMBIOS.assettag = "IBM Corporation" # Modify as needed
SMBIOS.useShortSerialNumber = "TRUE"
# Suppress OEM strings
SMBIOS.noOEMStrings = "TRUE"
To disguise your VM's hardware, these options reflect the host's hardware settings.
# Reflect the host machine's hardware details
board-id.reflectHost = "TRUE"
hw.model.reflectHost = "TRUE"
serialNumber.reflectHost = "TRUE"
Change the product and vendor ID of the virtual disk to further hide its virtual nature.
# Customize the virtual disk's product and vendor IDs
scsi0:0.productID = "ProductID"
scsi0:0.vendorID = "ProductVendor"
Recommended values for SCSI device:
scsi0:0.productID = "WDC WD10EZEX-08WN4A0"
scsi0:0.vendorID = "Western Digital"
scsi0:0.productID = "ST1000DM010"
scsi0:0.vendorID = "Seagate"
scsi0:0.productID = "Samsung SSD 850"
scsi0:0.vendorID = "Samsung"
scsi0:0.productID = "HDS721010DLE630"
scsi0:0.vendorID = "Hitachi"
scsi0:0.productID = "INTEL SSDSC2BB240G4"
scsi0:0.vendorID = "Intel"
scsi0:0.productID = "DT01ACA100"
scsi0:0.vendorID = "Toshiba"
Disable the hypervisor CPUID flag to further hide the VM.
# Disable the hypervisor CPUID feature
hypervisor.cpuid.v0 = "FALSE"
Many software programs check for known virtual MAC address ranges. You can change your VM’s MAC address to a custom value that doesn’t match VMware’s range.
.vmx
file.ethernet0.generatedAddress
.Example:
ethernet0.generatedAddress = "00:1A:2B:3C:4D:5E"
VirtualBox allows you to mask some CPU features that can reveal virtualization.
.vbox
file associated with your VM.<CPU>
to hide the hypervisor presence.This hides CPUID leafs often checked by software to detect a virtual environment.
VirtualBox’s Guest Additions can expose the VM's presence. To minimize this:
VBoxManage setextradata "<VM Name>" "VBoxInternal2/SharedFoldersEnableSymlinksCreate/<<FolderName>>" 0
Modify VirtualBox’s system settings to emulate a real machine’s BIOS and other system identifiers.
1. Change the DMI BIOS information:
VBoxManage setextradata "<VM Name>" "VBoxInternal/Devices/pcbios/0/Config/DmiBIOSVendor" "American Megatrends Inc."
VBoxManage setextradata "<VM Name>" "VBoxInternal/Devices/pcbios/0/Config/DmiBIOSVersion" "X1234"
VBoxManage setextradata "<VM Name>" "VBoxInternal/Devices/pcbios/0/Config/DmiSystemProduct" "ThinkPad T480"
VBoxManage setextradata "<VM Name>" "VBoxInternal/Devices/pcbios/0/Config/DmiSystemVersion" "6J"
2. Set System Manufacturer and Serial Numbers:
VBoxManage setextradata "<VM Name>" "VBoxInternal/Devices/pcbios/0/Config/DmiSystemVendor" "LENOVO"
VBoxManage setextradata "<VM Name>" "VBoxInternal/Devices/pcbios/0/Config/DmiBoardProduct" "ThinkPad T480"
VBoxManage setextradata "<VM Name>" "VBoxInternal/Devices/pcbios/0/Config/DmiSystemSerial" "123456789"
3. Set Other Hardware IDs: This disguises your VM’s hardware.
VBoxManage setextradata "<VM Name>" "VBoxInternal/Devices/acpi/0/Config/AcpiOemId" "HP"
VBoxManage setextradata "<VM Name>" "VBoxInternal/Devices/acpi/0/Config/AcpiCreatorId" "LENOVO"
VirtualBox VMs use a MAC address prefix detectable as virtual. Changing the MAC to something typical for physical machines is essential.
VBoxManage modifyvm "<VM Name>" --macaddress1 "001A2B3C4D5E"
Avoid MAC prefixes such as 08:00:27
, which are reserved for VirtualBox VMs.
RDTSC (Read Time-Stamp Counter) can be used to detect VMs due to timing differences. Enable control over this feature to simulate real hardware.
VBoxManage setextradata "<VM Name>" "VBoxInternal/TM/TSCTiedToExecution" 1
Disabling certain virtualization features can prevent software from detecting it as a VM.
VBoxManage modifyvm "<VM Name>" --nested-hw-virt off
Hiding drivers, registry entries, executables, and processes that might be linked to a VM virtualization agent is crucial to ensure that a malicious actor cannot detect that they are in a monitored environment.
There are many tools on GitHub available, I have personally made one which you can find in the following repository.
Note: Windows administrator mode is not sufficient for obfuscating system drivers. For this we need to elevate to "nt authority system", we can achieve this with tools like PsExec.
Feel free to tweak the configurations according to your specific environment and needs!
bc1q4uzvtx6nsgt7pt7678p9rqel4hkhskpxvck8uq
0x7a70a0C1889A9956460c3c9DCa8169F25Bb098af
7UcE4PzrHoGqFKHyVgsme6CdRSECCZAoWipsHntu5rZx