Command and Scripting Interpreter: Hypervisor CLI

Adversaries may abuse hypervisor command line interpreters (CLIs) to execute malicious commands. Hypervisor CLIs typically enable a wide variety of functionality for managing both the hypervisor itself and the guest virtual machines it hosts.

For example, on ESXi systems, tools such as esxcli and vim-cmd allow administrators to configure firewall rules and log forwarding on the hypervisor, list virtual machines, start and stop virtual machines, and more.[1][2][3] Adversaries may be able to leverage these tools in order to support further actions, such as File and Directory Discovery or Data Encrypted for Impact.

ID: T1059.012
Sub-technique of:  T1059
Tactic: Execution
Platforms: ESXi
Contributors: Janantha Marasinghe; Liran Ravich, CardinalOps
Version: 1.0
Created: 26 March 2025
Last Modified: 15 April 2025

Procedure Examples

ID Name Description
S1096 Cheerscrypt

Cheerscrypt has leveraged esxcli in order to terminate running virtual machines.[4]

S1073 Royal

Royal ransomware uses esxcli to gather a list of running VMs and terminate them.[5]

Mitigations

This type of attack technique cannot be easily mitigated with preventive controls since it is based on the abuse of system features.

Detection

ID Data Source Data Component Detects
DS0017 Command Command Execution

Monitor command-line arguments made using hypervisor CLIs. Actions may be related to network and system information discovery, collection, or other post-compromise behaviors. On ESXi systems, monitor logs such as /var/log/shell.log to track executed commands.[6]

Analytic 1 - Logged Shell Commands

index=esxi_logs sourcetype=shell_log| rex field=_raw "(?i)(?(esxcli|vim-cmd)\s+[\w-/]+)"| search command="esxcli" OR command="vim-cmd"| eval suspicious=if(like(command, "%firewall%") OR like(command, "%loghost%") OR like(command, "%vmsvc%"), 1, 0)| stats count by command, user, host, _time, suspicious| where suspicious=1

References