Evasions: Firmware tables
Contents
Firmware tables detection methods
1. Check if specific strings are present in Raw Firmware Table
1.1. Windows Vista+
1.2. Windows XP
2. Check if specific strings are present in Raw SMBIOS Firmware Table
2.1. Windows Vista+
2.2. Windows XP
Countermeasures
Credits
Firmware tables detection methods
There are special memory areas used by OS which contain specific artifacts if OS is run under virtual environment. These memory areas may be dumped using different methods depending on the OS version.
Firmware tables are retrieved via SYSTEM_FIRMWARE_TABLE_INFORMATION object. It’s defined the following way:
1. Check if specific strings are present in Raw Firmware Table
Retrieved firmware table is scanned for the presence of particular strings.
Depending on Windows version different functions are used for this check. See code samples below.
1.1. Windows Vista+
Code sample
Credits for this code sample: VMDE project
Signature recommendations
If the function
- NtQuerySystemInformation
contains:
- 1st argument equal to 76 (SystemFirmwareTableInformation)
- 2nd argument has sfti->ProviderSignature field initialized to 'FIRM' and sfti->Action field initialized to 1
then it’s an indication of application trying to use this evasion technique.
1.2. Windows XP
Code sample
Signature recommendations
If the following function contains PID of csrss.exe process as its 3rd argument:
- HANDLE hCSRSS = OpenProcess(..., csrss_pid)
and is followed by the call to the following function:
- NtReadVirtualMemory(hCSRSS, 0xC0000, ...)
which contains:
- 1st argument equal to csrss.exe handle
- 2nd argument equal to 0xC0000
then it’s an indication of application trying to use this evasion technique.
Detections table
Check if the following strings are present in Raw Firmware Table: | |
Detect | String |
---|---|
Parallels | Parallels(R) |
VirtualBox | Innotek |
Oracle | |
VirtualBox | |
VirtualPC | S3 Corp. |
VMware | VMware |
2. Check if specific strings are present in Raw SMBIOS Firmware Table
Retrieved firmware table is scanned for the presence of particular strings.
Depending on Windows version different functions are used for this check. See code samples below.
2.1. Windows Vista+
Code sample
Credits for this code sample: VMDE project
Signature recommendations
If the following function:
- NtQuerySystemInformation
contains:
- 1st argument equal to 76 (SystemFirmwareTableInformation)
- 2nd argument has sfti->ProviderSignature field initialized to 'RSMB' and sfti->Action field initialized to 1
then it’s an indication of application trying to use this evasion technique.
2.2. Windows XP
Code sample
Signature recommendations
If the following function contains PID of csrss.exe process as its 3rd argument:
- HANDLE hCSRSS = OpenProcess(..., csrss_pid)
and is followed by the call to the following function:
- NtReadVirtualMemory(hCSRSS, 0xE0000, ...)
which contains:
- 1st argument equal to csrss.exe handle
- 2nd argument equal to 0xE0000
then it’s an indication of application trying to use this evasion technique.
Detections table
Check if the following strings are present in Raw SMBIOS Firmware Table: | |
Detect | String |
---|---|
Parallels | Parallels Software International |
VirtualBox | Innotek |
Oracle | |
VirtualBox | |
VirtualPC | VS2005R2 |
VMware | VMware, Inc. |
VMware |
Countermeasures
- On systems older than Vista change memory content of csrss.exe at given addresses.
- On Vista+ OS hook NtQuerySystemInformation for retrieving SystemFirmwareTableInformation class and parse SFTI structure for provided field values.
Credits
Credits go to open-source project from where code samples were taken:
- VMDE project on github
Though Check Point tool InviZzzible has them all implemented, due to modular structure of the code it would require more space to show a code sample from this tool for the same purposes. That’s why we’ve decided to use other great open-source projects for examples throughout the encyclopedia.