text
stringlengths 4
429
|
---|
The second volume \\.\Hd2 is not mapped to a file, so when a computer is switched off, its contents is lost. Thus, it could be |
used as a temporary or a cache storage. The data stored in \\.\Hd2 is encrypted the same way the first volume |
s data. |
Both volumes appear to be set up as FAT volumes. |
An attempt to read the data from these volumes with the code below: |
01 HANDLE hDisk = CreateFile( |
\\\\.\\Hd1 |
02 |
GENERIC_READ, |
03 |
FILE_SHARE_READ, |
04 |
NULL, |
05 |
OPEN_EXISTING, |
06 |
0, |
07 |
NULL); |
08 BYTE lpBuffer[16384]; |
09 DWORD dwBytes; |
10 if (hDisk) |
11 { |
12 |
ReadFile(hDisk, lpBuffer, 16384, &dwBytes, NULL); |
13 |
// inspect the buffer |
14 |
CloseHandle(hDisk); |
15 } |
This will produce the following results: |
For \\.\Hd1: |
0 1 2 3 4 5 6 7 8 9 A B C D E F 0123456789ABCDEF |
00000000 EB 00 00 00 00 00 00 00 00 00 00 00 02 04 02 00 ................ |
00000010 02 00 02 00 00 F8 C8 00 20 00 02 00 01 00 00 00 ........ ....... |
00000020 FF 1F 03 00 80 00 29 E8 99 9B BA 4E 4F 20 4E 41 ......)....NO NA |
00000030 4D 45 20 20 20 20 46 41 54 31 36 20 20 20 00 00 ME FAT16 .. |
00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ |
For \\.\Hd2: |
0 1 2 3 4 5 6 7 8 9 A B C D E F 0123456789ABCDEF |
00000000 EB 00 00 00 00 00 00 00 00 00 00 00 02 01 02 00 ................ |
00000010 02 00 02 FF 7F F8 7F 00 20 00 02 00 01 00 00 00 ........ ....... |
00000020 00 00 00 00 80 00 29 E8 99 9B BA 4E 4F 20 4E 41 ......)....NO NA |
00000030 4D 45 20 20 20 20 46 41 54 31 36 20 20 20 00 00 ME FAT16 .. |
00000040 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ |
The ability to keep its data on TrueCrypt-like volumes provides Snake with a powerful ability to exchange data with the usermode |
DLL, as these volumes are accessible both from usermode and kernel mode. |
Static analysis of the code reveals that the Snake driver uses virtual volumes to store its data and additional files on it. |
For example, it stores its message queue in a file called: |
\.\\Hd1\queue |
The message queue indicates an asynchronous communication model between kernel mode driver and a usermode DLL, |
e.g. to pass commands, configuration parameters, binary images of additional Snake components. |
Other files that may also be found on the virtual volume are: klog, conlog, dump, rkng_inst.exe, |
where rkng_inst.exe could be the name of the original dropper, and other log files could potentially contain executed command |
outputs, intercepted keystrokes, and other output logs. |
BAE Systems Applied Intelligence: Snake Rootkit Report 2014 21 |
64-BIT EDITIONS OF WINDOWS |
The 64-bit version of Snake must deal with a number of additional security protections implemented in 64-bit editions of Microsoft |
Windows, the most significant of which are kernel driver signature validation and Kernel Patch Protection (more commonly known as |
PatchGuard). |
PatchGuard is a feature of 64-bit Windows which aims to prevent modification of the Windows kernel, something that is often |
performed by malware attempting to hide itself on an infected system. Although PatchGuard is successful at preventing kernel |
patching once initialised, several published bypass approaches exist4,5. The technique used by Snake appears to be similar to these |
approaches. |
The driver signing policy enforced by all 64-bit versions of Windows from Vista onwards requires all kernel-mode drivers to be signed |
with a valid digital signature. The Snake dropper contains both 32-bit and 64-bit unsigned drivers, and it can successfully load its |
unsigned 64-bit driver on a 64-bit version of Windows XP |
as driver signing is not enforced it does not have to resort to any tricks |
under this OS version. In this case, in order to ensure the driver is loaded automatically at startup, the dropper can install the 64-bit |
driver on 64-bit Windows XP in the same way it installs a 32-bit driver on a 32-bit version of Windows XP. |
On 64-bit versions of Windows Vista and above it behaves differently. Firstly, the 64-bit unsigned driver file is created as usual: |
%windows%\$NtUninstallQ817473$\fdisk.sys |
However, the driver is not registered; what is registered instead is the dropper itself. To do that, the dropper first copies itself as: |
%windows%\$NtUninstallQ817473$\fdisk_mon.exe |
The dropper then registers itself as a service to ensure it starts every time Windows is booted, by creating the values: |
ErrorControl = 0 |
Type = 16 |
Start = 2 |
ImagePath = |
%SystemRoot%\$NtUninstallQ817473$\fdisk_mon.exe |
ObjectName = |
LocalSystem |
WOW64 = 1 |
in the registry key: |
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Ultra3 |
Now comes the most interesting part: does the dropper manage to load its 64-bit unsigned driver under 64-bit versions of Windows |
Vista and later versions, such as 64-bit Windows 7/8? The answer: Yes, it does. |
Does it resort to using bootkit technology, which has been used in the past to bypass protections to load unsigned 64-bit drivers? |
The answer: No. Bootkits must overwrite the Master Boot Record (MBR) and antivirus products are well trained to catch that kind of |
bad behavior. |
The masterminds behind Snake rootkit seem to be well aware of this so what they resorted to instead is leveraging a vulnerability |
in a well-known virtualization product called VirtualBox, a product made by Oracle which is widely used by researchers to analyse |
malware. VirtualBox driver version 1.6.2 was released in June 2, 2008. Two months later, in August 2008, security researchers |
reported that its main driver component, which is signed under the entity |
innotek Gmbh |
, contained a privilege escalation |
vulnerability6. |
In a nutshell, the VirtualBox software installs a driver called VBoxDrv. The driver is controlled with the Input/Ouput Control Codes |
(32-bit values called IOCTL) passed along DeviceIoControl() API. One of the documented transfer methods that the system |
uses to pass data between the caller of DeviceIoControl() API and the driver itself is called METHOD_NEITHER. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.