ESXi Payload Executed Against Datastore
Detects a program launched from the ESXi shell against /vmfs/volumes. The datastore holds the virtual disks of
every guest. A process pointed at that path can read or encrypt those disks and take the hosted virtual machines
offline.
Rule type: query
Rule indices:
- logs-vsphere.log-*
Rule Severity: high
Risk Score: 73
Runs every:
Searches indices from: now-9m
Maximum alerts per execution: 100
References:
- https://lolesxi-project.github.io/LOLESXi/#
- https://blogs.vmware.com/security/2022/10/esxi-targeting-ransomware-tactics-and-techniques-part-2.html
- https://detect.fyi/vmware-esxi-logging-detection-opportunities-4fb56411ec21
Tags:
- Domain: Endpoint
- Data Source: VMware vSphere
- Use Case: Threat Detection
- Tactic: Execution
- Tactic: Impact
- Resources: Investigation Guide
- Rule Type: Custom Query (KQL)
- Platform: VMware ESXi
- Threat: Ransomware
Version: 1
Rule authors:
- Elastic
Rule license: Elastic License v2
This rule requires ESXi host logs collected by the Elastic vSphere integration: https://www.elastic.co/docs/reference/integrations/vsphere
This is the launch command. A path under /tmp, or python, is invoked with /vmfs/volumes as an argument. Ragnar Locker uses /tmp/<filename> /vmfs/volumes/<UUID>/. Pysa uses Python and passes the datastore path.
- Read message for the executable path and the datastore argument.
- Check the same session for chmod +x, VM process kills, snapshot removal, and find commands for vmdk files.
- On the host, identify the file that was executed and whether it is still under /tmp or on a datastore.
Approved maintenance can run a known script from /tmp against a datastore. An unknown filename, especially after a chmod in the same session, is the ransomware launch pattern.
- If the program was not approved, isolate the host. Leave powered-on VMs running so their disks stay locked.
- Remove the file under /tmp and preserve shell.log.
- Restore any datastore that was modified from an off-host backup.
data_stream.dataset:vsphere.log and event.module:vsphere and message:("/vmfs/volumes" and ("/tmp/" or python))
Framework: MITRE ATT&CK
Tactic:
- Name: Execution
- Id: TA0002
- Reference URL: https://attack.mitre.org/tactics/TA0002/
Technique:
- Name: Command and Scripting Interpreter
- Id: T1059
- Reference URL: https://attack.mitre.org/techniques/T1059/
Sub Technique:
- Name: Unix Shell
- Id: T1059.004
- Reference URL: https://attack.mitre.org/techniques/T1059/004/
Framework: MITRE ATT&CK
Tactic:
- Name: Impact
- Id: TA0040
- Reference URL: https://attack.mitre.org/tactics/TA0040/
Technique:
- Name: Data Encrypted for Impact
- Id: T1486
- Reference URL: https://attack.mitre.org/techniques/T1486/