Crates.io | inside-vm |
lib.rs | inside-vm |
version | 0.2.0 |
source | src |
created_at | 2021-07-09 11:48:49.334475 |
updated_at | 2021-07-11 13:52:46.380526 |
description | detect virtual machine using timing |
homepage | |
repository | https://github.com/PicoJr/inside-vm |
max_upload_size | |
id | 420709 |
size | 18,547 |
Detect if code is running inside a virtual machine.
Only works on x86 and x86-64.
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/PicoJr/inside-vm
cd inside-vm/
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::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.