目录
-
固件表的检测方法
-
1. 检查原始固件表中是否存在特定的字符串
-
1.1. Windows Vista+
-
1.2. Windows XP
-
2. 检查原始SMBIOS固件表中是否存在特定字符串
-
2.1. Windows Vista+
-
2.2. Windows XP
-
反制措施
-
归功于
固件表的检测方法
如果操作系统是在虚拟环境下运行的,那么操作系统会使用一些特殊的内存区域,其中包含特定的伪装。根据操作系统版本的不同,可以使用不同的方法转储这些内存区域。
固件表是通过SYSTEM_FIRMWARE_TABLE_INFORMATION对象检索的。它的定义如下:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
typedef struct _SYSTEM_FIRMWARE_TABLE_INFORMATION { ULONG ProviderSignature; SYSTEM_FIRMWARE_TABLE_ACTION Action; ULONG TableID; ULONG TableBufferLength; UCHAR TableBuffer[ANYSIZE_ARRAY]; // <- the result will reside in this field } SYSTEM_FIRMWARE_TABLE_INFORMATION, *PSYSTEM_FIRMWARE_TABLE_INFORMATION; // helper enum typedef enum _SYSTEM_FIRMWARE_TABLE_ACTION { SystemFirmwareTable_Enumerate, SystemFirmwareTable_Get } SYSTEM_FIRMWARE_TABLE_ACTION, *PSYSTEM_FIRMWARE_TABLE_ACTION; |
1. 检查原始固件表中是否存在特定的字符串
扫描检索到的固件表以确定是否存在特定字符串。
根据Windows的版本,不同的功能被用于这种检查。见下面的代码样本。
1.1. Windows Vista+
代码样本:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
// First, SYSTEM_FIRMWARE_TABLE_INFORMATION object is initialized in the following way: SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti = (PSYSTEM_FIRMWARE_TABLE_INFORMATION)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, Length); sfti->Action = SystemFirmwareTable_Get; // 1 sfti->ProviderSignature = 'FIRM' ; sfti->TableID = 0xC0000; sfti->TableBufferLength = Length; // Then initialized SYSTEM_FIRMWARE_TABLE_INFORMATION object is used as an argument for // the system information call in the following way in order to dump raw firmware table: NtQuerySystemInformation( SystemFirmwareTableInformation, // 76 sfti, Length, &Length); |
识别标志:
如果函数
-
NtQuerySystemInformation
包含:
-
第1个参数等于76 (SystemFirmwareTableInformation)
-
第2个参数的sfti->ProviderSignature字段被初始化为’FIRM’并且 sffti ->Action字段初始化为1
那么这就表明应用程序试图使用这种规避技术。
1.2. Windows XP
代码样本:
1
2
3
4
5
6
7
8
9
|
// In case if OS version is Vista+ csrss.exe memory space is read in order to dump raw firmware table: hCSRSS = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, csrss_pid); NtReadVirtualMemory( hCSRSS, 0xC0000, sfti, RegionSize, &memIO); |
识别标志:
如果以下函数包含csrss.exe进程的PID作为其第3个参数:
-
HANDLE hCSRSS = OpenProcess(…, csrss_pid)
并在其后调用以下函数:
-
NtReadVirtualMemory(hCSRSS, 0xC0000, …)
其中包含:
-
第一个参数等于csrss.exe的句柄
-
第2个参数等于0xC0000
那么这就表明应用程序试图使用这种规避技术。
检测表:
检查原始固件表中是否存在以下字符串: |
|
检测 |
字符串 |
Parallels |
Parallels(R) |
VirtualBox |
Innotek |
Oracle |
|
VirtualBox |
|
VirtualPC |
S3 Corp. |
VMware |
VMware |
2. 检查原始SMBIOS固件表中是否存在特定字符串
检索的固件表被扫描,以确定是否存在特定的字符串。
根据Windows的版本,不同的功能被用于这种检查。见下面的代码样本。
2.1. Windows Vista+
代码样本:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
// SYSTEM_FIRMWARE_TABLE_INFORMATION object is initialized in the following way: SYSTEM_FIRMWARE_TABLE_INFORMATION *sfti = (PSYSTEM_FIRMWARE_TABLE_INFORMATION)HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, Length); sfti->Action = SystemFirmwareTable_Get; // 1 sfti->ProviderSignature = 'RSMB' ; sfti->TableID = 0; sfti->TableBufferLength = Length; // Then initialized SYSTEM_FIRMWARE_TABLE_INFORMATION object is used as an argument for // the system information call in the following way in order to dump raw firmware table: NtQuerySystemInformation( SystemFirmwareTableInformation, // 76 sfti, Length, &Length); |
识别标志:
如果函数:
-
NtQuerySystemInformation
包含:
-
第1个参数等于76 (SystemFirmwareTableInformation)
-
第二个参数的sfti->ProviderSignature字段被初始化为’RSMB’并且sfti->Action字段被初始化为1。
那么这就表明应用程序试图使用这种规避技术。
2.2. Windows XP
代码样本:
1
2
3
4
5
6
7
8
9
|
// In case if OS version is Vista+ csrss.exe memory space is read in order to dump raw firmware table: hCSRSS = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, FALSE, csrss_pid); NtReadVirtualMemory( hCSRSS, 0xC0000, sfti, RegionSize, &memIO); |
识别标志:
如果以下函数包含csrss.exe进程的PID作为其第3个参数:
-
HANDLE hCSRSS = OpenProcess(…, csrss_pid)
并在其后调用以下函数:
-
NtReadVirtualMemory(hCSRSS, 0xE0000, …)
其中包含:
-
第一个参数等于csrss.exe句柄
-
第二个参数等于0xE0000
那么这就表明应用程序试图使用这种规避技术。
检测表:
检查原始SMBIOS固件表中是否存在以下字符串: |
|
检测 |
字符串 |
Parallels |
Parallels Software International |
VirtualBox |
Innotek |
Oracle |
|
VirtualBox |
|
VirtualPC |
VS2005R2 |
VMware |
VMware, Inc. |
VMware |
反制措施
-
在Vista以上的系统中,改变csrss.exe在指定地址的内存内容。
-
在Vista+操作系统上,拦截NtQuerySystemInformation以检索SystemFirmwareTableInformation类,并解析SFTI结构以获得提供的字段值。
暂无评论内容