Function vmw_backdoor::access_backdoor_privileged
source · pub fn access_backdoor_privileged() -> Result<BackdoorGuard, VmwError>
Expand description
Try to acquire access to the backdoor, but do NOT probe its presence.
On Linux, this tries to change I/O access level via iopl()
. That requires
running with CAP_SYS_RAWIO
capability and it is not compatible with
kernel_lockdown
.
Examples found in repository?
examples/check-backdoor.rs (line 8)
4 5 6 7 8 9 10 11 12 13 14 15 16
fn main() {
let is_vmw = vmw::is_vmware_cpu();
println!("VMware CPU detected: {}.", is_vmw);
let mut backdoor = vmw::access_backdoor_privileged().unwrap();
println!("Raised I/O access to reach backdoor port.");
let found = match backdoor.probe_vmware_backdoor() {
Ok(()) => true,
Err(_) => false,
};
println!("VMware backdoor detected: {}.", found);
}