T1497

Virtualization/Sandbox Evasion

Defense Evasion Discovery Last updated:

Adversaries may employ various means to detect and avoid virtualization and analysis environments. This may include changing behaviors based on the results of checks for the presence of artifacts indicative of a virtual machine environment (VME) or sandbox. If the adversary detects a VME, they may alter their malware to disengage from the victim or conceal the core functions of the implant. They may also search for VME artifacts before dropping secondary or additional payloads. Methods include checking for security monitoring tools, system artifacts associated with virtualization, legitimate user activity patterns, and time-based anomalies.

What is T1497 Virtualization/Sandbox Evasion?

Virtualization/Sandbox Evasion (T1497) maps to the Defense Evasion and Discovery tactics — the adversary is trying to avoid being detected in MITRE ATT&CK.

This page provides production-ready detection logic for Virtualization/Sandbox Evasion, covering the data sources and telemetry it touches: Process: Process Creation, Command: Command Execution, Windows Registry: Windows Registry Key Access, Microsoft Defender for Endpoint. The queries below are rated medium severity at medium confidence, and ship for 7 SIEM platforms — KQL, SPL, Elastic, QRadar, Sumo, YARA-L, LogScale.

MITRE ATT&CK

Tactic
Defense Evasion Discovery
Technique
T1497 Virtualization/Sandbox Evasion
Canonical reference
https://attack.mitre.org/techniques/T1497/
Microsoft Sentinel / Defender
kusto
let VMDetectCommands = dynamic(["MSAcpi_ThermalZoneTemperature", "Win32_Fan", "Win32_ComputerSystem", "VMwareHostOpen.exe", "VBoxService", "vmtoolsd", "vmwaretray", "vboxservice", "qemu-ga", "vmusrvc", "vmsrvc"]);
let VMDetectRegistry = dynamic(["HKLM\\SOFTWARE\\VMware", "HKLM\\SOFTWARE\\Oracle\\VirtualBox", "SYSTEM\\CurrentControlSet\\Services\\VBoxGuest", "SYSTEM\\CurrentControlSet\\Enum\\PCI\\VEN_15AD", "SYSTEM\\CurrentControlSet\\Enum\\PCI\\VEN_80EE"]);
let SandboxDetectTools = dynamic(["wireshark", "procmon", "procexp", "fiddler", "x64dbg", "x32dbg", "ollydbg", "ida64", "idaq", "windbg", "regmon", "filemon", "autoruns"]);
DeviceProcessEvents
| where Timestamp > ago(24h)
| where ProcessCommandLine has_any (VMDetectCommands)
    or ProcessCommandLine has_any (VMDetectRegistry)
    or (FileName =~ "wmic.exe" and ProcessCommandLine has_any ("MSAcpi_ThermalZoneTemperature", "Win32_Fan", "Win32_ComputerSystem", "Win32_BaseBoard", "Win32_BIOS"))
    or (FileName =~ "reg.exe" and ProcessCommandLine has_any ("VMware", "VirtualBox", "VBoxGuest", "QEMU"))
    or (ProcessCommandLine has "tasklist" and ProcessCommandLine has_any (SandboxDetectTools))
| extend WMICheck = ProcessCommandLine has_any ("MSAcpi_ThermalZoneTemperature", "Win32_Fan", "Win32_ComputerSystem", "Win32_BIOS")
| extend RegistryCheck = ProcessCommandLine has_any ("VMware", "VirtualBox", "VBoxGuest", "QEMU") and FileName =~ "reg.exe"
| extend ProcessScan = ProcessCommandLine has "tasklist" and ProcessCommandLine has_any (SandboxDetectTools)
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine,
         InitiatingProcessFileName, InitiatingProcessCommandLine,
         WMICheck, RegistryCheck, ProcessScan
| sort by Timestamp desc

Broad detection for virtualization and sandbox evasion techniques. Monitors for WMI queries targeting thermal zone temperature (VM detection), fan/hardware checks, registry queries for VMware/VirtualBox/QEMU artifacts, and process enumeration looking for analysis tools (Wireshark, ProcMon, debuggers). Covers techniques used by Agent Tesla, Bumblebee, GravityRAT, QakBot, and Raspberry Robin.

medium severity medium confidence

Data Sources

Process: Process Creation Command: Command Execution Windows Registry: Windows Registry Key Access Microsoft Defender for Endpoint

Required Tables

DeviceProcessEvents

False Positives

  • System administrators running WMI queries for hardware inventory and asset management
  • IT automation tools (SCCM, Intune, ManageEngine) collecting system hardware information via WMI
  • Security teams running sandbox detection tests as part of adversary emulation exercises
  • System monitoring software that queries hardware sensors for health dashboards

Sigma rule & cross-platform mapping

The detection logic for Virtualization/Sandbox Evasion (T1497) above is provided in a vendor-neutral form so you can deploy it on any SIEM. The same logic is shipped here as native KQL (Microsoft Sentinel / Defender), SPL (Splunk), Elastic (Elastic Security (EQL)), QRadar (IBM QRadar (AQL)), Sumo (Sumo Logic CSE), YARA-L (Google Chronicle / SecOps), LogScale (CrowdStrike LogScale (CQL)) queries. In Sigma terms, this detection targets the following logsource:

logsource:
  category: process_creation
  product: windows

Browse the community-maintained Sigma rules for this technique:


Testing Methodology

Validate this detection against 3 adversary techniques from Atomic Red Team. Each test below lists the behaviour to exercise and the telemetry you should expect to see. Executable commands and cleanup steps are available with Pro.

  1. Test 1WMI thermal zone temperature check for VM detection

    Expected signal: Sysmon Event ID 1: Process Create with Image=wmic.exe, CommandLine containing 'MSAcpi_ThermalZoneTemperature'. WMI trace log entry in Microsoft-Windows-WMI-Activity/Operational.

  2. Test 2Registry check for VMware artifacts

    Expected signal: Sysmon Event ID 1: Process Create with Image=reg.exe, CommandLine containing 'VMware' and 'VBoxGuest'. Sysmon Event ID 13: RegistryEvent for key access.

  3. Test 3Process enumeration for analysis tools

    Expected signal: Sysmon Event ID 1: Multiple Process Create events for tasklist.exe with filter arguments. Each tasklist invocation generates a separate process event.


Response Playbook

Triage

  1. Determine the context — is this an endpoint that legitimately runs in a VM, or is it a physical workstation?
  2. Examine the parent process chain — was the VM detection initiated by a known application, a recently downloaded binary, or a script?
  3. Check if the process made additional checks beyond a single query — multiple VM/sandbox detection techniques in sequence is a strong indicator of evasion behavior
  4. Look for conditional behavior — did the process exit, sleep, or change behavior after the VM check?
  5. Correlate with recent file downloads or email attachments — VM evasion is often the first step in a malware execution chain
  6. Check if the process is signed — unsigned binaries performing VM detection are much more suspicious

Containment

  1. If confirmed malware with sandbox evasion: quarantine the binary via EDR and block its hash environment-wide
  2. Submit the sample to a sandbox that can handle evasion techniques (counter-evasion enabled) for full behavioral analysis
  3. If the malware evaded initial sandbox analysis: resubmit with anti-evasion countermeasures (hardware-backed analysis)
  4. Investigate the delivery mechanism and block the initial access vector (phishing email, malicious URL, etc.)
  5. Check other endpoints that may have received the same payload via the same delivery mechanism

Evidence Collection

  1. Sysmon Event ID 1 (Process Create) for the VM detection process and full parent chain
  2. Sysmon Event ID 13 (Registry Value Set/Delete) for registry queries targeting VM artifacts
  3. Sysmon Event ID 17/18 (Pipe Create/Connect) for named pipes associated with VM tools
  4. WMI trace logs (Microsoft-Windows-WMI-Activity/Operational) for WMI-based VM queries
  5. File system: the binary itself for reverse engineering and sandbox resubmission
  6. Network logs: any C2 communication that occurred after the VM check passed

Escalation Criteria

  • ! Multiple VM/sandbox evasion techniques executed in sequence by the same process (systematic evasion)
  • ! VM evasion check followed by payload deployment or C2 communication
  • ! Evasion behavior from a binary that arrived via email attachment or web download
  • ! Process terminates itself after detecting VM artifacts (confirms evasion intent)
  • ! Same VM-evasive sample detected on multiple endpoints (campaign-level threat)

Investigation Guide

Forensic Artifacts

  • > Registry: HKLM\SOFTWARE\VMware, Inc. (VMware guest tools)
  • > Registry: HKLM\SOFTWARE\Oracle\VirtualBox Guest Additions (VirtualBox)
  • > Registry: HKLM\SYSTEM\CurrentControlSet\Services\VBoxGuest (VirtualBox driver)
  • > Registry: HKLM\SYSTEM\CurrentControlSet\Enum\PCI\VEN_15AD (VMware PCI devices)
  • > File System: C:\Windows\System32\drivers\VBoxMouse.sys, VBoxGuest.sys (VirtualBox drivers)
  • > File System: C:\Program Files\VMware\VMware Tools\ (VMware Tools installation)
  • > WMI: Win32_ComputerSystem.Model contains 'Virtual' or 'VMware'
  • > Process List: vmtoolsd.exe, VBoxService.exe, qemu-ga.exe running

Tuning Guidance

VM/sandbox evasion detections have moderate false positive rates due to legitimate hardware inventory and monitoring tools. Key tuning strategies: (1) Exclude known asset management tools (SCCM client, ManageEngine, Lansweeper) that run WMI hardware queries on schedule. (2) Focus on the parent process — WMI hardware queries from wscript.exe, mshta.exe, powershell.exe, or unknown binaries are suspicious; those from sccm.exe are expected. (3) Weight multiple evasion techniques from the same process higher than individual checks. (4) For registry-based detections, exclude vmtoolsd.exe and VBoxService.exe which legitimately access their own keys. (5) On analysis workstations, these detections will fire frequently — consider separate rulesets for analyst VMs.


Hunting Queries

Hunt for WMI thermal zone and fan sensor queries — classic VM detection techniques. Physical machines have temperature sensors; most VMs do not. OopsIE (OilRig) and GravityRAT specifically use this technique.

Hunting — KQL
kql
DeviceProcessEvents
| where Timestamp > ago(7d)
| where FileName =~ "wmic.exe" and ProcessCommandLine has_any ("MSAcpi_ThermalZoneTemperature", "Win32_Fan")
| project Timestamp, DeviceName, AccountName, ProcessCommandLine, InitiatingProcessFileName, InitiatingProcessCommandLine
| sort by Timestamp desc
Hunting — SPL
spl
index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=1 Image="*\\wmic.exe" (CommandLine="*MSAcpi_ThermalZoneTemperature*" OR CommandLine="*Win32_Fan*")
| table _time, host, User, CommandLine, ParentImage, ParentCommandLine
| sort - _time

Hunt for non-VM-tool processes querying VM-related registry keys. Legitimate VM tools (vmtoolsd, VBoxService) access their own keys — other processes doing so indicates sandbox/VM detection behavior.

Hunting — KQL
kql
DeviceRegistryEvents
| where Timestamp > ago(7d)
| where RegistryKey has_any ("VMware", "VirtualBox", "VBoxGuest", "QEMU", "VEN_15AD", "VEN_80EE")
| where InitiatingProcessFileName !in~ ("vmtoolsd.exe", "VBoxService.exe", "MsMpEng.exe", "explorer.exe")
| project Timestamp, DeviceName, AccountName, RegistryKey, InitiatingProcessFileName, InitiatingProcessCommandLine
| sort by Timestamp desc
Hunting — SPL
spl
index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=13 (TargetObject="*VMware*" OR TargetObject="*VirtualBox*" OR TargetObject="*VBoxGuest*" OR TargetObject="*QEMU*" OR TargetObject="*VEN_15AD*" OR TargetObject="*VEN_80EE*") NOT (Image="*vmtoolsd.exe" OR Image="*VBoxService.exe" OR Image="*MsMpEng.exe")
| table _time, host, User, Image, TargetObject
| sort - _time

Hunt for known VM detection and anti-analysis testing tools (pafish, al-khaser, vmdetect.exe). While these are used by researchers, their presence on production endpoints is suspicious. Metamorfo malware has embedded vmdetect.exe.

Hunting — KQL
kql
DeviceProcessEvents
| where Timestamp > ago(7d)
| where ProcessCommandLine has_any ("vmdetect", "pafish", "al-khaser", "SandboxEvasion", "AntiVM")
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine, InitiatingProcessFileName
| sort by Timestamp desc
Hunting — SPL
spl
index=wineventlog sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=1 (CommandLine="*vmdetect*" OR CommandLine="*pafish*" OR CommandLine="*al-khaser*" OR CommandLine="*SandboxEvasion*" OR CommandLine="*AntiVM*")
| table _time, host, User, Image, CommandLine, ParentImage
| sort - _time

Atomic Red Team Tests

Test 1 WMI thermal zone temperature check for VM detection
windows

Queries the WMI MSAcpi_ThermalZoneTemperature class to check for hardware temperature sensors. Virtual machines typically lack thermal zones, so an empty result indicates a VM. This exact WMI query is used by OopsIE (OilRig) and GravityRAT for sandbox evasion.

Command

powershell
wmic /namespace:\\root\WMI path MSAcpi_ThermalZoneTemperature get CurrentTemperature

Expected Telemetry

Sysmon Event ID 1: Process Create with Image=wmic.exe, CommandLine containing 'MSAcpi_ThermalZoneTemperature'. WMI trace log entry in Microsoft-Windows-WMI-Activity/Operational.

Expected Detection

Alert fires on 'MSAcpi_ThermalZoneTemperature' WMI query. KQL: WMICheck=true. SPL: WMIVMCheck=1, SuspicionScore >= 2.

Test 2 Registry check for VMware artifacts
windows

Queries the Windows registry for VMware-related keys that indicate the presence of VMware virtual machine guest tools. Malware families like Bumblebee, SodaMaster, and DarkTortilla check for these keys before proceeding with their payload.

Command

powershell
reg query "HKLM\SOFTWARE\VMware, Inc.\VMware Tools" 2>nul & reg query "HKLM\SYSTEM\CurrentControlSet\Services\VBoxGuest" 2>nul

Expected Telemetry

Sysmon Event ID 1: Process Create with Image=reg.exe, CommandLine containing 'VMware' and 'VBoxGuest'. Sysmon Event ID 13: RegistryEvent for key access.

Expected Detection

Alert fires on reg.exe querying VMware/VirtualBox registry keys. KQL: RegistryCheck=true. SPL: RegistryVMCheck=1, SuspicionScore >= 2.

Test 3 Process enumeration for analysis tools
windows

Uses tasklist to search for common security analysis tools (Wireshark, Process Monitor, debuggers) that indicate an analysis environment. QakBot, Lucifer, and WhisperGate check for these tools before executing their payloads.

Command

powershell
tasklist /FI "IMAGENAME eq wireshark.exe" & tasklist /FI "IMAGENAME eq procmon.exe" & tasklist /FI "IMAGENAME eq x64dbg.exe" & tasklist /FI "IMAGENAME eq ollydbg.exe"

Expected Telemetry

Sysmon Event ID 1: Multiple Process Create events for tasklist.exe with filter arguments. Each tasklist invocation generates a separate process event.

Expected Detection

Alert fires on tasklist + analysis tool name pattern. KQL: ProcessScan=true. SPL: ProcessScan=1, SuspicionScore >= 2.

Related Detections