Hypervisor CLI
Adversaries may abuse hypervisor command line interpreters (CLIs) to execute malicious commands. Hypervisor CLIs enable functionality for managing both the hypervisor and guest virtual machines. On ESXi systems, tools such as esxcli and vim-cmd allow administrators to configure firewall rules, manage log forwarding, list/start/stop virtual machines, and more. Adversaries leverage these tools for discovery, VM termination (ransomware), firewall manipulation, and persistence. UNC3886 used esxcli extensively for malware installation and artifact removal. Ransomware families including Cheerscrypt, Royal, and BlackBasta use esxcli to enumerate and terminate VMs before encryption.
let SuspiciousCommands = dynamic([
"esxcli vm process kill", "esxcli vm process list",
"vim-cmd vmsvc/power.off", "vim-cmd vmsvc/getallvms",
"esxcli system maintenanceMode",
"esxcli network firewall", "esxcli network ip",
"esxcli software vib install", "esxcli software vib remove",
"esxcli software acceptance set",
"esxcli system syslog", "esxcli system settings advanced",
"vim-cmd hostsvc/enable_ssh", "vim-cmd hostsvc/start_ssh",
"vim-cmd solo/registervm",
"/sbin/esxcli", "/bin/vim-cmd",
"chmod +x", "nohup",
".vmdk", ".vmx", ".vmsd", ".vmsn"
]);
Syslog
| where TimeGenerated > ago(24h)
| where Computer has_any ("esx", "vmware") or ProcessName has_any ("esxcli", "vim-cmd", "hostd", "vpxa")
| where SyslogMessage has_any (SuspiciousCommands)
| extend VMKill = SyslogMessage has_any ("vm process kill", "power.off")
| extend VIBInstall = SyslogMessage has "vib install"
| extend FirewallChange = SyslogMessage has "network firewall"
| extend SSHEnable = SyslogMessage has_any ("enable_ssh", "start_ssh")
| extend SyslogModify = SyslogMessage has "system syslog"
| project TimeGenerated, Computer, ProcessName, SyslogMessage,
VMKill, VIBInstall, FirewallChange, SSHEnable, SyslogModify
| sort by TimeGenerated desc Data Sources
Required Tables
False Positives
- VMware administrators performing routine VM management (start/stop VMs during maintenance)
- Patching operations installing legitimate VIBs during scheduled maintenance windows
- Infrastructure automation tools (vRealize, Ansible) managing ESXi hosts
References (6)
- https://attack.mitre.org/techniques/T1059/012/
- https://developer.broadcom.com/xapis/esxcli-command-reference/latest/
- https://lolesxi-project.github.io/LOLESXi/
- https://www.crowdstrike.com/en-us/blog/hypervisor-jackpotting-ecrime-actors-increase-targeting-of-esxi-servers/
- https://www.mandiant.com/resources/blog/esxi-hypervisors-malware-persistence
- https://www.trendmicro.com/en_us/research/22/e/new-linux-based-ransomware-cheerscrypt-targets-exsi-devices.html
Unlock Pro Content
Get the full detection package for T1059.012 including response playbook, investigation guide, and atomic red team tests.