#protocols #hypervisor #vm #guest #backdoor #v-mware #host-guest

vmw_backdoor

A pure-Rust library for VMware host-guest protocol ("VMXh backdoor")

8 releases

0.2.4 Jun 2, 2023
0.2.3 Nov 29, 2022
0.2.1 Apr 19, 2021
0.2.0 Oct 8, 2020
0.1.1 Mar 26, 2020

#432 in Network programming

Download history 264/week @ 2024-07-25 280/week @ 2024-08-01 247/week @ 2024-08-08 235/week @ 2024-08-15 149/week @ 2024-08-22 68/week @ 2024-08-29 77/week @ 2024-09-05 64/week @ 2024-09-12 75/week @ 2024-09-19 114/week @ 2024-09-26 69/week @ 2024-10-03 80/week @ 2024-10-10 66/week @ 2024-10-17 44/week @ 2024-10-24 98/week @ 2024-10-31 32/week @ 2024-11-07

263 downloads per month
Used in afterburn

MIT/Apache

27KB
599 lines

vmw_backdoor

crates.io Documentation

A pure-Rust library for VMware host-guest protocol ("VMXh backdoor").

This library provides helpers to access and use the VMware backdoor from a guest VM. It allows bi-directional interactions with the VMWare hypervisor and host environment.

The "backdoor" protocol does not have official specifications, but it has been widely analyzed and there are multiple projects documenting it:

  1. https://github.com/vmware/open-vm-tools/blob/stable-11.0.5/open-vm-tools/lib/include/backdoor_def.h
  2. https://wiki.osdev.org/VMware_tools
  3. https://sysprogs.com/legacy/articles/kdvmware/guestrpc.shtml
  4. https://github.com/vmware/vmw-guestinfo/tree/master/bdoor
  5. https://sites.google.com/site/chitchatvmback/backdoor

Example

let is_vmw = vmw_backdoor::is_vmware_cpu();
println!("VMware CPU detected: {}.", is_vmw);

let mut guard = vmw_backdoor::access_backdoor().unwrap();
println!("Raised I/O access to reach backdoor port.");

let found = guard.probe_vmware_backdoor().unwrap_or(false);
println!("VMware backdoor detected: {}.", found);

let mut erpc = guard.open_enhanced_chan().unwrap();
let key = "guestinfo.ignition.config.data";
let guestinfo = erpc.get_guestinfo(key.as_bytes()).unwrap();

if let Some(val) = guestinfo {
    println!("Got value for key '{}':", key);
    println!("{}", String::from_utf8_lossy(&val));
};

Some more examples are available under examples.

License

Licensed under either of

at your option.

Dependencies

~0.3–7.5MB
~61K SLoC