Skip to content
WETNav

Investigation · Infrastructure

What happened on this ESXi host?

Triage a suspected ESXi compromise: which logs to pull first and why, the signals of hands-on-hypervisor activity, and how to collect before a reboot loses RAM-disk logs.

When you would ask thisAn ESXi host is suspected compromised (ransomware staging, VM tampering, or stealthy persistence) and you need to triage it and preserve evidence before anyone reboots it.

Steps

  1. 1

    Pull shell.log first, before anything else

    /var/log/shell.log records commands run in the ESXi Shell and is the highest-value log for hands-on-hypervisor activity, but it rotates aggressively (roughly 8 x 1 MB files), so a busy or deliberately noisy host can roll it within hours. Pull it first so an attacker's commands are not lost to rotation while you collect bulkier logs. Read it for esxcli, vim-cmd and vmkfstools usage, account changes and service toggles. This is the log most likely to contain the smoking gun and the most likely to disappear.

    Copy the shell log off-host first (ESXi shell, collection only)
    # Run from your collection host. /var/log entries are links into /var/run/log,
    # which also holds the rotated copies (shell.0.gz, shell.1.gz ...).
    scp 'root@esxi-host:/var/run/log/shell*' ./esxi-collect/
  2. 2

    Collect the core host logs

    After shell.log, pull the main host logs: /var/log/hostd.log (the host agent: VM power operations, task and user actions, API calls), /var/log/auth.log (authentication to the host, SSH and shell logins, sudo), and /var/log/vobd.log (VMkernel observation events, including security-relevant state changes such as SSH or the shell being enabled). Collect them together so you can correlate a login in auth.log with the actions it drove in hostd.log and the state changes recorded in vobd.log. These are larger and rotate more slowly than shell.log, so they are safe to collect second.

    Collect the core host logs (ESXi shell, collection only)
    for f in hostd auth vobd vmkernel vmkwarning; do
      scp "root@esxi-host:/var/run/log/$f*" ./esxi-collect/
    done
  3. 3

    Account for RAM-disk logging and remote syslog

    On an ESXi host with no persistent scratch location (common on SD-card or USB boot, or stateless installs), /var/log lives on a RAM disk and every local log is lost at reboot or power loss. This makes your off-host copy urgent and makes 'we rebooted it' a potential loss of all local evidence. If the host forwards to a remote syslog server (the Syslog.global.logHost setting), that collector is your durable copy and often has history the host itself has already rotated away. Check for and pull the syslog copy, and never reboot before collecting.

  4. 4

    Hunt the hands-on-hypervisor signals

    Look for the specific signals of interactive attacker activity: SSH or the ESXi Shell being enabled (vobd.log / hostd.log and the service state), execInstalledOnly being disabled (which removes the control that blocks unsigned binaries from executing and is a strong tamper signal), esxcli vm process kill (force-stopping VMs, a ransomware precursor), vim-cmd vmsvc/getallvms (enumerating VMs), changes to the syslog loghost (cutting off remote logging), new local accounts on the host, unexpected VIB installs (esxcli software vib install, especially with a forced acceptance level), and unfamiliar files appearing in datastores. Treat execInstalledOnly disabled plus SSH enabled plus new files in a datastore as a high-confidence compromise cluster.

  5. 5

    Capture a support bundle and datastore listing

    Take a full vm-support bundle, which packages the logs, configuration and state into one archive for offline analysis and preserves data that individual log copies miss. The exact invocation varies by ESXi version (broadly, running vm-support on the host produces a .tgz you then copy off; confirm the syntax and any size flags for your version). Separately, list datastore contents with timestamps to find staged tooling, dropped binaries or encryptor payloads. Collect the bundle after the urgent shell.log copy, because the bundle takes time to build and you do not want shell.log to roll while it runs.

    Generate and copy a support bundle; list datastores (ESXi shell, collection only)
    # Confirm exact syntax for your ESXi version.
    vm-support -w /vmfs/volumes/<datastore>/   # writes a vm-support .tgz bundle
    
    # Then copy the bundle off-host, and write the datastore listing to your
    # collection host rather than to the host's own disk:
    ssh root@esxi-host 'ls -laR /vmfs/volumes/<datastore>/' > datastore-listing.txt
  6. 6

    Pull vCenter events, especially VM clone operations

    If the host is managed by vCenter, vCenter events and tasks are a second, often longer-lived source, because vCenter retention can outlast a RAM-disk host. Public reporting on the BRICKSTORM campaign shows that intrusions into VMware infrastructure can run long enough that on-host log retention is routinely exceeded, so vCenter is where earlier activity survives. Review vCenter VM clone events specifically for off-hours cloning of domain controllers or other sensitive VMs: cloning a DC lets an attacker mount its disk offline and extract credentials without touching the running guest, and the clone event may be the only record left once host logs have rolled.

Where it goes wrong

  • shell.log rotates through only about 8 x 1 MB files, so on a noisy host it can roll within hours; copy it off first or you lose the attacker's command history.
  • With no persistent scratch, /var/log is a RAM disk and all local logs are lost on reboot or power loss, so a reboot can destroy the entire local evidence set; collect before anyone restarts the host.
  • execInstalledOnly being disabled is easy to overlook because nothing 'happens' visibly, but it removes the unsigned-binary execution control and is a high-value tamper indicator; check its state explicitly.
  • An attacker who changed Syslog.global.logHost may have cut off remote logging partway through, so the syslog collector can hold the start of the intrusion but not the end; note the loghost-change time.
  • vCenter retention often outlasts the host's RAM-disk logs, so earlier activity (per BRICKSTORM-style long dwell) may only survive in vCenter; do not conclude 'no early activity' from host logs alone.
  • vm-support bundle syntax and flags differ across ESXi versions, so confirm the exact command for the version in front of you rather than copying one blindly, and watch bundle size on a RAM-disk host.

Beyond event logs

Datastore contents

/vmfs/volumes/<datastore>/ on the host

Staged tooling, dropped ELF binaries, encryptor payloads and renamed/encrypted VMDKs show up here; inventory by modification time against the incident window.

ESXi local account and SSH config

/etc/passwd, /etc/shadow, and the SSH/shell service state and authorized keys on the host

New local accounts and added SSH keys are host persistence that survive guest-level remediation; compare against a known-good baseline.

vCenter events and tasks

vCenter Server: Monitor > Events, and the vpxd logs on the vCenter appliance

Longer-retention record of VM clone, power, snapshot and permission changes across the cluster, often the only surviving evidence once a RAM-disk host has rotated its logs.

References