Skip to content

Commit 623b752

Browse files
authored
Looking Glass, VirtualDisplayDriver & PCI VID scan VM detection methods (#287)
* Add Looking-Glass & VDD processes check Signed-off-by: dmfrpro <[email protected]> * Add PCI Vendor ID registry scan Signed-off-by: dmfrpro <[email protected]> --------- Signed-off-by: dmfrpro <[email protected]>
1 parent 2b78990 commit 623b752

File tree

15 files changed

+193
-17
lines changed

15 files changed

+193
-17
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,8 @@ Please, if you encounter any of the anti-analysis tricks which you have seen in
242242
- prl_tools.exe(Parallels)
243243
- xenservice.exe(Citrix Xen)
244244
- qemu-ga.exe (QEMU)
245+
- looking-glass-host.exe (GENERIC)
246+
- VDDSysTray.exe (GENERIC)
245247
- **WMI**
246248
- SELECT * FROM Win32_Bios (SerialNumber) (GENERIC)
247249
- SELECT * FROM Win32_PnPEntity (DeviceId) (VBOX)

al-khaser/Al-khaser.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@ int main(int argc, char* argv[])
170170
known_usernames();
171171
known_hostnames();
172172
other_known_sandbox_environment_checks();
173+
looking_glass_vdd_processes();
173174
exec_check(&NumberOfProcessors, TEXT("Checking Number of processors in machine "));
174175
exec_check(&idt_trick, TEXT("Checking Interupt Descriptor Table location "));
175176
exec_check(&ldt_trick, TEXT("Checking Local Descriptor Table location "));
@@ -267,6 +268,7 @@ int main(int argc, char* argv[])
267268
if (ENABLE_QEMU_CHECKS) {
268269
print_category(TEXT("QEMU Detection"));
269270
qemu_reg_key_value();
271+
qemu_reg_keys();
270272
qemu_processes();
271273
qemu_dir();
272274
exec_check(&qemu_firmware_SMBIOS, TEXT("Checking SMBIOS firmware "));
@@ -277,13 +279,14 @@ int main(int argc, char* argv[])
277279
/* Xen Detection */
278280
if (ENABLE_XEN_CHECKS) {
279281
print_category(TEXT("Xen Detection"));
282+
xen_reg_keys();
280283
xen_process();
281284
exec_check(&xen_check_mac, TEXT("Checking Mac Address start with 08:16:3E "));
282285
}
283286

284287
/* KVM Detection */
285288
if (ENABLE_KVM_CHECKS) {
286-
print_category(TEXT("Xen Detection"));
289+
print_category(TEXT("KVM Detection"));
287290
kvm_files();
288291
kvm_reg_keys();
289292
exec_check(&kvm_dir, TEXT("Checking KVM virio directory "));
@@ -296,9 +299,10 @@ int main(int argc, char* argv[])
296299
wine_reg_keys();
297300
}
298301

299-
/* Paralles Detection */
302+
/* Parallels Detection */
300303
if (ENABLE_PARALLELS_CHECKS) {
301-
print_category(TEXT("Paralles Detection"));
304+
print_category(TEXT("Parallels Detection"));
305+
parallels_reg_keys();
302306
parallels_process();
303307
exec_check(&parallels_check_mac, TEXT("Checking Mac Address start with 00:1C:42 "));
304308
}

al-khaser/AntiVM/Generic.cpp

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2174,4 +2174,35 @@ BOOL hosting_check()
21742174
if (sock != INVALID_SOCKET) closesocket(sock);
21752175
WSACleanup();
21762176
return retVal;
2177-
}
2177+
}
2178+
2179+
/*
2180+
Check for looking-glass-host & VDD processes list.exe
2181+
https://looking-glass.io (Used in Hypervisor Phantom)
2182+
https://github.com/Scrut1ny/Hypervisor-Phantom
2183+
2184+
Looking-glass requires at least one of them:
2185+
1. Physical monitor (undetectable)
2186+
2. HDMI emulator stub (undetectable?)
2187+
3. VirtualDisplayDriver (https://github.com/VirtualDrivers/Virtual-Display-Driver)
2188+
*/
2189+
VOID looking_glass_vdd_processes()
2190+
{
2191+
const TCHAR *szProcesses[] = {
2192+
_T("looking-glass-host.exe"), // Looking-Glass.io
2193+
_T("VDDSysTray.exe"), // VirtualDisplayDriver, used in conjunction
2194+
};
2195+
2196+
WORD iLength = sizeof(szProcesses) / sizeof(szProcesses[0]);
2197+
2198+
for (int i = 0; i < iLength; i++)
2199+
{
2200+
TCHAR msg[256] = _T("");
2201+
_stprintf_s(msg, sizeof(msg) / sizeof(TCHAR), _T("Checking processes %s "), szProcesses[i]);
2202+
2203+
if (GetProcessIdFromName(szProcesses[i]))
2204+
print_results(TRUE, msg);
2205+
else
2206+
print_results(FALSE, msg);
2207+
}
2208+
}

al-khaser/AntiVM/Generic.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,5 @@ BOOL registry_services_disk_enum();
5151
BOOL registry_disk_enum();
5252
BOOL number_SMBIOS_tables();
5353
BOOL firmware_ACPI_WAET();
54-
BOOL hosting_check();
54+
BOOL hosting_check();
55+
VOID looking_glass_vdd_processes();

al-khaser/AntiVM/KVM.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ VOID kvm_reg_keys()
1515
_T("SYSTEM\\ControlSet001\\Services\\BALLOON"),
1616
_T("SYSTEM\\ControlSet001\\Services\\BalloonService"),
1717
_T("SYSTEM\\ControlSet001\\Services\\netkvm"),
18+
_T("SYSTEM\\CurrentControlSet\\Enum\\PCI\\VEN_1AF4*"),
1819
};
1920

2021
WORD dwlength = sizeof(szKeys) / sizeof(szKeys[0]);

al-khaser/AntiVM/Parallels.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,31 @@
22

33
#include "Parallels.h"
44

5+
/*
6+
Check against Parallels registry keys
7+
*/
8+
VOID parallels_reg_keys()
9+
{
10+
/* Array of strings of blacklisted registry keys */
11+
const TCHAR* szKeys[] = {
12+
_T("SYSTEM\\CurrentControlSet\\Enum\\PCI\\VEN_1AB8*"),
13+
};
14+
15+
WORD dwlength = sizeof(szKeys) / sizeof(szKeys[0]);
16+
17+
/* Check one by one */
18+
for (int i = 0; i < dwlength; i++)
19+
{
20+
TCHAR msg[256] = _T("");
21+
_stprintf_s(msg, sizeof(msg) / sizeof(TCHAR), _T("Checking reg key %s "), szKeys[i]);
22+
23+
if (Is_RegKeyExists(HKEY_LOCAL_MACHINE, szKeys[i]))
24+
print_results(TRUE, msg);
25+
else
26+
print_results(FALSE, msg);
27+
}
28+
}
29+
530
/*
631
Check for process list
732
*/

al-khaser/AntiVM/Parallels.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#pragma once
22

3+
VOID parallels_reg_keys();
34
VOID parallels_process();
45
BOOL parallels_check_mac();

al-khaser/AntiVM/Qemu.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,30 @@ VOID qemu_reg_key_value()
2828
}
2929

3030

31+
/*
32+
Check against QEMU registry keys
33+
*/
34+
VOID qemu_reg_keys()
35+
{
36+
/* Array of strings of blacklisted registry keys */
37+
const TCHAR* szKeys[] = {
38+
_T("SYSTEM\\CurrentControlSet\\Enum\\PCI\\VEN_1B36*"),
39+
};
40+
41+
WORD dwlength = sizeof(szKeys) / sizeof(szKeys[0]);
42+
43+
/* Check one by one */
44+
for (int i = 0; i < dwlength; i++)
45+
{
46+
TCHAR msg[256] = _T("");
47+
_stprintf_s(msg, sizeof(msg) / sizeof(TCHAR), _T("Checking reg key %s "), szKeys[i]);
48+
49+
if (Is_RegKeyExists(HKEY_LOCAL_MACHINE, szKeys[i]))
50+
print_results(TRUE, msg);
51+
else
52+
print_results(FALSE, msg);
53+
}
54+
}
3155

3256
/*
3357
Check for process list

al-khaser/AntiVM/Qemu.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#pragma once
22

33
VOID qemu_reg_key_value();
4+
VOID qemu_reg_keys();
45
VOID qemu_processes();
56
VOID qemu_dir();
67
BOOL qemu_firmware_ACPI();

al-khaser/AntiVM/VMWare.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ VOID vmware_reg_keys()
3939
/* Array of strings of blacklisted registry keys */
4040
const TCHAR* szKeys[] = {
4141
_T("SOFTWARE\\VMware, Inc.\\VMware Tools"),
42+
_T("SYSTEM\\CurrentControlSet\\Enum\\PCI\\VEN_15AD*"),
4243
};
4344

4445
WORD dwlength = sizeof(szKeys) / sizeof(szKeys[0]);

0 commit comments

Comments
 (0)