Skip to content

Major changes #344

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Apr 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
The library is:
- Very easy to use
- Cross-platform (Windows + MacOS + Linux)
- Features up to 115+ unique VM detection techniques [[list](https://github.com/kernelwernel/VMAware/blob/main/docs/documentation.md#flag-table)]
- Features up to 100+ unique VM detection techniques [[list](https://github.com/kernelwernel/VMAware/blob/main/docs/documentation.md#flag-table)]
- Features the most cutting-edge techniques
- Able to detect 65+ VM brands including VMware, VirtualBox, QEMU, Hyper-V, and much more [[list](https://github.com/kernelwernel/VMAware/blob/main/docs/documentation.md#brand-table)]
- Able to beat VM hardeners
Expand Down Expand Up @@ -239,7 +239,7 @@ You can view the full docs [here](docs/documentation.md). All the details such a

> I would've made it strictly MIT so proprietary software can make use of the library, but some of the techniques employed are from GPL projects, and I have no choice but to use the same license for legal reasons.
>
> This gave me an idea to make an MIT version without all of the GPL code so it can also be used without forcing your code to be open source. It should be noted that the MIT version removes <b>7</b> techniques out of 116 (as of 2.0 version), and the lesser the number of techniques, the less accurate the overall result might be.
> This gave me an idea to make an MIT version without all of the GPL code so it can also be used without forcing your code to be open source. It should be noted that the MIT version removes <b>7</b> techniques out of 109 (as of 2.0 version), and the lesser the number of techniques, the less accurate the overall result might be.

</details>

Expand Down
21 changes: 7 additions & 14 deletions docs/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,6 @@ VMAware provides a convenient way to not only check for VMs, but also have the f
| `VM::DMIDECODE` | Check if dmidecode output matches a VM brand | Linux | 55% | Admin | | | |
| `VM::DMESG` | Check if dmesg output matches a VM brand | Linux | 55% | Admin | | | |
| `VM::HWMON` | Check if /sys/class/hwmon/ directory is present. If not, likely a VM | Linux | 35% | | | | |
| `VM::SIDT5` | Check if the 5th byte after sidt is null | Linux | 45% | | | | |
| `VM::DLL` | Check for VM-specific DLLs | Windows | 25% | | | | |
| `VM::REGISTRY` | Check for VM-specific registry values | Windows | 50% | | | | |
| `VM::VM_FILES` | Find for VM-specific specific files | Windows | 25% | | | | |
Expand All @@ -465,15 +464,10 @@ VMAware provides a convenient way to not only check for VMs, but also have the f
| `VM::IOREG_GREP` | Check for VM-strings in ioreg commands for MacOS | MacOS | 100% | | | | |
| `VM::MAC_SIP` | Check if System Integrity Protection is disabled (likely a VM if it is) | MacOS | 40% | | | | |
| `VM::HKLM_REGISTRIES` | Check HKLM registries for specific VM strings | Windows | 25% | | | | |
| `VM::QEMU_GA` | Check for "qemu-ga" process | Linux | 10% | | | | |
| `VM::VPC_INVALID` | Check for official VPC method | Windows | 75% | | | 32-bit | |
| `VM::SIDT` | Check for sidt instruction method | Windows | 25% | | | | |
| `VM::SGDT` | Check for sgdt instruction method | Windows | 30% | | | 32-bit | |
| `VM::SLDT` | Check for sldt instruction method | Windows | 15% | | | 32-bit | |
| `VM::OFFSEC_SIDT` | Check for Offensive Security SIDT method | Windows | 60% | | | 32-bit | |
| `VM::OFFSEC_SGDT` | Check for Offensive Security SGDT method | Windows | 60% | | | 32-bit | |
| `VM::OFFSEC_SLDT` | Check for Offensive Security SLDT method | Windows | 20% | | | 32-bit | |
| `VM::VPC_SIDT` | Check for sidt method with VPC's 0xE8XXXXXX range | Windows | 15% | | | 32-bit | |
| `VM::SIDT` | Check for uncommon IDT virtual addresses | Linux and Windows | 25% | | | | |
| `VM::SGDT` | Check for uncommon GDT virtual addresses | Windows | 30% | | | | |
| `VM::SLDT` | Check for uncommon LDT virtual addresses | Windows | 15% | | | 32-bit | |
| `VM::VMWARE_IOMEM` | Check for VMware string in /proc/iomem | Linux | 65% | | | | |
| `VM::VMWARE_IOPORTS` | Check for VMware string in /proc/ioports | Linux | 70% | | | | |
| `VM::VMWARE_SCSI` | Check for VMware string in /proc/scsi/scsi | Linux | 40% | | | | |
Expand All @@ -489,8 +483,8 @@ VMAware provides a convenient way to not only check for VMs, but also have the f
| `VM::NETTITUDE_VM_MEMORY` | Check for memory regions to detect VM-specific brands | Windows | 100% | | | | |
| `VM::CUCKOO_DIR` | Check for cuckoo directory using crt and WIN API directory functions | Windows | 30% | | | | |
| `VM::CUCKOO_PIPE` | Check for Cuckoo specific piping mechanism | Windows | 30% | | | | |
| `VM::HYPERV_HOSTNAME` | Check for default Azure hostname format regex (Azure uses Hyper-V as their base VM brand) | Windows, Linux | 30% | | | | |
| `VM::GENERAL_HOSTNAME` | Check for commonly set hostnames by certain VM brands | Windows, Linux | 10% | | | | |
| `VM::HYPERV_HOSTNAME` | Check for default Azure hostname format regex (Azure uses Hyper-V as their base VM brand) | Linux and Windows | 30% | | | | |
| `VM::GENERAL_HOSTNAME` | Check for commonly set hostnames by certain VM brands | Linux and Windows | 10% | | | | |
| `VM::SCREEN_RESOLUTION` | Check for pre-set screen resolutions commonly found in VMs | Windows | 20% | | | | |
| `VM::DEVICE_STRING` | Check if bogus device string would be accepted | Windows | 25% | | | | |
| `VM::BLUESTACKS_FOLDERS` | Check for the presence of BlueStacks-specific folders | Linux | 5% | | | | |
Expand All @@ -513,8 +507,7 @@ VMAware provides a convenient way to not only check for VMs, but also have the f
| `VM::ANYRUN_DRIVER` | Check for any.run driver presence | Windows | 65% | | | | | Removed from the lib, only available in the CLI |
| `VM::ANYRUN_DIRECTORY` | Check for any.run directory and handle the status code | Windows | 35% | | | | | Removed from the lib, only available in the CLI |
| `VM::DRIVER_NAMES` | Check for VM-specific names for drivers | Windows | 100% | | | | |
| `VM::VM_SIDT` | Check for unknown IDT base address | Windows | 100% | | | | |
| `VM::HDD_SERIAL` | Check for serial numbers of virtual disks | Windows | 100% | | | | |
| `VM::DISK_SERIAL` | Check for serial numbers of virtual disks | Windows | 100% | | | | |
| `VM::PORT_CONNECTORS` | Check for physical connection ports | Windows | 25% | | | | This technique is known to false flag on devices like Surface Pro |
| `VM::GPU_CAPABILITIES` | Check for GPU capabilities related to VMs | Windows | 100% | Admin | | | Admin only needed for some heuristics |
| `VM::GPU_VM_STRINGS` | Check for specific GPU string signatures related to VMs | Windows | 100% | | | | If GPU_CAPABILITIES also flags, the overall score will be 50 instead of 100 |
Expand All @@ -531,7 +524,7 @@ VMAware provides a convenient way to not only check for VMs, but also have the f
| `VM::AMD_THREAD_MISMATCH` | Check for AMD CPU thread count database if it matches the system's thread count | | 95% | | | | |
| `VM::NATIVE_VHD` | Check for OS being booted from a VHD container | Windows | 100% | | | | |
| `VM::VIRTUAL_REGISTRY` | Check for particular object directory which is present in Sandboxie virtual environment but not in usual host systems | Windows | 65% | | | | Admin only needed for Linux |
| `VM::FIRMWARE` | Check for VM signatures and patched strings by hardeners in firmware, while ensuring the BIOS serial is valid | Windows and Linux | 100% | | | | |
| `VM::FIRMWARE` | Check for VM signatures and patched strings by hardeners in firmware, while ensuring the BIOS serial is valid | Linux and Windows | 100% | | | | |
| `VM::FILE_ACCESS_HISTORY` | Check if the number of accessed files are too low for a human-managed environment | Linux | 15% | | | | |
| `VM::AUDIO` | Check if any waveform-audio output devices are present in the system | Windows | 25% | | | | |
| `VM::UNKNOWN_MANUFACTURER` | Check if the CPU manufacturer is not known | | 50% | | | | |
Expand Down
2 changes: 1 addition & 1 deletion src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
|------|---------|
| `cli.cpp` | Entire CLI tool code |
| `vmaware.hpp` | Official and original library header in GPL-3.0, most likely what you're looking for. |
| `vmaware_MIT.hpp` | Same as above but in MIT. But this removes 7 techniques out of 116 |
| `vmaware_MIT.hpp` | Same as above but in MIT. But this removes 7 techniques out of 109 |

<br>

Expand Down
19 changes: 3 additions & 16 deletions src/cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,12 +350,11 @@ bool is_unsupported(VM::enum_flags flag) {
case VM::DMIDECODE:
case VM::DMESG:
case VM::HWMON:
case VM::SIDT5:
case VM::DISK_SIZE:
case VM::VBOX_DEFAULT:
case VM::VM_PROCESSES:
case VM::LINUX_USER_HOST:
case VM::BOCHS_CPU:
case VM::QEMU_GA:
case VM::SIDT:
case VM::VMWARE_IOMEM:
case VM::VMWARE_IOPORTS:
Expand Down Expand Up @@ -427,10 +426,6 @@ bool is_unsupported(VM::enum_flags flag) {
case VM::SIDT:
case VM::SGDT:
case VM::SLDT:
case VM::OFFSEC_SIDT:
case VM::OFFSEC_SGDT:
case VM::OFFSEC_SLDT:
case VM::VPC_SIDT:
case VM::VMWARE_STR:
case VM::VMWARE_BACKDOOR:
case VM::VMWARE_PORT_MEM:
Expand All @@ -450,8 +445,7 @@ bool is_unsupported(VM::enum_flags flag) {
case VM::KVM_BITMASK:
case VM::KGT_SIGNATURE:
case VM::DRIVER_NAMES:
case VM::VM_SIDT:
case VM::HDD_SERIAL:
case VM::DISK_SERIAL:
case VM::PORT_CONNECTORS:
case VM::GPU_VM_STRINGS:
case VM::GPU_CAPABILITIES:
Expand Down Expand Up @@ -874,7 +868,6 @@ void general() {
checker(VM::HYPERVISOR_BIT, "CPUID hypervisor bit");
checker(VM::HYPERVISOR_STR, "hypervisor str");
checker(VM::TIMER, "timing anomalies");
checker(VM::SIDT5, "sidt null byte");
checker(VM::THREADCOUNT, "processor count");
checker(VM::MAC, "MAC address");
checker(VM::TEMPERATURE, "temperature");
Expand Down Expand Up @@ -907,16 +900,11 @@ void general() {
checker(VM::KVM_DIRS, "KVM directories");
checker(VM::HKLM_REGISTRIES, "registry values");
checker(VM::AUDIO, "audio device");
checker(VM::QEMU_GA, "qemu-ga process");
checker(VM::QEMU_DIR, "QEMU directories");
checker(VM::VPC_INVALID, "VPC invalid instructions");
checker(VM::SIDT, "SIDT");
checker(VM::SGDT, "SGDT");
checker(VM::SLDT, "SLDT");
checker(VM::OFFSEC_SIDT, "Offensive Security SIDT");
checker(VM::OFFSEC_SGDT, "Offensive Security SGDT");
checker(VM::OFFSEC_SLDT, "Offensive Security SLDT");
checker(VM::VPC_SIDT, "VirtualPC SIDT");
checker(VM::VMWARE_IOMEM, "/proc/iomem file");
checker(VM::VMWARE_IOPORTS, "/proc/ioports file");
checker(VM::VMWARE_SCSI, "/proc/scsi/scsi file");
Expand Down Expand Up @@ -956,8 +944,7 @@ void general() {
checker(anyrun_driver, "ANY.RUN driver");
checker(anyrun_directory, "ANY.RUN directory");
checker(VM::DRIVER_NAMES, "driver names");
checker(VM::VM_SIDT, "VM SIDT");
checker(VM::HDD_SERIAL, "HDD serial number");
checker(VM::DISK_SERIAL, "disk serial number");
checker(VM::PORT_CONNECTORS, "physical connection ports");
checker(VM::GPU_CAPABILITIES, "GPU capabilities");
checker(VM::GPU_VM_STRINGS, "GPU strings");
Expand Down
Loading