VMware ESX / vCenter Pentesting
Tip
AWS हैकिंग सीखें और अभ्यास करें:
HackTricks Training AWS Red Team Expert (ARTE)
GCP हैकिंग सीखें और अभ्यास करें:HackTricks Training GCP Red Team Expert (GRTE)
Azure हैकिंग सीखें और अभ्यास करें:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks का समर्थन करें
- सदस्यता योजनाओं की जांच करें!
- हमारे 💬 Discord समूह या टेलीग्राम समूह में शामिल हों या हमें Twitter 🐦 @hacktricks_live** पर फॉलो करें।**
- हैकिंग ट्रिक्स साझा करें और HackTricks और HackTricks Cloud गिटहब रिपोजिटरी में PRs सबमिट करें।
सूचीकरण
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
यदि आप वैध credentials पाते हैं, तो आप अधिक metasploit scanner modules का उपयोग करके जानकारी प्राप्त कर सकते हैं।
ESXi Post-Exploitation & Ransomware Operations
Attack Workflow inside Virtual Estates
- Develop: एक lightweight management agent (e.g., MrAgent), encryptor (e.g., Mario), और leak infrastructure बनाए रखें।
- Infiltrate: vSphere management को compromise करें, hosts को enumerate करें, data चोरी करें, और payloads stage करें।
- Deploy: प्रत्येक ESXi host पर agents push करें, उन्हें C2 को poll करने दें, और निर्देश मिलने पर encryptor pull करें।
- Extort: leak proof-of-compromise data और जब encryption confirmed हो तो ransom chats चलाएँ।
Hypervisor Takeover Primitives
एक बार ESXi console/SSH session पर command execution प्राप्त हो जाने पर, attackers आमतौर पर निम्नलिखित management commands चलाते हैं ताकि host को fingerprint और isolate किया जा सके 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.
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 | स्थानीय JSON config को ओवरराइट करें जो target directories, execution delays या throttling को परिभाषित करता है, जिससे binaries को फिर से डिप्लॉय किए बिना hot re-tasking संभव हो। |
Info | uname/esxcli probes से एकत्र किए गए hypervisor build info, IPs और adapter metadata को रिटर्न करें। |
Exec | ransomware चरण शुरू करें: root credentials बदलें, vpxa को रोकें, वैकल्पिक रूप से reboot delay शेड्यूल करें और फिर encryptor को pull+execute करें। |
Run | C2-प्रदान किए गए arbitrary commands को ./shmv में लिखकर, chmod +x करके और execute करके remote shell लागू करें। |
Remove | tool clean-up या destructive wiping के लिए rm -rf <path> जारी करें। |
Abort / Abort_f | queued encryptions को रोकें या ऑपरेटर के पोस्ट-रिबूट actions को pause करने पर running worker threads को KILL करें। |
Quit | एजेंट को terminate करें और तेज़ self-removal के लिए इसका binary rm -f करें। |
Welcome | ransom notices को console banner में दिखाने के लिए esxcli system welcomemesg set -m="text" का दुरुपयोग करें। |
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.
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 और swap backing files। |
ova, ovf | Portable VM appliance bundles/metadata। |
vib | ESXi installation bundles जो remediation/patching को ब्लॉक कर सकते हैं। |
vbk, vbm | Veeam VM backups + metadata जिन्हें on-box restores को saboatge करने के लिए लक्षित किया जाता है। |
Operational quirks:
- हर विजिट किए गए directory को encryption से पहले
How To Restore Your Files.txtदिया जाता है ताकि disconnected hosts पर भी ransom चैनल्स विज्ञापित रहें। - पहले से प्रोसेस किए गए files को तब स्किप किया जाता है जब उनके नाम में
.emario,.marion,.lmario,.nmario,.mmarioया.wmarioशामिल हो, जिससे double encryption रोका जाता है जो attackers के decryptor को तोड़ सकता है। - Encrypted payloads को
*.mario-style suffix (आम तौर पर.emario) से पुनर्नामित किया जाता है ताकि operators remote consoles या datastore listings में coverage को verify कर सकें।
Layered Encryption Upgrades
Recent Mario builds original linear, single-key routine को replace कर देते हैं एक sparse, multi-key design से जो multi-hundred-gigabyte VMDKs के लिए optimized है:
- Key schedule: 32-byte primary key उत्पन्न करें (stored around
var_1150) और एक independent 8-byte secondary key (var_20). डेटा पहले primary context के साथ transform होता है और फिर disk writes से पहले secondary key के साथ re-mixed किया जाता है। - Per-file headers: Metadata buffers (e.g.
var_40) chunk maps और flags को ट्रैक करते हैं ताकि attackers का private decryptor sparse layout को reconstruct कर सके। - Dynamic chunking: constant
0xA00000loop के बजाय, chunk size और offsets file size के आधार पर पुनर्गणना किए जाते हैं, thresholds आधुनिक VM images से मैच करने के लिए ~8 GB तक बढ़ाए गए हैं। - Sparse coverage: केवल रणनीतिक रूप से चुने गए regions को टैच किया जाता है, जिससे runtime में भारी कमी आती है जबकि VMFS metadata, guest के अंदर NTFS/EXT4 structures या backup indexes अभी भी भ्रष्ट हो जाते हैं।
- Instrumentation: Upgraded builds per-chunk byte counts और totals (encrypted/skipped/failed) को stdout पर लॉग करते हैं, जिससे affiliates को live intrusions के दौरान अतिरिक्त tooling के बिना telemetry मिलती है।
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
Tip
AWS हैकिंग सीखें और अभ्यास करें:
HackTricks Training AWS Red Team Expert (ARTE)
GCP हैकिंग सीखें और अभ्यास करें:HackTricks Training GCP Red Team Expert (GRTE)
Azure हैकिंग सीखें और अभ्यास करें:
HackTricks Training Azure Red Team Expert (AzRTE)
HackTricks का समर्थन करें
- सदस्यता योजनाओं की जांच करें!
- हमारे 💬 Discord समूह या टेलीग्राम समूह में शामिल हों या हमें Twitter 🐦 @hacktricks_live** पर फॉलो करें।**
- हैकिंग ट्रिक्स साझा करें और HackTricks और HackTricks Cloud गिटहब रिपोजिटरी में PRs सबमिट करें।
HackTricks

