Skip to content

Commit f0e1652

Browse files
committed
Add PCI Vendor ID registry scan
Signed-off-by: dmfrpro <[email protected]>
1 parent 177707c commit f0e1652

File tree

12 files changed

+156
-15
lines changed

12 files changed

+156
-15
lines changed

al-khaser/Al-khaser.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@ int main(int argc, char* argv[])
268268
if (ENABLE_QEMU_CHECKS) {
269269
print_category(TEXT("QEMU Detection"));
270270
qemu_reg_key_value();
271+
qemu_reg_keys();
271272
qemu_processes();
272273
qemu_dir();
273274
exec_check(&qemu_firmware_SMBIOS, TEXT("Checking SMBIOS firmware "));
@@ -278,13 +279,14 @@ int main(int argc, char* argv[])
278279
/* Xen Detection */
279280
if (ENABLE_XEN_CHECKS) {
280281
print_category(TEXT("Xen Detection"));
282+
xen_reg_keys();
281283
xen_process();
282284
exec_check(&xen_check_mac, TEXT("Checking Mac Address start with 08:16:3E "));
283285
}
284286

285287
/* KVM Detection */
286288
if (ENABLE_KVM_CHECKS) {
287-
print_category(TEXT("Xen Detection"));
289+
print_category(TEXT("KVM Detection"));
288290
kvm_files();
289291
kvm_reg_keys();
290292
exec_check(&kvm_dir, TEXT("Checking KVM virio directory "));
@@ -297,9 +299,10 @@ int main(int argc, char* argv[])
297299
wine_reg_keys();
298300
}
299301

300-
/* Paralles Detection */
302+
/* Parallels Detection */
301303
if (ENABLE_PARALLELS_CHECKS) {
302-
print_category(TEXT("Paralles Detection"));
304+
print_category(TEXT("Parallels Detection"));
305+
parallels_reg_keys();
303306
parallels_process();
304307
exec_check(&parallels_check_mac, TEXT("Checking Mac Address start with 00:1C:42 "));
305308
}

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]);

al-khaser/AntiVM/VirtualBox.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ VOID vbox_reg_keys()
4444
_T("SYSTEM\\ControlSet001\\Services\\VBoxMouse"),
4545
_T("SYSTEM\\ControlSet001\\Services\\VBoxService"),
4646
_T("SYSTEM\\ControlSet001\\Services\\VBoxSF"),
47-
_T("SYSTEM\\ControlSet001\\Services\\VBoxVideo")
47+
_T("SYSTEM\\ControlSet001\\Services\\VBoxVideo"),
48+
_T("SYSTEM\\CurrentControlSet\\Enum\\PCI\\VEN_5333*"),
4849
};
4950

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

al-khaser/AntiVM/VirtualPC.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ VOID virtual_pc_reg_keys()
3232
/* Array of strings of blacklisted registry keys */
3333
const TCHAR* szKeys[] = {
3434
_T("SOFTWARE\\Microsoft\\Virtual Machine\\Guest\\Parameters"),
35+
_T("SYSTEM\\CurrentControlSet\\Enum\\PCI\\VEN_5333*"),
3536
};
3637

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

al-khaser/AntiVM/Xen.cpp

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

33
#include "Xen.h"
44

5+
/*
6+
Check against Xen registry keys
7+
*/
8+
VOID xen_reg_keys()
9+
{
10+
/* Array of strings of blacklisted registry keys */
11+
const TCHAR* szKeys[] = {
12+
_T("SYSTEM\\CurrentControlSet\\Enum\\PCI\\VEN_5853*"),
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+
if (Is_RegKeyExists(HKEY_LOCAL_MACHINE, szKeys[i]))
23+
print_results(TRUE, msg);
24+
else
25+
print_results(FALSE, msg);
26+
}
27+
}
28+
529
/*
630
Check for process list
731
*/

0 commit comments

Comments
 (0)