Crates.io | inside-vm_arch_support |
lib.rs | inside-vm_arch_support |
version | 0.3.2 |
source | src |
created_at | 2023-02-05 15:07:56.471715 |
updated_at | 2023-06-11 11:15:23.777704 |
description | detect virtual machine using timing |
homepage | |
repository | https://github.com/Talhahpatelia/inside-vm_arch_support |
max_upload_size | |
id | 777200 |
size | 19,119 |
Detect if code is running inside a virtual machine.
works on x86 and x86-64. aarch64 support coming later
Measure average cpu cycles when calling cpuid
and compare to a threshold, if the value is high assume code is running inside a VM.
git clone https://github.com/Talhahpatelia/inside-vm_arch_support
cd inside-vm_arch_support/
cargo run --example test-inside-vm
output: avg cycles for __cpuid: 108
vs inside VM
[vagrant@archlinux vagrant]$ ./target/release/examples/test-inside-vm
output: avg cycles for __cpuid: 30578
use inside_vm_arch_support::inside_vm;
let inside = inside_vm();
println!("inside vm: {}", inside);
https://evasions.checkpoint.com/techniques/timing.html#difference-vm-hosts
Please see the CHANGELOG for a release history.
Dual-licensed under MIT or the Apache License V2.0.