Skip to content

Commit 2b61a55

Browse files
committed
Merge branch 'dev' of https://github.com/kernelwernel/VMAware into dev
2 parents 52b4a2a + 878606c commit 2b61a55

7 files changed

Lines changed: 1378 additions & 1836 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ You can view the full docs [here](docs/documentation.md). All the details such a
239239

240240
> 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.
241241
>
242-
> 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 118 (as of 2.0 version), and the lesser the number of techniques, the less accurate the overall result might be.
242+
> 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.
243243
244244
</details>
245245

auxiliary/benchmark.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
class VMAwareBenchmark {
3737
public:
38-
static uint64_t get_timestamp() {
38+
static inline uint64_t get_timestamp() {
3939
#if defined(_WIN32)
4040
LARGE_INTEGER counter;
4141
QueryPerformanceCounter(&counter);
@@ -51,7 +51,7 @@ class VMAwareBenchmark {
5151
#endif
5252
}
5353

54-
static double get_elapsed(uint64_t start, uint64_t end) {
54+
static inline double get_elapsed(uint64_t start, uint64_t end) {
5555
#if defined(_WIN32)
5656
static LARGE_INTEGER freq;
5757
QueryPerformanceFrequency(&freq);

docs/documentation.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -517,13 +517,11 @@ VMAware provides a convenient way to not only check for VMs, but also have the f
517517
| `VM::HDD_SERIAL` | Check for serial numbers of virtual disks | Windows | 100% | | | | |
518518
| `VM::PORT_CONNECTORS` | Check for physical connection ports | Windows | 25% | | | | This technique is known to false flag on devices like Surface Pro |
519519
| `VM::GPU_CAPABILITIES` | Check for GPU capabilities related to VMs | Windows | 100% | Admin | | | Admin only needed for some heuristics |
520-
| `VM::GPU_VM_STRINGS` | Check for specific GPU string signatures related to VMs | Windows | 100% | | | | |
521-
| `VM::VM_DEVICES` | Check for VM-specific devices | Windows | 45% | | | | |
522-
| `VM::IDT_GDT_SCAN` | Check if the IDT and GDT virtual base addresses are equal across different CPU cores when not running under Hyper-V | Windows | 50% | | | | |
520+
| `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 |
521+
| `VM::VM_DEVICES` | Check for VM-specific devices | Windows | 50% | | | | |
523522
| `VM::PROCESSOR_NUMBER` | Check for number of processors | Windows | 50% | | | | |
524523
| `VM::NUMBER_OF_CORES` | Check for number of cores | Windows | 50% | | | | |
525524
| `VM::ACPI_TEMPERATURE` | Check for device's temperature | Windows | 25% | | | | |
526-
| `VM::PROCESSOR_ID` | Check if any processor has an empty Processor ID using SMBIOS data | Windows | 25% | | | | |
527525
| `VM::SYS_QEMU` | Check for existence of "qemu_fw_cfg" directories within /sys/module and /sys/firmware | Linux | 70% | | | | |
528526
| `VM::LSHW_QEMU` | Check for QEMU string instances with lshw command | Linux | 80% | | | | |
529527
| `VM::VIRTUAL_PROCESSORS` | Check if the number of virtual and logical processors are reported correctly by the system | Windows | 50% | | | | |
@@ -533,9 +531,9 @@ VMAware provides a convenient way to not only check for VMs, but also have the f
533531
| `VM::AMD_THREAD_MISMATCH` | Check for AMD CPU thread count database if it matches the system's thread count | | 95% | | | | |
534532
| `VM::NATIVE_VHD` | Check for OS being booted from a VHD container | Windows | 100% | | | | |
535533
| `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 |
536-
| `VM::FIRMWARE` | Check for VM signatures and patched strings by hardeners in firmware, while ensuring the BIOS serial is valid | Windows and Linux | 75% | | | | |
534+
| `VM::FIRMWARE` | Check for VM signatures and patched strings by hardeners in firmware, while ensuring the BIOS serial is valid | Windows and Linux | 100% | | | | |
537535
| `VM::FILE_ACCESS_HISTORY` | Check if the number of accessed files are too low for a human-managed environment | Linux | 15% | | | | |
538-
| `VM::AUDIO` | Check if audio device is present | Windows | 25% | | | | |
536+
| `VM::AUDIO` | Check if any waveform-audio output devices are present in the system | Windows | 25% | | | | |
539537
| `VM::UNKNOWN_MANUFACTURER` | Check if the CPU manufacturer is not known | | 50% | | | | |
540538
| `VM::OSXSAVE` | Check if running xgetbv in the XCR0 extended feature register triggers an exception | Windows | 50% | | | | |
541539
| `VM::NSJAIL_PID` | Check if process status matches with nsjail patterns with PID anomalies | Linux | 75% | | | | |

src/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
|------|---------|
33
| `cli.cpp` | Entire CLI tool code |
44
| `vmaware.hpp` | Official and original library header in GPL-3.0, most likely what you're looking for. |
5-
| `vmaware_MIT.hpp` | Same as above but in MIT. But this removes 7 techniques out of 118 |
5+
| `vmaware_MIT.hpp` | Same as above but in MIT. But this removes 7 techniques out of 116 |
66

77
<br>
88

src/cli.cpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -455,11 +455,9 @@ bool is_unsupported(VM::enum_flags flag) {
455455
case VM::PORT_CONNECTORS:
456456
case VM::GPU_VM_STRINGS:
457457
case VM::GPU_CAPABILITIES:
458-
case VM::IDT_GDT_SCAN:
459458
case VM::PROCESSOR_NUMBER:
460459
case VM::NUMBER_OF_CORES:
461460
case VM::ACPI_TEMPERATURE:
462-
case VM::PROCESSOR_ID:
463461
case VM::POWER_CAPABILITIES:
464462
case VM::SETUPAPI_DISK:
465463
case VM::VIRTUAL_PROCESSORS:
@@ -754,19 +752,6 @@ std::string vm_description(const std::string& vm_brand) {
754752
#endif
755753
}
756754

757-
758-
void edit_previous_line() {
759-
#if (CLI_WINDOWS)
760-
std::cout << "\x1b[2K";
761-
std::cout << "\x1b[1A" << "\x1b[2K";
762-
std::cout << "\r";
763-
#else
764-
std::cout << "\r\033[K";
765-
#endif
766-
}
767-
768-
769-
770755
void checker(const VM::enum_flags flag, const char* message) {
771756
if (is_unsupported(flag)) {
772757
if (arg_bitset.test(COMPACT)) {
@@ -976,11 +961,9 @@ void general() {
976961
checker(VM::PORT_CONNECTORS, "physical connection ports");
977962
checker(VM::GPU_CAPABILITIES, "GPU capabilities");
978963
checker(VM::GPU_VM_STRINGS, "GPU strings");
979-
checker(VM::IDT_GDT_SCAN, "IDT GDT consistency");
980964
checker(VM::PROCESSOR_NUMBER, "processor count");
981965
checker(VM::NUMBER_OF_CORES, "CPU core count");
982966
checker(VM::ACPI_TEMPERATURE, "thermal devices");
983-
checker(VM::PROCESSOR_ID, "processor ID");
984967
checker(VM::POWER_CAPABILITIES, "Power capabilities");
985968
checker(VM::SETUPAPI_DISK, "SETUPDI diskdrive");
986969
checker(VM::SYS_QEMU, "QEMU in /sys");

0 commit comments

Comments
 (0)