{"id":14235574,"url":"https://github.com/PicoJr/inside-vm","last_synced_at":"2025-08-11T00:31:56.701Z","repository":{"id":62440988,"uuid":"384418998","full_name":"PicoJr/inside-vm","owner":"PicoJr","description":"Detect if code is running inside a virtual machine (x86 and x86-64 only).","archived":false,"fork":false,"pushed_at":"2021-07-11T13:44:31.000Z","size":11,"stargazers_count":44,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-29T18:50:47.061Z","etag":null,"topics":["anti-vm","detect","inside","rust","test","vm"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PicoJr.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-07-09T11:40:58.000Z","updated_at":"2024-09-19T14:29:45.000Z","dependencies_parsed_at":"2022-11-01T22:15:21.812Z","dependency_job_id":null,"html_url":"https://github.com/PicoJr/inside-vm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PicoJr%2Finside-vm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PicoJr%2Finside-vm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PicoJr%2Finside-vm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PicoJr%2Finside-vm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PicoJr","download_url":"https://codeload.github.com/PicoJr/inside-vm/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":229478677,"owners_count":18079372,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["anti-vm","detect","inside","rust","test","vm"],"created_at":"2024-08-20T21:02:06.763Z","updated_at":"2024-12-13T01:30:24.114Z","avatar_url":"https://github.com/PicoJr.png","language":"Rust","readme":"[![rtw crate](https://img.shields.io/crates/v/inside-vm.svg)](https://crates.io/crates/inside-vm)\n[![rtw documentation](https://docs.rs/inside-vm/badge.svg)](https://docs.rs/inside-vm)\n\n# inside-vm\n\nDetect if code is running inside a virtual machine.\n\n\u003e Only works on x86 and x86-64.\n\n## How does it work\n\nMeasure average cpu cycles when calling [`cpuid`](https://en.wikipedia.org/wiki/CPUID) and compare to a threshold, if the value is high assume code is running inside a VM.\n\n## Quick Start\n\n```\ngit clone https://github.com/PicoJr/inside-vm\ncd inside-vm/\ncargo run --example test-inside-vm\n```\n\noutput: `avg cycles for __cpuid: 108`\n\nvs inside VM\n\n```\n[vagrant@archlinux vagrant]$ ./target/release/examples/test-inside-vm \n```\n\noutput: `avg cycles for __cpuid: 30578`\n\n## API\n\n``` rust\nuse inside_vm::inside_vm;\n\nlet inside = inside_vm();\nprintln!(\"inside vm: {}\", inside);\n```\n\n## Credits\n\nhttps://evasions.checkpoint.com/techniques/timing.html#difference-vm-hosts\n\n## Changelog\n\nPlease see the [CHANGELOG](CHANGELOG.md) for a release history.\n\n## License\n\nDual-licensed under MIT or the Apache License V2.0.\n","funding_links":[],"categories":["Rust",":wrench: Tools"],"sub_categories":["Media"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPicoJr%2Finside-vm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FPicoJr%2Finside-vm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FPicoJr%2Finside-vm/lists"}