T1673 Microsoft Sentinel · KQL

Detect Virtual Machine Discovery in Microsoft Sentinel

This detection identifies adversaries attempting to enumerate virtual machines running on hypervisors or virtualization platforms. Attackers who gain access to a hypervisor host — such as VMware ESXi, Hyper-V, or KVM — commonly enumerate all running VMs as a precursor to destructive operations like ransomware deployment or service disruption. Key indicators include execution of hypervisor CLI tools (esxcli, vim-cmd, virsh, VBoxManage), PowerShell Hyper-V cmdlets (Get-VM, Get-VMHost), and unauthorized access to vSphere or vCenter management interfaces. This technique has been observed by ransomware groups including Cheerscrypt, Qilin, and Play, as well as nation-state actors like UNC3886 targeting ESXi infrastructure.

MITRE ATT&CK

Tactic
Discovery
Technique
T1673 Virtual Machine Discovery
Canonical reference
https://attack.mitre.org/techniques/T1673/

KQL Detection Query

Microsoft Sentinel (KQL)
kusto
let VMDiscoveryPatterns = dynamic(["vm process list", "vmsvc/getallvms", "vmsvc/power.getstate", "vmsvc/getallvms", "esxcli vm", "esxcli storage", "esxcli network vm"]);
let HyperVCmdlets = dynamic(["Get-VM", "Get-VHD", "Get-VMHost", "Get-VMSwitch", "Get-VMNetworkAdapter", "Get-VMSnapshot", "Get-VMReplication"]);
let VBoxCommands = dynamic(["list vms", "list runningvms", "list hdds"]);
DeviceProcessEvents
| where Timestamp > ago(1d)
| where (
    // VMware ESXi enumeration via esxcli or vim-cmd
    (ProcessCommandLine has_any ("esxcli", "vim-cmd") and ProcessCommandLine has_any (VMDiscoveryPatterns))
    // Hyper-V enumeration via PowerShell
    or (FileName in~ ("powershell.exe", "pwsh.exe") and ProcessCommandLine has_any (HyperVCmdlets))
    // VirtualBox management enumeration
    or (FileName =~ "VBoxManage.exe" and ProcessCommandLine has_any (VBoxCommands))
    // VMware Workstation/Fusion vmrun list
    or (FileName =~ "vmrun.exe" and ProcessCommandLine has "list")
    // virsh enumeration on Windows Subsystem or cross-platform tools
    or (FileName =~ "virsh.exe" and ProcessCommandLine has_any ("list", "dominfo", "nodeinfo"))
    // prlctl (Parallels) enumeration
    or (FileName =~ "prlctl" and ProcessCommandLine has "list")
)
| extend CommandType = case(
    ProcessCommandLine has_any ("esxcli", "vim-cmd"), "ESXi-CLI",
    FileName in~ ("powershell.exe", "pwsh.exe") and ProcessCommandLine has_any (HyperVCmdlets), "HyperV-PowerShell",
    FileName =~ "VBoxManage.exe", "VirtualBox-CLI",
    FileName =~ "vmrun.exe", "VMware-Workstation",
    FileName =~ "virsh.exe", "KVM-virsh",
    "Other"
)
| project
    Timestamp,
    DeviceName,
    AccountName,
    AccountDomain,
    FileName,
    ProcessCommandLine,
    InitiatingProcessFileName,
    InitiatingProcessCommandLine,
    InitiatingProcessAccountName,
    CommandType,
    FolderPath,
    ProcessId
| order by Timestamp desc
high severity high confidence

Detects execution of hypervisor management CLI tools and PowerShell cmdlets used to enumerate virtual machines across VMware ESXi (esxcli, vim-cmd), Microsoft Hyper-V (Get-VM and related cmdlets), VirtualBox (VBoxManage list), VMware Workstation (vmrun list), and KVM/libvirt (virsh list). Flags commands that specifically enumerate running VMs, VM configurations, or VM host resources — common precursors to ransomware targeting of virtualized environments.

Data Sources

Microsoft Defender for Endpoint

Required Tables

DeviceProcessEvents

False Positives & Tuning

  • VMware infrastructure administrators running routine health checks with esxcli or vim-cmd during scheduled maintenance windows
  • Backup and DR solutions (Veeam, Zerto, Commvault) enumerating VMs prior to snapshot-based backup jobs
  • Monitoring agents (vRealize Operations, Prometheus VMware exporter, Nagios XI with VMware plugins) polling VM inventory on a schedule
  • Ansible, Terraform, or PowerCLI automation scripts performing VM lifecycle management or infrastructure-as-code operations
  • IT asset discovery tools (ServiceNow Discovery, Qualys, Rapid7) enumerating virtualized infrastructure during scheduled scans
Download portable Sigma rule (.yml)

Other platforms for T1673


Testing Methodology

Validate this detection against 4 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 1ESXi VM Enumeration via esxcli

    Expected signal: ESXi shell.log will record esxcli and vim-cmd executions with timestamp and user. If executed via SSH, sshd logs on ESXi will show the originating client IP. Network logs will show SSH connection from management workstation to ESXi management IP on port 22.

  2. Test 2Hyper-V VM Enumeration via PowerShell

    Expected signal: Sysmon Event ID 1 (Process Create) with Image=powershell.exe and CommandLine containing Get-VM and Get-VMHost. Windows Security Event 4688 if process creation auditing with command line is enabled. PowerShell ScriptBlock logging (Event ID 4104) will capture the full command in the Microsoft-Windows-PowerShell/Operational log.

  3. Test 3VirtualBox VM Enumeration via VBoxManage

    Expected signal: Sysmon Event ID 1 with Image=VBoxManage.exe and CommandLine containing 'list vms', 'list runningvms', and 'list hdds'. Windows prefetch file C:\Windows\Prefetch\VBOXMANAGE.EXE-*.pf will be created or updated.

  4. Test 4KVM/libvirt VM Enumeration via virsh

    Expected signal: Linux auditd syscall logs will record execve events for virsh with all arguments if audit rules target /usr/bin/virsh. Syslog will contain process execution records. On endpoints with MDE Linux agent, DeviceProcessEvents will capture virsh execution with CommandLine.

Unlock Pro Content

Get the full detection package for T1673 including response playbook, investigation guide, and atomic red team tests.

Response PlaybookInvestigation GuideHunting QueriesAtomic Red Team TestsTuning Guidance

Related Detections