Skip to content

Commit c0a31f5

Browse files
authored
Merge pull request #289 from kernelwernel/dev
feat: Improved VM::TIMER and VM::FILES
2 parents 88b8727 + befaba1 commit c0a31f5

4 files changed

Lines changed: 116 additions & 99 deletions

File tree

README.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -180,10 +180,11 @@ You can view the full docs [here](docs/documentation.md). All the details such a
180180
<br>
181181

182182
> There's already loads of projects that have the same goal such as
183-
<a href="https://github.com/CheckPointSW/InviZzzible">InviZzzible</a>, <a href="https://github.com/a0rtega/pafish">pafish</a> and <a href="https://github.com/LordNoteworthy/al-khaser">Al-Khaser</a>. But the difference between the aforementioned projects is that they don't provide a programmable interface to interact with the detection mechanisms, on top of having little to no support for non-Windows systems.
184-
> Pafish and InviZzzible have been abandoned for years, while Al-Khaser does receive updates and has a wide scope of detection that includes anti-debuggers, anti-injection, and so on, but the VM detections are not sophisticated enough to be practically applied to real-world scenarios while not providing enough VM detection techniques. An additional issue is that they are all GPL projects.
183+
<a href="https://github.com/CheckPointSW/InviZzzible">InviZzzible</a>, <a href="https://github.com/a0rtega/pafish">pafish</a> and <a href="https://github.com/LordNoteworthy/al-khaser">Al-Khaser</a>. But the difference between the aforementioned projects is that they don't provide a programmable interface to interact with the detection mechanisms, on top of having little to no support for non-Windows systems. Additionally, the VM detections in all those projects are often not sophisticated enough to be practically applied to real-world scenarios while not providing enough VM detection techniques. An additional issue is that they are all GPL projects.
184+
>
185+
> Pafish and InviZzzible have been abandoned for years. Although Al-Khaser **DOES** receive occasional updates and has a wide scope of detection that VMAware doesn't provide (anti-debugging, anti-injection, and so on), it still falls short due to the previously mentioned problems above.
185186
>
186-
> I wanted the core detection techniques to be accessible programmatically in a cross-platform way for everybody to get something useful out of it rather than providing just a CLI tool. It also contains a larger quantity of techniques, so it's basically just a VM detection framework on steroids with maximum flexibility.
187+
> While those projects have been useful to VMAware, we wanted to make them far better. My goal was to make the detection techniques to be accessible programmatically in a cross-platform and flexible way for everybody to get something useful out of it rather than providing just a CLI tool. It also contains a larger quantity of techniques, so it's basically just a VM detection framework on steroids that focuses on practical and realistic real-world usability.
187188
188189
</details>
189190

@@ -200,7 +201,7 @@ You can view the full docs [here](docs/documentation.md). All the details such a
200201
<summary>Wouldn't it make it inferior for having it open source?</summary>
201202
<br>
202203

203-
> The only downside to VMAware is that it's fully open source, which makes the job of bypassers easier compared to having it closed source. However, I'd argue that's a worthy tradeoff by having as many VM detection techniques in an open and interactive way rather than trying to obfuscate it. Having it open source means we can have valuable community feedback to strengthen the library more effectively and accurately through discussions, collaborations, and competition against anti-anti-vm projects and malware analysis tools which try to hide it's a VM. All of this combined further advances the forefront innovations in the field of VM detections much more productively, compared to having it closed source.
204+
> The only downside to VMAware is that it's fully open source, which makes the job of bypassers easier compared to having it closed source. However, I'd argue that's a worthy tradeoff by having as many VM detection techniques in an open and interactive way rather than trying to obfuscate it. Having it open source means we can have valuable community feedback to strengthen the library more effectively and accurately through discussions, collaborations, and competition against anti-anti-vm projects and malware analysis tools which try to hide it's a VM. All of this combined has further advanced the forefront innovations in the field of VM detections much more productively, compared to having it closed source.
204205
>
205206
> In other words, it's about quality, feedback, and openness over security through obfuscation.
206207
@@ -289,6 +290,7 @@ And if you found this project useful, a star would be appreciated :)
289290
- [Georgii Gennadev (D00Movenok)](https://github.com/D00Movenok)
290291
- [utoshu](https://github.com/utoshu)
291292
- [Jyd](https://github.com/jyd519)
293+
- [git-eternal](https://github.com/git-eternal)
292294

293295
<br>
294296

docs/documentation.md

Lines changed: 1 addition & 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

@@ -639,6 +638,7 @@ This is the table of all the brands the lib supports.
639638
| | --verbose | add more information to the output |
640639
| | --compact | ignore the unsupported techniques from the CLI output and thus make it more compact |
641640
| | --mit | ignore the GPL techniques and run only the MIT-supported ones |
641+
| | --enums | display the technique enum name used by the lib |
642642
> [!NOTE]
643643
> If you want a general result with the default settings, do not put any arguments. This is the intended way to use the CLI tool.
644644
>

src/cli.cpp

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ enum arg_enum : u8 {
8383
VERBOSE,
8484
COMPACT,
8585
MIT,
86+
ENUMS,
8687
NULL_ARG
8788
};
8889

@@ -163,7 +164,7 @@ R"(Usage:
163164
--verbose add more information to the output
164165
--compact ignore the unsupported techniques from the CLI output
165166
--mit ignore the GPL techniques and run only the MIT-supported ones
166-
167+
--enums display the technique enum name used by the lib
167168
)";
168169
std::exit(0);
169170
}
@@ -273,7 +274,6 @@ Neko Project II
273274
NoirVisor
274275
Qihoo 360 Sandbox
275276
nsjail
276-
Xen with nsjail (for Compiler Explorer)
277277
)";
278278

279279
std::exit(0);
@@ -657,7 +657,6 @@ std::string vm_description(const std::string& vm_brand) {
657657
{ 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." },
658658
{ 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." },
659659
{ 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." },
660-
{ 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."},
661660
{ 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." }
662661
};
663662

@@ -767,13 +766,19 @@ void checker(const VM::enum_flags flag, const char* message) {
767766
supported_count++;
768767
}
769768

769+
std::string enum_name = "";
770+
771+
if (arg_bitset.test(ENUMS)) {
772+
enum_name = grey + " [VM::" + VM::flag_to_string(flag) + "]" + ansi_exit;
773+
}
774+
770775
#if (LINUX)
771776
if (are_perms_required(flag)) {
772777
if (arg_bitset.test(COMPACT)) {
773778
return;
774779
}
775780

776-
std::cout << no_perms << " Skipped " << message << "\n";
781+
std::cout << no_perms << " Skipped " << message << enum_name << "\n";
777782

778783
no_perms_count++;
779784

@@ -788,15 +793,16 @@ void checker(const VM::enum_flags flag, const char* message) {
788793
if (arg_bitset.test(COMPACT)) {
789794
return;
790795
}
791-
std::cout << disabled << " Skipped " << message << "\n";
796+
std::cout << disabled << " Skipped " << message << enum_name << "\n";
792797
disabled_count++;
793798
return;
794799
}
795800

801+
796802
if (VM::check(flag)) {
797-
std::cout << detected << bold << " Checking " << message << "..." << ansi_exit << "\n";
803+
std::cout << detected << bold << " Checking " << message << "..." << enum_name << ansi_exit << "\n";
798804
} else {
799-
std::cout << not_detected << " Checking " << message << "...\n";
805+
std::cout << not_detected << " Checking " << message << "..." << enum_name << ansi_exit << "\n";
800806
}
801807
}
802808

@@ -1196,7 +1202,7 @@ int main(int argc, char* argv[]) {
11961202
std::exit(0);
11971203
}
11981204

1199-
static constexpr std::array<std::pair<const char*, arg_enum>, 30> table {{
1205+
static constexpr std::array<std::pair<const char*, arg_enum>, 31> table {{
12001206
{ "-h", HELP },
12011207
{ "-v", VERSION },
12021208
{ "-a", ALL },
@@ -1226,6 +1232,7 @@ int main(int argc, char* argv[]) {
12261232
{ "--verbose", VERBOSE },
12271233
{ "--compact", COMPACT },
12281234
{ "--mit", MIT },
1235+
{ "--enums", ENUMS },
12291236
{ "--no-color", NO_ANSI }
12301237
}};
12311238

0 commit comments

Comments
 (0)