Skip to content
Threat Feed
medium advisory

PowerShell Virtualization Environment Detection Discovery

Adversaries utilize PowerShell commands to query WMI objects and check for virtualization artifacts to evade sandbox and analysis environments.

Adversaries often perform environment reconnaissance during the initial execution phase to determine if the host is a virtual machine or a controlled security analysis environment. By querying Windows Management Instrumentation (WMI) providers via PowerShell, attackers can identify hardware-specific strings, thermal zone sensors, or system characteristics that differ from standard physical endpoints. This capability allows malicious scripts to exit or modify their behavior if virtualization is detected, thereby bypassing automated sandbox analysis and complicating incident response efforts. Defenders should monitor for PowerShell scripts that correlate WMI object access with known virtualization-related class names.

Impact

Successful detection of analysis environments allows malware or malicious scripts to evade automated sandbox analysis, leading to missed infections and prolonged dwell time for attackers within the targeted network. This technique is commonly employed by various threat actors to protect their custom payloads from security research and automated malware analysis platforms.

Recommendation

  • Enable PowerShell Script Block Logging (Event ID 4104) across all Windows endpoints to capture the full content of executed scripts.
  • Deploy the provided Sigma rule to detect suspicious WMI queries associated with virtualization checks.
  • Baseline legitimate administrative scripts that query 'Win32_ComputerSystem' or 'MSAcpi_ThermalZoneTemperature' to minimize false positives.
  • Investigate any host where unknown scripts are actively searching for VM artifacts, as this indicates a high probability of malicious intent.

Immediate actions

Enable PowerShell Script Block Logging (Event ID 4104)

IT Operations 48h

Deploy detection rule to identify VM environment discovery behavior

Detection Engineering 72h

Threat Hunt

Search for instances of Get-WmiObject querying hardware classes in environment logs

T1497.001 medium medium confidence convert to detection

Data: Powershell Operational logs

Detection coverage 1

Detect PowerShell Virtualization Environment Discovery

medium

Detects PowerShell scripts that query specific WMI classes or objects indicative of virtualization environment discovery

sigma tactics: discovery techniques: T1497.001 sources: process_creation, windows

Detection queries are available on the platform. Get full rules →