Skip to content

Commit 670c4c3

Browse files
committed
removed compiler explorer and updated comments
1 parent 7051eb0 commit 670c4c3

3 files changed

Lines changed: 20 additions & 41 deletions

File tree

docs/documentation.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,6 @@ This is the table of all the brands the lib supports.
594594
| NoirVisor | `VM::brands::NOIRVISOR` | Hypervisor (type 1) | |
595595
| Qihoo 360 Sandbox | `VM::brands::QIHOO` | Sandbox | |
596596
| nsjail | `VM::brands::NSJAIL` | Process isolator | |
597-
| Xen with nsjail (for Compiler Explorer) | `VM::brands::COMPILER_EXPLORER` | Type 1 hypervisor with process isolator | |
598597

599598
<br>
600599

src/cli.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,6 @@ Neko Project II
274274
NoirVisor
275275
Qihoo 360 Sandbox
276276
nsjail
277-
Xen with nsjail (for Compiler Explorer)
278277
)";
279278

280279
std::exit(0);
@@ -658,7 +657,6 @@ std::string vm_description(const std::string& vm_brand) {
658657
{ VM::brands::NOIRVISOR, "NoirVisor is a hardware-accelerated hypervisor with support to complex functions and purposes. It is designed to support processors based on x86 architecture with hardware-accelerated virtualization feature. For example, Intel processors supporting Intel VT-x or AMD processors supporting AMD-V meet the requirement. It was made by Zero-Tang." },
659658
{ VM::brands::QIHOO, "360 sandbox is a part of 360 Total Security. Similar to other sandbox software, it provides a virtualized environment where potentially malicious or untrusted programs can run without affecting the actual system. Qihoo 360 Sandbox is commonly used for testing unknown applications, analyzing malware behavior, and protecting users from zero-day threats." },
660659
{ VM::brands::NSJAIL, "nsjail is a process isolation tool for Linux. It utilizes Linux namespace subsystem, resource limits, and the seccomp-bpf syscall filters of the Linux kernel. It can be used for isolating networking services, CTF challenges, and containing invasive syscall-level OS fuzzers." },
661-
{ VM::brands::COMPILER_EXPLORER, "Compiler Explorer is an interactive web compiler that supports numerous languages. The backend uses nsjail for their executor to isolate processes, while an additional hypervisor layer is used called Xen."},
662660
{ VM::brands::NULL_BRAND, "Indicates no detectable virtualization brand. This result may occur on bare-metal systems, unsupported/obscure hypervisors, or when anti-detection techniques (e.g., VM escaping) are employed by the guest environment." }
663661
};
664662

src/vmaware.hpp

Lines changed: 20 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -711,7 +711,6 @@ struct VM {
711711
static constexpr const char* NOIRVISOR = "NoirVisor";
712712
static constexpr const char* QIHOO = "Qihoo 360 Sandbox";
713713
static constexpr const char* NSJAIL = "nsjail";
714-
static constexpr const char* COMPILER_EXPLORER = "Xen with nsjail (for Compiler Explorer)";
715714
static constexpr const char* NULL_BRAND = "Unknown";
716715
};
717716

@@ -10317,14 +10316,6 @@ struct VM {
1031710316
continue;
1031810317
}
1031910318

10320-
// check if it's spoofable, and whether it's enabled (NOTE: SPOOFABILITY IS DEPRECATED)
10321-
//if (
10322-
// technique_data.is_spoofable &&
10323-
// core::is_disabled(flags, SPOOFABLE)
10324-
//) {
10325-
// continue;
10326-
//}
10327-
1032810319
// check if the technique is cached already
1032910320
if (memo_enabled && memo::is_cached(technique_macro)) {
1033010321
const memo::data_t data = memo::cache_fetch(technique_macro);
@@ -10339,18 +10330,20 @@ struct VM {
1033910330
// run the technique
1034010331
const bool result = technique_data.run();
1034110332

10342-
// accumulate the points if technique detected a VM
10333+
// accumulate the points if the technique detected a VM
1034310334
if (result) {
1034410335
points += technique_data.points;
1034510336

10346-
// this is specific to VM::detected_count() which returns
10347-
// the number of techniques that returned a positive
10337+
// this is specific to VM::detected_count() which
10338+
// returns the number of techniques that found a VM.
1034810339
detected_count_num++;
1034910340
}
1035010341

1035110342
// for things like VM::detect() and VM::percentage(),
1035210343
// a score of 150+ is guaranteed to be a VM, so
1035310344
// there's no point in running the rest of the techniques
10345+
// (unless the threshold is set to be higher, but it's the
10346+
// same story here nonetheless, except the threshold is 300)
1035410347
if (shortcut && points >= threshold_points) {
1035510348
return points;
1035610349
}
@@ -10401,16 +10394,17 @@ struct VM {
1040110394

1040210395

1040310396
/**
10404-
* basically what this entire variadic template fuckery does is manage the
10405-
* variadic arguments being given through the arg_handler function,
10406-
* which could either be a std::bitset<N>, a uint8_t, or a combination
10407-
* of both of them. This will handle both argument types and implement
10408-
* them depending on what their types are. If it's a std::bitset<N>,
10409-
* do the |= operation on flag_collector. If it's a uint8_t, simply
10410-
* .set() that into the flag_collector. That's the gist of it.
10397+
* basically what this entire variadic template inheritance fuckery
10398+
* does is manage the variadic arguments being given through the
10399+
* arg_handler function, which could either be a std::bitset<N>,
10400+
* a uint8_t, or a combination of both of them. This will handle
10401+
* both argument types and implement them depending on what their
10402+
* types are. If it's a std::bitset<N>, do the |= operation on
10403+
* flag_collector. If it's a uint8_t, simply .set() that into the
10404+
* flag_collector. That's the gist of it.
1041110405
*
1041210406
* Also I won't even deny, the majority of this section was 90% generated
10413-
* by chatgpt. Can't be arsed with this C++ templatisation shit.
10407+
* by chatgpt. Can't be arsed with this C++ variadic templatisation shit.
1041410408
* Like is it really my fault that I have a hard time understanging C++'s
1041510409
* god awful metaprogramming designs? And don't even get me started on SNIFAE.
1041610410
*
@@ -10704,8 +10698,8 @@ struct VM {
1070410698
}
1070510699
}
1070610700

10707-
// goofy ass C++11 and C++14 linker error workaround,
10708-
// and yes, this does look stupid.
10701+
// goofy ass C++11 and C++14 linker error workaround.
10702+
// And yes, this does look stupid.
1070910703
#if (CPP <= 14)
1071010704
constexpr const char* TMP_QEMU = "QEMU";
1071110705
constexpr const char* TMP_KVM = "KVM";
@@ -10727,10 +10721,6 @@ struct VM {
1072710721
constexpr const char* TMP_AZURE = "Microsoft Azure Hyper-V";
1072810722
constexpr const char* TMP_NANOVISOR = "Xbox NanoVisor (Hyper-V)";
1072910723
constexpr const char* TMP_HYPERV_ARTIFACT = "Hyper-V artifact (not an actual VM)";
10730-
10731-
constexpr const char* TMP_NSJAIL = "nsjail";
10732-
constexpr const char* TMP_XEN = "Xen HVM";
10733-
constexpr const char* TMP_COMPILER_EXPLORER = "Xen with nsjail (for Compiler Explorer)";
1073410724
#else
1073510725
constexpr const char* TMP_QEMU = brands::QEMU;
1073610726
constexpr const char* TMP_KVM = brands::KVM;
@@ -10752,10 +10742,6 @@ struct VM {
1075210742
constexpr const char* TMP_AZURE = brands::AZURE_HYPERV;
1075310743
constexpr const char* TMP_NANOVISOR = brands::NANOVISOR;
1075410744
constexpr const char* TMP_HYPERV_ARTIFACT = brands::HYPERV_ARTIFACT;
10755-
10756-
constexpr const char* TMP_NSJAIL = brands::NSJAIL;
10757-
constexpr const char* TMP_XEN = brands::XEN;
10758-
constexpr const char* TMP_COMPILER_EXPLORER = brands::COMPILER_EXPLORER;
1075910745
#endif
1076010746

1076110747
// this is where all the RELEVANT brands are stored.
@@ -10875,17 +10861,15 @@ struct VM {
1087510861
merge(TMP_VMWARE_HARD, TMP_GSX, TMP_VMWARE_HARD);
1087610862
merge(TMP_VMWARE_HARD, TMP_WORKSTATION, TMP_VMWARE_HARD);
1087710863

10878-
merge(TMP_NSJAIL, TMP_XEN, TMP_COMPILER_EXPLORER);
10879-
10880-
1088110864

1088210865
// the brand element, which stores the NAME (const char*) and the SCORE (u8)
1088310866
using brand_element_t = std::pair<const char*, brand_score_t>;
1088410867

10868+
// convert the std::map into a std::vector, easier to handle this way
1088510869
std::vector<brand_element_t> vec(brands.begin(), brands.end());
1088610870

10887-
// sort the "brands" map so that the brands with the
10888-
// highest score appears first in descending order
10871+
// sort the relevant brands vector so that the brands with
10872+
// the highest score appears first in descending order
1088910873
std::sort(vec.begin(), vec.end(), [](
1089010874
const brand_element_t &a,
1089110875
const brand_element_t &b
@@ -11383,8 +11367,7 @@ struct VM {
1138311367
{ brands::AMD_SEV_ES, "VM encryptor" },
1138411368
{ brands::AMD_SEV_SNP, "VM encryptor" },
1138511369
{ brands::GCE, "Cloud VM service" },
11386-
{ brands::NSJAIL, "Process isolator" },
11387-
{ brands::COMPILER_EXPLORER, "Type 1 hypervisor with process isolator" },
11370+
{ brands::NSJAIL, "Process isolator" }
1138811371
};
1138911372

1139011373
auto it = type_table.find(brand_str.c_str());
@@ -11585,7 +11568,6 @@ std::map<const char*, VM::brand_score_t> VM::core::brand_scoreboard{
1158511568
{ VM::brands::QIHOO, 0 },
1158611569
{ VM::brands::NOIRVISOR, 0 },
1158711570
{ VM::brands::NSJAIL, 0 },
11588-
{ VM::brands::COMPILER_EXPLORER, 0 },
1158911571
{ VM::brands::NULL_BRAND, 0 }
1159011572
};
1159111573

0 commit comments

Comments
 (0)