repositories

daemon-sec-cheatsheet

The cheatsheet vault for operators: AD, enumeration, exploitation, priv-esc, web, DFIR

clonegit clone https://git.daemon-sec.xyz/daemon-sec-cheatsheet.git
vmware-esx-vcenter.mdMarkdown107 lines6.5 KiBsource raw download

title: "VMware ESX / vCenter Pentesting" section: "Network Services" sectionSlug: "network-services-pentesting" sourcePath: "src/network-services-pentesting/pentesting-web/vmware-esx-vcenter....md" sourceUrl: "https://github.com/HackTricks-wiki/hacktricks/blob/188de82beb54e70956b2952367a0af91d26758b8/src/network-services-pentesting/pentesting-web/vmware-esx-vcenter....md" sha: "188de82beb54e70956b2952367a0af91d26758b8" isIndex: false modified: true license: "CC-BY-NC-4.0"#

VMware ESX / vCenter Pentesting#

Enumeration#

nmap -sV --script "http-vmware-path-vuln or vmware-version" -p <PORT> <IP>
msf> use auxiliary/scanner/vmware/esx_fingerprint
msf> use auxiliary/scanner/http/ms15_034_http_sys_memory_dump

Bruteforce#

msf> auxiliary/scanner/vmware/vmware_http_login

If you find valid credentials, you can use more metasploit scanner modules to obtain information.

ESXi Post-Exploitation & Ransomware Operations#

Attack Workflow inside Virtual Estates#

Hypervisor Takeover Primitives#

Once command execution on an ESXi console/SSH session is obtained, attackers typically run the following management commands to fingerprint and isolate the host before ransomware deployment:

uname -a                                   # hostname / build metadata for tracking
esxcli --formatter=csv network nic list    # adapter + MAC inventory
esxcli --formatter=csv network ip interface ipv4 get
esxcli network firewall set --enabled false
/etc/init.d/vpxa stop                      # cut vCenter off from the host
passwd root                                # rotate credentials under attacker control

The same agent usually keeps a persistent loop that polls a hard-coded C2 URI. Any unreachable status triggers retries, meaning the beacon stays live until operators push instructions.[1]

MrAgent-Style Instruction Channel#

Lightweight management agents expose a concise instruction set parsed from the C2 queue. That set is enough to operate dozens of compromised hypervisors without interactive shells:

Instruction Effect
Config Overwrite the local JSON config that defines target directories, execution delays or throttling, enabling hot re-tasking without redeploying binaries.
Info Return hypervisor build info, IPs and adapter metadata gathered with the uname/esxcli probes.
Exec Kick off the ransomware phase: change root credentials, stop vpxa, optionally schedule a reboot delay and then pull+execute the encryptor.
Run Implement a remote shell by writing arbitrary C2-provided commands to ./shmv, chmod +x and execute it.
Remove Issue rm -rf <path> for tool clean-up or destructive wiping.
Abort / Abort_f Stop queued encryptions or kill running worker threads if the operator wants to pause post-reboot actions.
Quit Terminate the agent and rm -f its binary for fast self-removal.
Welcome Abuse esxcli system welcomemesg set -m="text" to display ransom notices right in the console banner.

Internally these agents keep two mutex-protected JSON blobs (runtime config + status/telemetry) so that concurrent threads (e.g. beaconing + encryption workers) do not corrupt shared state. Samples are commonly padded with junk code to slow shallow static analysis but the core routines remain intact.[1]

Virtualization & Backup-Aware Targeting#

Mario-like encryptors only traverse operator-supplied directory roots and touch virtualization artefacts that matter for business continuity:

Extension Target
vmdk, vmem, vmsd, vmsn, vswp VM disks, memory snapshots and swap backing files.
ova, ovf Portable VM appliance bundles/metadata.
vib ESXi installation bundles that can block remediation/patching.
vbk, vbm Veeam VM backups + metadata to sabotage on-box restores.

Operational quirks:

Layered Encryption Upgrades#

Recent Mario builds replace the original linear, single-key routine with a sparse, multi-key design optimised for multi-hundred-gigabyte VMDKs:

See also#

Linux LPE via VMware Tools service discovery (CWE-426 / CVE-2025-41244):

Vmware Tools Service Discovery Untrusted Search Path Cve 2025 41244

References#