Skip to content

Commit

Permalink
fixed merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
kernelwernel committed Jan 21, 2025
2 parents ec20aec + d6b8881 commit da80326
Show file tree
Hide file tree
Showing 4 changed files with 412 additions and 541 deletions.
7 changes: 4 additions & 3 deletions docs/documentation.md
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,6 @@ VMAware provides a convenient way to not only check for VMs, but also have the f
| `VM::RDTSC_VMEXIT` | check through alternative RDTSC technique with VMEXIT | | 25% | | | | Disabled by default |
| `VM::QEMU_BRAND` | Match for QEMU CPU brands with "QEMU Virtual CPU" string | | 100% | | | | |
| `VM::BOCHS_CPU` | Check for various Bochs-related emulation oversights through CPU checks | | 95% | | | | |
| `VM::VPC_BOARD` | Check through the motherboard and match for VirtualPC-specific string | Windows | 20% | | | | |
| `VM::HYPERV_WMI` | Check WMI query for "Hyper-V RAW" string | Windows | 80% | | | | |
| `VM::HYPERV_REG` | Check presence for Hyper-V specific string in registry | Windows | 80% | | | | |
| `VM::BIOS_SERIAL` | Check if the BIOS serial is valid (null = VM) | Windows | 60% | | | | |
Expand All @@ -388,7 +387,6 @@ VMAware provides a convenient way to not only check for VMs, but also have the f
| `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::HYPERV_BOARD` | Check for Hyper-V specific string in motherboard | Windows | 45% | | | | |
| `VM::VPC_SIDT` | Check for sidt method with VPC's 0xE8XXXXXX range | 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% | | | | |
Expand Down Expand Up @@ -456,7 +454,10 @@ VMAware provides a convenient way to not only check for VMs, but also have the f
| `VM::WMI_QUERIES` | Executes generic WMI queries that always return more than 0 entries in physical machines and checks if any query returns zero entries | Windows | 50% | | GPL | | |
| `VM::SYS_QEMU` | Check for existence of "qemu_fw_cfg" directories within /sys/module and /sys/firmware | Linux | 70% | | | | |
| `VM::LSHW_QEMU` | Check for QEMU string instances with lshw command | Linux | 80% | | | | |
| `VM::VIRTUAL_PROCESSORS` | Checks if the number of maximum virtual processors matches the maximum number of logical processors | Windows | 35% | | | | |
| `VM::VIRTUAL_PROCESSORS` | Checks if the number of maximum virtual processors matches the maximum number of logical processors | Windows | 50% | | | | |
| `VM::MOTHERBOARD_PRODUCT` | Check if the motherboard product string matches "Virtual Machine" | Windows | 50% | | | | |
| `VM::HVLQUERYDETAILINFO` | Checks if a call to NtQuerySystemInformation with the 0x9f leaf fills a _SYSTEM_HYPERVISOR_DETAIL_INFORMATION structure | Windows | 50% | | | | |

<!-- ADD DETAILS HERE -->

<br>
Expand Down
19 changes: 10 additions & 9 deletions src/cli.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,6 @@ bool is_unsupported(VM::enum_flags flag) {
case VM::PARALLELS_VM:
case VM::QEMU_BRAND:
case VM::BOCHS_CPU:
case VM::VPC_BOARD:
case VM::HYPERV_WMI:
case VM::HYPERV_REG:
case VM::BIOS_SERIAL:
Expand All @@ -422,7 +421,6 @@ bool is_unsupported(VM::enum_flags flag) {
case VM::OFFSEC_SIDT:
case VM::OFFSEC_SGDT:
case VM::OFFSEC_SLDT:
case VM::HYPERV_BOARD:
case VM::VPC_SIDT:
case VM::VMWARE_STR:
case VM::VMWARE_BACKDOOR:
Expand Down Expand Up @@ -467,6 +465,11 @@ bool is_unsupported(VM::enum_flags flag) {
case VM::SETUPAPI_DISK:
case VM::VMWARE_HARDENER:
case VM::VIRTUAL_PROCESSORS:
<<<<<<< HEAD
=======
case VM::MOTHERBOARD_PRODUCT:
case VM::HVLQUERYDETAILINFO:
>>>>>>> d6b88811dd5e1f0b73c8a3fd08718ccab5294f75
// ADD WINDOWS FLAG
return false;
default: return true;
Expand All @@ -485,7 +488,6 @@ bool is_unsupported(VM::enum_flags flag) {
case VM::VMID_0X4:
case VM::QEMU_BRAND:
case VM::BOCHS_CPU:
case VM::VPC_BOARD:
case VM::MAC_MEMSIZE:
case VM::MAC_IOKIT:
case VM::IOREG_GREP:
Expand Down Expand Up @@ -559,13 +561,13 @@ void replace(std::string &text, const std::string &original, const std::string &
}
}

bool is_vm_brand_multiple(const std::string_view vm_brand) {
bool is_vm_brand_multiple(const std::string& vm_brand) {
return (vm_brand.find(" or ") != std::string::npos);
}



std::string vm_description(const std::string_view vm_brand) {
std::string vm_description(const std::string& vm_brand) {

// if there's multiple brands, return null
if (is_vm_brand_multiple(vm_brand)) {
Expand Down Expand Up @@ -635,8 +637,7 @@ std::string vm_description(const std::string_view vm_brand) {
{ VM::brands::NULL_BRAND, "" }
};

auto it = description_table.find(vm_brand.data());

std::map<std::string, const char*>::const_iterator it = description_table.find(vm_brand);
if (it != description_table.end()) {
return it->second;
}
Expand Down Expand Up @@ -886,7 +887,6 @@ void general() {
checker(VM::LOADED_DLLS, "loaded DLLs");
checker(VM::QEMU_BRAND, "QEMU CPU brand");
checker(VM::BOCHS_CPU, "BOCHS CPU techniques");
checker(VM::VPC_BOARD, "VirtualPC motherboard");
checker(VM::BIOS_SERIAL, "BIOS serial number");
checker(VM::MSSMBIOS, "MSSMBIOS");
checker(VM::MAC_MEMSIZE, "MacOS hw.memsize");
Expand All @@ -906,7 +906,6 @@ void general() {
checker(VM::OFFSEC_SGDT, "Offensive Security SGDT");
checker(VM::OFFSEC_SLDT, "Offensive Security SLDT");
checker(VM::VPC_SIDT, "VirtualPC SIDT");
checker(VM::HYPERV_BOARD, "Hyper-V motherboard");
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 @@ -972,6 +971,8 @@ void general() {
checker(VM::SYS_QEMU, "QEMU in /sys");
checker(VM::LSHW_QEMU, "QEMU in lshw output");
checker(VM::VIRTUAL_PROCESSORS, "virtual processors");
checker(VM::MOTHERBOARD_PRODUCT, "motherboard product");
checker(VM::HVLQUERYDETAILINFO, "HvlQueryDetailInfo");
// ADD NEW TECHNIQUE CHECKER HERE

std::printf("\n");
Expand Down
Loading

0 comments on commit da80326

Please sign in to comment.