Detect Hypervisor CLI in IBM QRadar
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.
MITRE ATT&CK
- Tactic
- Execution
- Technique
- T1059 Command and Scripting Interpreter
- Sub-technique
- T1059.012 Hypervisor CLI
- Canonical reference
- https://attack.mitre.org/techniques/T1059/012/
QRadar Detection Query
SELECT
DATEFORMAT(starttime, 'yyyy-MM-dd HH:mm:ss') AS event_time,
sourceip,
hostname,
username,
"Process Name" AS process_name,
"Command" AS command_line,
LOGSOURCENAME(logsourceid) AS log_source,
CATEGORYNAME(category) AS event_category,
CASE
WHEN "Command" ILIKE '%vm process kill%' OR "Command" ILIKE '%vmsvc/power.off%' THEN 3
ELSE 0
END +
CASE
WHEN "Command" ILIKE '%vib install%' OR "Command" ILIKE '%vib remove%' OR "Command" ILIKE '%acceptance set%' THEN 3
ELSE 0
END +
CASE
WHEN "Command" ILIKE '%network firewall%' THEN 2
ELSE 0
END +
CASE
WHEN "Command" ILIKE '%enable_ssh%' OR "Command" ILIKE '%start_ssh%' THEN 2
ELSE 0
END +
CASE
WHEN "Command" ILIKE '%system syslog%' THEN 2
ELSE 0
END +
CASE
WHEN "Command" ILIKE '%vm process list%' OR "Command" ILIKE '%vmsvc/getallvms%' THEN 1
ELSE 0
END AS suspicion_score
FROM events
WHERE
starttime > NOW() - 1 DAYS AND
(
"Process Name" ILIKE '%esxcli%' OR
"Process Name" ILIKE '%vim-cmd%' OR
"Process Name" ILIKE '%esxcfg-%' OR
"Command" ILIKE '%/sbin/esxcli%' OR
"Command" ILIKE '%/bin/vim-cmd%'
) AND
(
"Command" ILIKE '%vm process kill%' OR
"Command" ILIKE '%vm process list%' OR
"Command" ILIKE '%vmsvc/power.off%' OR
"Command" ILIKE '%vmsvc/getallvms%' OR
"Command" ILIKE '%system maintenanceMode%' OR
"Command" ILIKE '%network firewall%' OR
"Command" ILIKE '%network ip%' OR
"Command" ILIKE '%vib install%' OR
"Command" ILIKE '%vib remove%' OR
"Command" ILIKE '%acceptance set%' OR
"Command" ILIKE '%system syslog%' OR
"Command" ILIKE '%system settings advanced%' OR
"Command" ILIKE '%enable_ssh%' OR
"Command" ILIKE '%start_ssh%' OR
"Command" ILIKE '%solo/registervm%' OR
"Command" ILIKE '%.vmdk%' OR
"Command" ILIKE '%.vmx%' OR
"Command" ILIKE '%nohup %' OR
"Command" ILIKE '%chmod +x%'
)
HAVING suspicion_score > 0
ORDER BY suspicion_score DESC, starttime DESC Detects suspicious use of ESXi hypervisor CLI tools (esxcli, vim-cmd, esxcfg-*) targeting VM kill operations, unauthorized VIB installations, firewall changes, SSH enablement, and syslog tampering. Scores each event by behavior severity to prioritize high-confidence ransomware and espionage activity.
Data Sources
Required Tables
False Positives & Tuning
- VMware vCenter server invoking esxcli commands remotely during automated host provisioning, patching, or maintenance mode transitions
- Authorized security scanning tools or vulnerability assessors enumerating ESXi configuration via esxcli network and system commands
- Infrastructure-as-code pipelines (Terraform VMware provider, Ansible vmware_guest modules) executing vim-cmd commands during VM lifecycle operations
Other platforms for T1059.012
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.
- Test 1ESXi VM Enumeration Simulation
Expected signal: Syslog message with facility local7 containing 'esxcli vm process list'. This validates that ESXi-format syslog messages are being ingested by the SIEM.
- Test 2ESXi VIB Installation Simulation
Expected signal: Syslog message with facility local7 containing 'vib install' and '--no-sig-check'. The --no-sig-check flag bypasses signature verification.
- Test 3ESXi VM Kill Simulation
Expected signal: Syslog message with facility local7 containing 'vm process kill --type=force'. The force kill type is used by ransomware to immediately terminate VMs.
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.