Skip to content

Commit 6a82b30

Browse files
authored
Merge pull request #70 from kernelwernel/dev
changes to contributors
2 parents 3659c33 + fcbc11b commit 6a82b30

4 files changed

Lines changed: 56 additions & 18 deletions

File tree

.all-contributorsrc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"projectName": "VMAware",
3+
"projectOwner": "kernelwernel"
4+
}

README.md

Lines changed: 24 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ This project also provides a tiny, but handy CLI tool utilising the full potenti
7272
<br>
7373

7474
## Installation 📥
75-
To install the library, download or copy paste the `vmaware.hpp` file in the [release section](https://github.com/kernelwernel/VMAware/releases/) to your project. No CMake or shared object linkages are necessary, it's literally that simple.
75+
To install the library, download or copy paste the `vmaware.hpp` file in the latest [release section](https://github.com/kernelwernel/VMAware/releases/latest) to your project. No CMake or shared object linkages are necessary, it's literally that simple.
7676

7777
However, if you want the full project (globally accessible headers with <vmaware.hpp> and the CLI tool), follow these commands:
7878
```bash
@@ -103,10 +103,10 @@ You can view the full docs [here](docs/documentation.md). Trust me, it's not too
103103

104104
## Q&A ❓
105105
- How does it work?
106-
> It utilises a comprehensive list of low-level and high-level anti-VM techniques that gets accounted in a scoring system. The scores for each technique are arbitrarily given, and a threshold must be met to detect if it's running in a VM.
106+
> It utilises a comprehensive list of low-level and high-level anti-VM techniques that gets accounted in a scoring system. The scores for each technique are arbitrarily given, and a certain threshold score must be met to detect if it's running in a VM.
107107
108108
- Who is this library for?
109-
> It's designed for security researchers, VM engineers, and pretty much anybody who needs a practical and rock-solid VM detection mechanism in their project. For example, if you're making a VM and you're testing the effectiveness of concealing itself, or if you're a malware analyst and you want to check if your VM environment is good enough to avoid detection.
109+
> It's designed for security researchers, VM engineers, gamer developers, and pretty much anybody who needs a practical and rock-solid VM detection mechanism in their project. For example, if you're making a VM and you're testing the effectiveness of concealing itself, or if you're a malware analyst and you want to check if your VM environment is good enough to avoid detection. One of the major intentions is to thwart reverse engineers at probing your software in a VM for a legitimate software product (especially games).
110110
111111
- Why another VM detection project?
112112
> There's already loads of projects that have the same goal such as [InviZzzible](https://github.com/CheckPointSW/InviZzzible), [pafish](https://github.com/a0rtega/pafish) and [Al-Khaser](https://github.com/LordNoteworthy/al-khaser). 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. 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 like those projects.
@@ -115,10 +115,10 @@ You can view the full docs [here](docs/documentation.md). Trust me, it's not too
115115
> Yes. There are some techniques that are trivially spoofable, and there's nothing the library can do about it whether it's a deliberate false negative or even a false positive. This is a problem that every VM detection project is facing, which is why the library is trying to test every technique possible to get the best result based on the environment it's running under.
116116
117117
- Can I use this for malware?
118-
> This project is not soliciting the development of malware for obvious reasons. Even if you intend to use it for concealment purposes, it'll most likely be flagged by antiviruses anyway and nothing is obfuscated to begin with. Good luck manually obfuscating 6000 lines of C++ code lmfao
118+
> This project is not soliciting the development of malware for obvious reasons. Even if you intend to use it for concealment/evasion purposes, it'll most likely be flagged by antiviruses anyway and nothing is obfuscated to begin with. Good luck manually obfuscating 6000 lines of C++ code lmfao
119119
120120
- Why GPL 3.0 and MIT?
121-
> I would've made it strictly MIT so proprietary software can make use of the library, but some of the techniques employed are from GPL 3.0 projects, and I have no choice but to use the same license for legal reasons. This gave me an idea to make an MIT version without all of the GPL code so it can also be used without forcing your code to be open-source. It should be noted that the MIT version removes **8** techniques, and the lesser the number of mechanisms, the less accurate the overall result might be.
121+
> I would've made it strictly MIT so proprietary software can make use of the library, but some of the techniques employed are from GPL 3.0 projects, and I have no choice but to use the same license for legal reasons. This gave me an idea to make an MIT version without the GPL code, so that proprietary software can make use of this library without the legal open-source requirement. It should be noted that the MIT version removes **10** GPL techniques out of the total 80+ as of the 1.2 release, which may slightly impact the overall result to be inaccurate.
122122
123123
- The tool has many false positives under a Windows 11 host, why?
124124
> This is because it is in fact running under a VM. More specifically, Hyper-V might be used by default for every program that's running in Windows 11.
@@ -133,6 +133,23 @@ And if you found this project useful, a star would be appreciated :)
133133
<br>
134134

135135
## Credits and contributors ✒️
136+
137+
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section -->
138+
<!-- prettier-ignore-start -->
139+
<!-- markdownlint-disable -->
140+
141+
<!-- markdownlint-restore -->
142+
<!-- prettier-ignore-end -->
143+
144+
<!-- ALL-CONTRIBUTORS-LIST:END -->
145+
146+
[![All Contributors](https://img.shields.io/github/all-contributors/projectOwner/projectName?color=ee8449&style=flat-square)](#contributors)
147+
148+
- [Requiem](https://github.com/NotRequiem)
149+
- [Alex](https://github.com/greenozon)
150+
- [Marek Knápek](https://github.com/MarekKnapek)
151+
- [Vladyslav Miachkov](https://github.com/fameowner99)
152+
- [Alan Tse](https://github.com/alandtse)
136153
- [Check Point Research](https://research.checkpoint.com/)
137154
- [Unprotect Project](https://unprotect.it/)
138155
- [Al-Khaser](https://github.com/LordNoteworthy/al-khaser)
@@ -141,10 +158,6 @@ And if you found this project useful, a star would be appreciated :)
141158
- N. Rin, EP_X0FF
142159
- [Peter Ferrie, Symantec](https://github.com/peterferrie)
143160
- [Graham Sutherland, LRQA Nettitude](https://www.nettitude.com/uk/)
144-
- [Requiem](https://github.com/NotRequiem)
145-
- [Alex](https://github.com/greenozon)
146-
- [Marek Knápek](https://github.com/MarekKnapek)
147-
- [Vladyslav Miachkov](https://github.com/fameowner99)
148161
- [(Offensive Security) Danny Quist](chamuco@gmail.com)
149162
- [(Offensive Security) Val Smith](mvalsmith@metasploit.com)
150163
- Tom Liston + Ed Skoudis
@@ -155,6 +168,6 @@ And if you found this project useful, a star would be appreciated :)
155168
<br>
156169

157170
## Legal 📜
158-
I am not responsible nor liable for any damage you cause through any malicious usage of this project.
171+
I am not responsible nor liable for any damage you cause through any malicious usage (especially through malware) of this project.
159172

160-
License: GPL-3.0
173+
License: GPL-3.0

docs/documentation.md

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,22 @@ int main() {
128128
}
129129
```
130130

131+
On rare occasions, there could be conflicting reports of multiple VM brands being detected, which could cause an inaccurate or buggy result. This is where `VM::MULTIPLE` comes in. This flag is specific to `VM::brand()`, and it will return a string with the format "`vm_brand1 or vm_brand2 [or vm_brand3 ...]`" ONLY IF it has found a collision between multiple VM brands. For example:
132+
133+
```cpp
134+
#include "vmaware.hpp"
135+
#include <string>
136+
137+
int main() {
138+
const std::string result = VM::brand(VM::MULTIPLE);
139+
140+
// the output could be something like "VirtualBox or VMware"
141+
// it could also be "Sandboxie or Wine or Anubis", there isn't
142+
// a limit to how many VM brands can be included in the string.
143+
std::cout << result << "\n";
144+
}
145+
```
146+
131147
<br>
132148

133149
## `VM::check()`
@@ -315,4 +331,5 @@ VMAware provides a convenient way to not only check for VMs, but also have the f
315331
| `VM::NO_MEMO` | This will disable memoization, meaning the result will not be fetched through a previous computation of the `VM::detect()` function. Use this if you're only using a single function from the `VM` struct for a performance boost.
316332
| `VM::EXTREME` | This will disregard the weights/biases and its scoring system. It will essentially treat any technique that found a hit as a VM detection no matter how low that technique's certainty is, so if a single technique is positive then it will return true. |
317333
| `VM::DEFAULT` | This represents a range of flags which are enabled if no default argument is provided. The reason why this exists is to easily disable any bits manually (shown in the is_vm6 example in the `VM::detect()` section)
318-
| `VM::WIN_HYPERV_DEFAULT` | This will take into account that Windows 11 (and sometimes 10) may have Hyper-V as a default virtualisation software for any program even if the OS is running as host. Essentially, this flag will count any techniques prone to this issue as running in a VM, while having a higher threshold bar to detect it as one. |
334+
| `VM::WIN_HYPERV_DEFAULT` | This will take into account that Windows 11 (and sometimes 10) may have Hyper-V as a default virtualisation software for any program even if the OS is running as host. Essentially, this flag will count any techniques prone to this issue as running in a VM, while having a higher threshold bar to detect it as one. |
335+
| `VM::MULTIPLE` | This is exclusive for `VM::brand()`. It will output a string message of all the potential brands it has detected instead of only giving a single one, which may be buggy.

src/vmaware.hpp

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
* - @Alex (https://github.com/greenozon)
1515
* - @Marek Knápek (https://github.com/MarekKnapek)
1616
* - @Vladyslav Miachkov (https://github.com/fameowner99)
17+
* - @Alan Tse (https://github.com/alandtse)
1718
* - Repository: https://github.com/kernelwernel/VMAware
1819
* - Docs: https://github.com/kernelwernel/VMAware/docs/documentation.md
1920
* - Full credits: https://github.com/kernelwernel/VMAware#credits
@@ -4262,11 +4263,11 @@ struct VM {
42624263
if (x1 || x2 || x3 || x4 || x5) {
42634264
is_vm = true;
42644265
#ifdef __VMAWARE_DEBUG__
4265-
if (x1) { debug("VBOX_MSSMBIOS: x1 = ", x1); }
4266-
if (x2) { debug("VBOX_MSSMBIOS: x2 = ", x2); }
4267-
if (x3) { debug("VBOX_MSSMBIOS: x3 = ", x3); }
4268-
if (x4) { debug("VBOX_MSSMBIOS: x4 = ", x4); }
4269-
if (x5) { debug("VBOX_MSSMBIOS: x5 = ", x5); }
4266+
if (x1) { debug("MSSMBIOS: x1 = ", x1); }
4267+
if (x2) { debug("MSSMBIOS: x2 = ", x2); }
4268+
if (x3) { debug("MSSMBIOS: x3 = ", x3); }
4269+
if (x4) { debug("MSSMBIOS: x4 = ", x4); }
4270+
if (x5) { debug("MSSMBIOS: x5 = ", x5); }
42704271
#endif
42714272
}
42724273

@@ -4275,6 +4276,9 @@ struct VM {
42754276

42764277
if (is_vm) {
42774278
if (x5) {
4279+
bool tmp = core::add(VBOX);
4280+
tmp = core::add(HYPERV);
4281+
UNUSED(tmp);
42784282
return true;
42794283
}
42804284

@@ -5837,7 +5841,7 @@ struct VM {
58375841
std::vector<std::string> potential_brands;
58385842

58395843
for (auto it = brands.cbegin(); it != brands.cend(); ++it) {
5840-
const u8 points = it->second;
5844+
const int points = it->second;
58415845
const std::string brand = it->first;
58425846

58435847
if (points > 0) {

0 commit comments

Comments
 (0)