@@ -48,7 +48,7 @@ constexpr const char* date = "August 2024";
4848
4949constexpr const char * bold = " \033 [1m" ;
5050constexpr const char * ansi_exit = " \x1B [0m" ;
51- constexpr const char * red = " \x1B [38;2;239;75;75m" ;
51+ constexpr const char * red = " \x1B [38;2;239;75;75m" ;
5252constexpr const char * orange = " \x1B [38;2;255;180;5m" ;
5353constexpr const char * green = " \x1B [38;2;94;214;114m" ;
5454constexpr const char * red_orange = " \x1B [38;2;247;127;40m" ;
@@ -58,6 +58,7 @@ constexpr const char* grey = "\x1B[38;2;108;108;108m";
5858enum arg_enum : std::uint8_t {
5959 HELP,
6060 VERSION,
61+ ALL,
6162 DETECT,
6263 STDOUT,
6364 BRAND,
@@ -66,7 +67,6 @@ enum arg_enum : std::uint8_t {
6667 CONCLUSION,
6768 NUMBER,
6869 TYPE,
69- HYPERV, // will be removed in the next release
7070 NOTES,
7171 SPOOFABLE,
7272 NULL_ARG
@@ -120,6 +120,7 @@ R"(Usage:
120120Options:
121121 -h | --help prints this help menu
122122 -v | --version print cli version and other details
123+ -a | --all run the result with ALL the techniques enabled (might contain false positives)
123124 -d | --detect returns the result as a boolean (1 = VM, 0 = baremetal)
124125 -s | --stdout returns either 0 or 1 to STDOUT without any text output (0 = VM, 1 = baremetal)
125126 -b | --brand returns the VM brand string (consult documentation for full output list)
@@ -335,6 +336,10 @@ std::string type(const std::string &brand_str) {
335336}
336337
337338bool is_spoofable (const VM::enum_flags flag) {
339+ if (arg_bitset.test (ALL)) {
340+ return false ;
341+ }
342+
338343 switch (flag) {
339344 case VM::MAC:
340345 case VM::DOCKERENV:
@@ -418,12 +423,28 @@ bool are_perms_required(const VM::enum_flags flag) {
418423#endif
419424}
420425
426+
427+ bool is_disabled (const VM::enum_flags flag) {
428+ if (arg_bitset.test (ALL)) {
429+ return false ;
430+ }
431+
432+ switch (flag) {
433+ case VM::RDTSC:
434+ case VM::RDTSC_VMEXIT:
435+ case VM::CURSOR: return true ;
436+ default : return false ;
437+ }
438+ }
439+
440+
421441void general () {
422442 const std::string detected = (" [ " + std::string (green) + " DETECTED" + std::string (ansi_exit) + " ]" );
423443 const std::string not_detected = (" [" + std::string (red) + " NOT DETECTED" + std::string (ansi_exit) + " ]" );
424444 const std::string spoofable = (" [" + std::string (red) + " SPOOFABLE " + std::string (ansi_exit) + " ]" );
425445 const std::string note = (" [ NOTE ]" );
426446 const std::string no_perms = (" [" + std::string (grey) + " NO PERMS " + std::string (ansi_exit) + " ]" );
447+ const std::string disabled = (" [" + std::string (grey) + " DISABLED " + std::string (ansi_exit) + " ]" );
427448 const std::string tip = (std::string (green) + " TIP: " + std::string (ansi_exit));
428449
429450 auto checker = [&](const VM::enum_flags flag, const char * message) -> void {
@@ -441,6 +462,11 @@ void general() {
441462 }
442463#endif
443464
465+ if (is_disabled (flag)) {
466+ std::cout << disabled << " Skipped " << message << " \n " ;
467+ return ;
468+ }
469+
444470 if (VM::check (flag)) {
445471 std::cout << detected << " Checking " << message << " ...\n " ;
446472 detected_count++;
@@ -493,7 +519,7 @@ void general() {
493519 checker (VM::DLL, " DLLs" );
494520 checker (VM::REGISTRY, " registry" );
495521 checker (VM::CWSANDBOX_VM, " Sunbelt CWSandbox directory" );
496- checker (VM::WINE_CHECK, " Wine" );
522+ // checker(VM::WINE_CHECK, "Wine");
497523 checker (VM::VM_FILES, " VM files" );
498524 checker (VM::HWMODEL, " hw.model" );
499525 checker (VM::DISK_SIZE, " disk size" );
@@ -504,7 +530,7 @@ void general() {
504530 checker (VM::MEMORY, " low memory space" );
505531 checker (VM::VM_PROCESSES, " VM processes" );
506532 checker (VM::LINUX_USER_HOST, " default Linux user/host" );
507- checker (VM::VBOX_WINDOW_CLASS, " VBox window class" );
533+ // checker(VM::VBOX_WINDOW_CLASS, "VBox window class");
508534 checker (VM::GAMARUE, " gamarue ransomware technique" );
509535 checker (VM::VMID_0X4, " 0x4 leaf of VMID" );
510536 checker (VM::PARALLELS_VM, " Parallels techniques" );
@@ -695,9 +721,10 @@ int main(int argc, char* argv[]) {
695721 std::exit (0 );
696722 }
697723
698- static constexpr std::array<std::pair<const char *, arg_enum>, 23 > table {{
724+ static constexpr std::array<std::pair<const char *, arg_enum>, 24 > table {{
699725 { " -h" , HELP },
700726 { " -v" , VERSION },
727+ { " -a" , ALL },
701728 { " -d" , DETECT },
702729 { " -s" , STDOUT },
703730 { " -b" , BRAND },
@@ -708,6 +735,7 @@ int main(int argc, char* argv[]) {
708735 { " -t" , TYPE },
709736 { " --help" , HELP },
710737 { " --version" , VERSION },
738+ { " --all" , ALL },
711739 { " --detect" , DETECT },
712740 { " --stdout" , STDOUT },
713741 { " --brand" , BRAND },
@@ -716,7 +744,6 @@ int main(int argc, char* argv[]) {
716744 { " --brand-list" , BRAND_LIST },
717745 { " --number" , NUMBER },
718746 { " --type" , TYPE },
719- { " --disable-hyperv-host" , HYPERV },
720747 { " --disable-notes" , NOTES },
721748 { " --spoofable" , SPOOFABLE }
722749 }};
@@ -782,15 +809,17 @@ int main(int argc, char* argv[]) {
782809 auto settings = [&]() -> std::bitset<max_bits> {
783810 std::bitset<max_bits> setting_bits;
784811
785- if (arg_bitset.test (HYPERV)) {
786- std::cerr << " --disable-hyperv-host has been deprecated, the determination of whether it's a host Hyper-V or VM Hyper-V is now done automatically" ;
787- return 1 ;
812+ if (arg_bitset.test (SPOOFABLE)) {
813+ setting_bits.set (VM::SPOOFABLE);
788814 }
789815
790- if (arg_bitset.test (SPOOFABLE)) {
816+ if (arg_bitset.test (ALL)) {
817+ setting_bits |= VM::ALL;
791818 setting_bits.set (VM::SPOOFABLE);
792819 }
793820
821+ setting_bits.set (NULL_ARG);
822+
794823 return setting_bits;
795824 };
796825
0 commit comments