|
60 | 60 | * - struct for internal core components => line 11205 |
61 | 61 | * - start of VM detection technique list => line 4251 |
62 | 62 | * - start of public VM detection functions => line 11551 |
63 | | - * - start of externally defined variables => line 12534 |
| 63 | + * - start of externally defined variables => line 12544 |
64 | 64 | * |
65 | 65 | * |
66 | 66 | * ============================== EXAMPLE =================================== |
@@ -576,7 +576,7 @@ struct VM { |
576 | 576 | UD, |
577 | 577 | BLOCKSTEP, |
578 | 578 | DBVM, |
579 | | - OBJECTS, |
| 579 | + KERNEL_OBJECTS, |
580 | 580 | NVRAM, |
581 | 581 | SMBIOS_INTEGRITY, |
582 | 582 | EDID, |
@@ -9737,9 +9737,9 @@ struct VM { |
9737 | 9737 | /** |
9738 | 9738 | * @brief Check for any signs of VMs in Windows kernel object entities |
9739 | 9739 | * @category Windows |
9740 | | - * @implements VM::OBJECTS |
| 9740 | + * @implements VM::KERNEL_OBJECTS |
9741 | 9741 | */ |
9742 | | - [[nodiscard]] static bool objects() { |
| 9742 | + [[nodiscard]] static bool kernel_objects() { |
9743 | 9743 | struct OBJECT_DIRECTORY_INFORMATION { |
9744 | 9744 | UNICODE_STRING Name; |
9745 | 9745 | UNICODE_STRING TypeName; |
@@ -9904,12 +9904,12 @@ struct VM { |
9904 | 9904 | // "VmGenerationCounter" and "VmGid" are created by the Hyper-V VM Bus provider |
9905 | 9905 | if (objectName == L"VmGenerationCounter") { |
9906 | 9906 | pNtClose(hDir); |
9907 | | - debug("OBJECTS: Detected VmGenerationCounter"); |
| 9907 | + debug("KERNEL_OBJECTS: Detected VmGenerationCounter"); |
9908 | 9908 | return core::add(brands::HYPERV); |
9909 | 9909 | } |
9910 | 9910 | if (objectName == L"VmGid") { |
9911 | 9911 | pNtClose(hDir); |
9912 | | - debug("OBJECTS: Detected VmGid"); |
| 9912 | + debug("KERNEL_OBJECTS: Detected VmGid"); |
9913 | 9913 | return core::add(brands::HYPERV); |
9914 | 9914 | } |
9915 | 9915 | } |
@@ -11891,13 +11891,21 @@ struct VM { |
11891 | 11891 |
|
11892 | 11892 | u16 threshold = 150; |
11893 | 11893 |
|
11894 | | - // if high threshold is set, the points |
| 11894 | + // if high threshold is set, the bar |
11895 | 11895 | // will be 300. If not, leave it as 150 |
11896 | 11896 | if (core::is_enabled(flags, HIGH_THRESHOLD)) { |
11897 | 11897 | threshold = high_threshold_score; |
11898 | 11898 | } |
11899 | 11899 |
|
11900 | | - return (points >= threshold); |
| 11900 | + if (points >= threshold) { |
| 11901 | + return true; |
| 11902 | + } |
| 11903 | + |
| 11904 | + // this is added as a last ditch attempt to detect a VM, |
| 11905 | + // because if there are indications of hardening then logically |
| 11906 | + // it should in fact be a VM. It's doubtful if this can actually |
| 11907 | + // return true, but it's better than nothing |
| 11908 | + return (is_hardened()); |
11901 | 11909 | } |
11902 | 11910 |
|
11903 | 11911 |
|
@@ -12095,7 +12103,7 @@ struct VM { |
12095 | 12103 | case DBVM: return "DBVM"; |
12096 | 12104 | case BOOT_LOGO: return "BOOT_LOGO"; |
12097 | 12105 | case MAC_SYS: return "MAC_SYS"; |
12098 | | - case OBJECTS: return "OBJECTS"; |
| 12106 | + case KERNEL_OBJECTS: return "KERNEL_OBJECTS"; |
12099 | 12107 | case NVRAM: return "NVRAM"; |
12100 | 12108 | case SMBIOS_INTEGRITY: return "SMBIOS_INTEGRITY"; |
12101 | 12109 | case EDID: return "EDID"; |
@@ -12707,7 +12715,7 @@ std::array<VM::core::technique, VM::enum_size + 1> VM::core::technique_table = [ |
12707 | 12715 | {VM::DRIVERS, {100, VM::drivers}}, |
12708 | 12716 | {VM::DEVICE_HANDLES, {100, VM::device_handles}}, |
12709 | 12717 | {VM::VIRTUAL_PROCESSORS, {100, VM::virtual_processors}}, |
12710 | | - {VM::OBJECTS, {100, VM::objects}}, |
| 12718 | + {VM::KERNEL_OBJECTS, {100, VM::kernel_objects}}, |
12711 | 12719 | {VM::HYPERVISOR_QUERY, {100, VM::hypervisor_query}}, |
12712 | 12720 | {VM::AUDIO, {25, VM::audio}}, |
12713 | 12721 | {VM::DISPLAY, {25, VM::display}}, |
|
0 commit comments