Skip to content

Commit 9da062c

Browse files
committed
chore: renamed VM::OBJECTS to VM::KERNEL_OBJECTS
1 parent eaf62bd commit 9da062c

File tree

3 files changed

+20
-12
lines changed

3 files changed

+20
-12
lines changed

docs/documentation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ VMAware provides a convenient way to not only check for VMs, but also have the f
591591
| `VM::DBVM` | Check if Dark Byte's VM is present | 🪟 | 150% | | | | [link](https://github.com/kernelwernel/VMAware/tree/main/src/vmaware.hpp#L9518) |
592592
| `VM::BOOT_LOGO` | Check boot logo for known VM images | 🪟 | 100% | | | | [link](https://github.com/kernelwernel/VMAware/tree/main/src/vmaware.hpp#L9637) |
593593
| `VM::MAC_SYS` | Check for VM-strings in system profiler commands for MacOS | 🍏 | 100% | | | | [link](https://github.com/kernelwernel/VMAware/tree/main/src/vmaware.hpp#L7363) |
594-
| `VM::OBJECTS` | Check for any signs of VMs in Windows kernel object entities | 🪟 | 100% | | | | [link](https://github.com/kernelwernel/VMAware/tree/main/src/vmaware.hpp#L9740) |
594+
| `VM::KERNEL_OBJECTS` | Check for any signs of VMs in Windows kernel object entities | 🪟 | 100% | | | | [link](https://github.com/kernelwernel/VMAware/tree/main/src/vmaware.hpp#L9740) |
595595
| `VM::NVRAM` | Check for known NVRAM signatures that are present on virtual firmware | 🪟 | 100% | Admin | | | [link](https://github.com/kernelwernel/VMAware/tree/main/src/vmaware.hpp#L9926) |
596596
| `VM::SMBIOS_INTEGRITY` | Check if SMBIOS is malformed/corrupted in a way that is typical for VMs | 🪟 | 50% | | | | [link](https://github.com/kernelwernel/VMAware/tree/main/src/vmaware.hpp#L10357) |
597597
| `VM::EDID` | Check for non-standard EDID configurations | 🪟 | 100% | | | | [link](https://github.com/kernelwernel/VMAware/tree/main/src/vmaware.hpp#L10368) |

src/cli.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -805,7 +805,7 @@ static void general(
805805
checker(VM::DBVM, "Dark Byte's hypervisor");
806806
checker(VM::BOOT_LOGO, "boot logo");
807807
checker(VM::MAC_SYS, "system profiler");
808-
checker(VM::OBJECTS, "kernel objects");
808+
checker(VM::KERNEL_OBJECTS, "kernel objects");
809809
checker(VM::NVRAM, "NVRAM");
810810
checker(VM::SMBIOS_INTEGRITY, "SMBIOS integrity");
811811
checker(VM::EDID, "EDID");

src/vmaware.hpp

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
* - struct for internal core components => line 11205
6161
* - start of VM detection technique list => line 4251
6262
* - start of public VM detection functions => line 11551
63-
* - start of externally defined variables => line 12534
63+
* - start of externally defined variables => line 12544
6464
*
6565
*
6666
* ============================== EXAMPLE ===================================
@@ -576,7 +576,7 @@ struct VM {
576576
UD,
577577
BLOCKSTEP,
578578
DBVM,
579-
OBJECTS,
579+
KERNEL_OBJECTS,
580580
NVRAM,
581581
SMBIOS_INTEGRITY,
582582
EDID,
@@ -9737,9 +9737,9 @@ struct VM {
97379737
/**
97389738
* @brief Check for any signs of VMs in Windows kernel object entities
97399739
* @category Windows
9740-
* @implements VM::OBJECTS
9740+
* @implements VM::KERNEL_OBJECTS
97419741
*/
9742-
[[nodiscard]] static bool objects() {
9742+
[[nodiscard]] static bool kernel_objects() {
97439743
struct OBJECT_DIRECTORY_INFORMATION {
97449744
UNICODE_STRING Name;
97459745
UNICODE_STRING TypeName;
@@ -9904,12 +9904,12 @@ struct VM {
99049904
// "VmGenerationCounter" and "VmGid" are created by the Hyper-V VM Bus provider
99059905
if (objectName == L"VmGenerationCounter") {
99069906
pNtClose(hDir);
9907-
debug("OBJECTS: Detected VmGenerationCounter");
9907+
debug("KERNEL_OBJECTS: Detected VmGenerationCounter");
99089908
return core::add(brands::HYPERV);
99099909
}
99109910
if (objectName == L"VmGid") {
99119911
pNtClose(hDir);
9912-
debug("OBJECTS: Detected VmGid");
9912+
debug("KERNEL_OBJECTS: Detected VmGid");
99139913
return core::add(brands::HYPERV);
99149914
}
99159915
}
@@ -11891,13 +11891,21 @@ struct VM {
1189111891

1189211892
u16 threshold = 150;
1189311893

11894-
// if high threshold is set, the points
11894+
// if high threshold is set, the bar
1189511895
// will be 300. If not, leave it as 150
1189611896
if (core::is_enabled(flags, HIGH_THRESHOLD)) {
1189711897
threshold = high_threshold_score;
1189811898
}
1189911899

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());
1190111909
}
1190211910

1190311911

@@ -12095,7 +12103,7 @@ struct VM {
1209512103
case DBVM: return "DBVM";
1209612104
case BOOT_LOGO: return "BOOT_LOGO";
1209712105
case MAC_SYS: return "MAC_SYS";
12098-
case OBJECTS: return "OBJECTS";
12106+
case KERNEL_OBJECTS: return "KERNEL_OBJECTS";
1209912107
case NVRAM: return "NVRAM";
1210012108
case SMBIOS_INTEGRITY: return "SMBIOS_INTEGRITY";
1210112109
case EDID: return "EDID";
@@ -12707,7 +12715,7 @@ std::array<VM::core::technique, VM::enum_size + 1> VM::core::technique_table = [
1270712715
{VM::DRIVERS, {100, VM::drivers}},
1270812716
{VM::DEVICE_HANDLES, {100, VM::device_handles}},
1270912717
{VM::VIRTUAL_PROCESSORS, {100, VM::virtual_processors}},
12710-
{VM::OBJECTS, {100, VM::objects}},
12718+
{VM::KERNEL_OBJECTS, {100, VM::kernel_objects}},
1271112719
{VM::HYPERVISOR_QUERY, {100, VM::hypervisor_query}},
1271212720
{VM::AUDIO, {25, VM::audio}},
1271312721
{VM::DISPLAY, {25, VM::display}},

0 commit comments

Comments
 (0)