T1497 IBM QRadar · QRadar

Detect Virtualization/Sandbox Evasion in IBM QRadar

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.

MITRE ATT&CK

Tactic
Defense Evasion Discovery
Technique
T1497 Virtualization/Sandbox Evasion
Canonical reference
https://attack.mitre.org/techniques/T1497/

QRadar Detection Query

IBM QRadar (QRadar)
sql
SELECT
  DATEFORMAT(starttime, 'YYYY-MM-dd HH:mm:ss') AS EventTime,
  sourceip AS SourceIP,
  username AS UserName,
  "Image" AS ProcessImage,
  "CommandLine" AS CommandLine,
  "ParentImage" AS ParentProcess,
  CASE WHEN LOWER("CommandLine") IMATCHES '(msacpi_thermalzonetemperature|win32_fan|win32_computersystem|win32_bios|win32_baseboard)' AND LOWER("Image") IMATCHES 'wmic\.exe' THEN 2 ELSE 0 END +
  CASE WHEN LOWER("CommandLine") IMATCHES '(vmware|virtualbox|vboxguest|qemu|ven_15ad|ven_80ee)' AND LOWER("Image") IMATCHES 'reg\.exe' THEN 2 ELSE 0 END +
  CASE WHEN LOWER("CommandLine") IMATCHES 'tasklist' AND LOWER("CommandLine") IMATCHES '(wireshark|procmon|procexp|fiddler|x64dbg|x32dbg|ollydbg|ida64|windbg|autoruns|regmon|filemon)' THEN 2 ELSE 0 END +
  CASE WHEN LOWER("CommandLine") IMATCHES '(vmtoolsd|vmwaretray|vboxservice|vmusrvc|vmsrvc|qemu-ga)' THEN 1 ELSE 0 END AS SuspicionScore
FROM events
WHERE LOGSOURCETYPENAME(devicetype) IN ('Microsoft Windows Security Event Log', 'Snare for Windows Sysmon')
  AND "EventID" = 1
  AND (
    LOWER("CommandLine") IMATCHES '(msacpi_thermalzonetemperature|win32_fan|win32_computersystem|win32_bios|win32_baseboard|vmtoolsd|vmwaretray|vboxservice|vmusrvc|vmsrvc|qemu-ga)'
    OR (LOWER("CommandLine") IMATCHES '(vmware|virtualbox|vboxguest|qemu|ven_15ad|ven_80ee)' AND LOWER("Image") IMATCHES 'reg\.exe')
    OR (LOWER("CommandLine") IMATCHES 'tasklist' AND LOWER("CommandLine") IMATCHES '(wireshark|procmon|procexp|fiddler|x64dbg|x32dbg|ollydbg|ida64|windbg|autoruns|regmon|filemon)')
  )
LAST 24 HOURS
high severity medium confidence

Detects T1497 Virtualization/Sandbox Evasion in IBM QRadar using AQL against Sysmon EventID 1 (Process Create) events. Applies a weighted suspicion score across four VM evasion categories using IMATCHES for case-insensitive regex: WMI hardware artifact queries via wmic.exe (score 2), VM registry key enumeration via reg.exe (score 2), sandbox analysis tool detection via tasklist (score 2), and direct VM guest process detection (score 1). Results include the raw process image and command line for analyst triage.

Data Sources

Windows Sysmon (EventID 1 via Snare or WinCollect)Windows Security Event Log (EventID 4688 with enhanced process auditing)

Required Tables

events

False Positives & Tuning

  • System administrators using WMIC for routine hardware diagnostics — Win32_BIOS and MSAcpi_ThermalZoneTemperature queries appear in many legitimate hardware monitoring and IPMI management workflows
  • Dedicated VM hosts running VMware ESXi guest tools or VirtualBox Guest Additions where vmtoolsd.exe and vboxservice.exe are expected resident processes — exclude by CIDR range or asset group for known hypervisor infrastructure
  • Authorized red team or penetration testing engagements that include VM evasion checks as part of scoped adversary simulation — correlate SuspicionScore spikes with change windows and approved test plans

Other platforms for T1497


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 1 WMI 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 2 Registry 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 3 Process 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

Related Techniques

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