Detecting sandboxes and VMs
Malware authors know that if their malware sample is running on a VM, then it’s probably being analyzed by a reverse engineer or it’s probably running under the analysis of an automated tool such as a sandbox. There are multiple ways in which malware authors can detect VMs and sandboxes. Let’s go over some of them now.
Different output between VMs and real machines
Malware authors could use certain unique characteristics of some assembly instructions when executed on VMs. Some examples of these are listed as follows:
- CPUID hypervisor bit: The
CPUID
instruction returns information about the CPU and provides a leaf/ID of this information ineax
. For leaf 0x01 (eax = 1), theCPUID
instruction sets bit 31 to 1, indicating that the operating system is running inside a VM or a hypervisor. - Virtualization brand: With the
CPUID
instruction, given eax = 0x40000000, it could return the name of the virtualization tool (if present...