Skip to content

Windows kernel rootkit

Snake (Uroburos) Rootkit: Traces and Host Checks

Snake, the Turla kernel rootkit that CISA and partners attribute to FSB Center 16: driver loading, concealed storage, queue files, host checks and rebuild.

Kind
Windows kernel rootkit · Kernel layer
Platforms
Windows
First seen
2004
Status
In the wild
Also known as
Uroburos
Checked by
Windows drivers

Overview

Snake is a long-lived cyber-espionage implant for Windows whose kernel-mode component hides the rest of it. G DATA made it public in February 2014 under the name Uroburos, taken from a string in the driver. G DATA described a rootkit made of a driver and an encrypted virtual file system, for 32-bit and 64-bit Windows, built to work peer-to-peer. It also linked the group behind it to the 2008 Agent.BTZ attack on the United States, based on file names, encryption keys and behaviour, and noted that the authors appear to speak Russian. MITRE ATT&CK tracks it as Uroburos (S0022), with Snake as an associated name.

On 9 May 2023, CISA, the FBI, the NSA and partner agencies published advisory AA23-129A. The agencies attribute Snake operations to "a known unit within Center 16" of Russia's FSB, a unit they say operates the Turla toolset more broadly. According to the advisory, development began in late 2003 under the name Uroburos, initial versions were complete around early 2004, and Snake infrastructure was found in over 50 countries. The same day, the U.S. Department of Justice announced Operation MEDUSA: under a court warrant, an FBI tool called PERSEUS sent commands that made Snake overwrite its own vital components on infected computers. The Justice Department said the operation did not patch vulnerabilities or remove other malware or tools left on those machines.

The page is marked in-the-wild because the 2023 advisory describes an active implant. Given its age and the operators' record of adapting it, assume the artefacts below can change.

How it loads and hides

Public reporting covers two generations with different disk layouts.

As G DATA described it in 2014. The driver is registered as a service that starts at every boot. G DATA names HKLM\System\CurrentControlSet\Services\Ultra3 and driver files such as Ultra3.sys, msw32.sys and vstor32.sys, in a folder that follows the pattern %SYSTEMROOT%\$Ntuninstall[Random_ID]$. The virtual file system is a .dat file with a random name in the same folder. On 64-bit Windows, the installer brought a legitimately signed Oracle VirtualBox driver, VBoxDrv.sys version 1.6.2, and used a flaw in it to switch off driver signature enforcement before loading the unsigned rootkit driver. G DATA singled out this use of a vulnerable signed driver to disable the policy; the pattern is now known as bring your own vulnerable driver (BYOVD). G DATA also reports that the driver defeats Kernel Patch Protection.

The driver patches kernel functions inline to hide itself: ZwQueryKey, ZwEnumerateKey, ZwCreateKey and ZwSaveKey to hide its registry keys, ZwReadFile to hide its driver and file system files, and ZwQuerySystemInformation to hide its handles. It injects two libraries into user processes, inj_services_Win32.dll and inj_snake_Win32.dll (Win64 on 64-bit systems).

As the 2023 advisory describes it. The installer is typically jpsetup.exe (earlier jpinst.exe). Persistence is a service typically named WerFaultSvc, chosen, the agencies assess, to blend in with the legitimate WerSvc. At boot it runs Snake's own WerFault.exe, hidden among the legitimate copies in %windows%\WinSxS\. That program reads an encrypted registry blob holding an AES key, IV and file path, and decrypts comadmin.dat in %windows%\system32\Com, which contains the kernel driver and its loader. The kernel module removes Snake's components from any listing the operating system returns, mediates access to the concealed storage, and inspects the first packet of incoming TCP sessions so that Snake can act as a server without opening a new port.

Snake's data lives in a queue file. In older versions it sat inside a covert store, a file-backed NTFS (usually) or FAT-16 (rarely) file system encrypted with CAST-128; in recent versions the advisory says the covert store was removed and the queue file stands alone.

Traces on disk

LocationWhatGeneration and source
HKLM\SYSTEM\CurrentControlSet\Services\Ultra3Kernel driver service2014, G DATA
%SYSTEMROOT%\$Ntuninstall[Random_ID]$\Driver (Ultra3.sys, msw32.sys, vstor32.sys) and a randomly named .dat virtual file system2014, G DATA
VBoxDrv.sys (Oracle VirtualBox 1.6.2)Vulnerable signed driver used to turn off signature enforcement on 64-bit Windows2014, G DATA
HKLM\SYSTEM\CurrentControlSet\Services\WerFaultSvcPersistence service that runs Snake's WerFault.exe2023, CISA
%windows%\WinSxS\...\Werfault.exeSnake's loader among legitimate copies; its icon differs from the real one2023, CISA
%windows%\system32\Com\comadmin.datAES-encrypted kernel driver and loader, high entropy2023, CISA
HKLM\SOFTWARE\Classes\.wav\OpenWithProgIdsEncrypted blob with the AES key, IV and path; otherwise a value of at least 0x1000 bytes with entropy of at least 7.9 elsewhere in the registry2023, CISA
%windows%\Registration\<RANDOM_GUID>.<RANDOM_GUID>.crmlogQueue file: hidden, system and archive attributes, high entropy2023, CISA
jpsetup.exe, jpinst.exeInstaller names2023, CISA

The advisory warns that these names and paths can be changed, and gives high confidence only when several of them line up. It provides YARA rules for the high-entropy files and for the WerFault.exe icon sizes.

How to check a host

Expect the running system to lie. The kernel module filters what Windows reports about files, registry keys and handles. The advisory calls memory analysis "the most effective approach" for detecting Snake, while warning that capturing memory can affect stability. Next best is examining the disk from outside: hives and files read from an image are not filtered by the rootkit.

Offline, from an image or a raw collection:

  • SYSTEM hive: a WerFaultSvc service, any service whose binary sits in WinSxS, driver services pointing into $Ntuninstall…$ folders, and a VBoxDrv service on a host that never had VirtualBox. Key last-write times date the installation. See services and registry hives.
  • SOFTWARE hive: the values under Classes\.wav\OpenWithProgIds. Legitimate values there name ProgIDs and carry little or no data; a large, high-entropy binary value is the advisory's marker.
  • Files: System32\Com\comadmin.dat, *.crmlog files in Windows\Registration, and the WerFault.exe copies in WinSxS, run through the advisory's YARA rules.
  • System event log: event 7045 for the creation of WerFaultSvc or of an unknown kernel driver service.

Live, as a first look only:

sc.exe qc WerFaultSvc
Get-CimInstance Win32_Service -Filter "Name='WerFaultSvc'" | Select-Object Name, PathName, StartMode
reg query "HKLM\SOFTWARE\Classes\.wav\OpenWithProgIds"
Get-ChildItem -Force C:\Windows\Registration -Filter *.crmlog | Select-Object Name, Length, Attributes, LastWriteTime
Get-ChildItem -Force C:\Windows\System32\Com -Filter comadmin.dat
Get-ChildItem -Force C:\Windows -Directory -Filter '$Ntuninstall*'

A clean result here proves little. A hit is worth acting on, and the next step is memory capture and a disk image, not cleanup. The advisory also provides network signatures (Suricata rules) for Snake's protocols.

What the checker looks for

windrivers reads driver services from the SYSTEM hive, the .sys files in the collection, Amcache, and the System and CodeIntegrity event logs. Read offline, the hive is not filtered by the rootkit. For the 2014 generation it can show:

  • the Ultra3 kernel driver service in its list. Its ImagePath points into a $Ntuninstall…$ folder under %SYSTEMROOT%, which the checker treats as a Windows folder: it raises no path finding, so read the ImagePath column yourself;
  • the driver file at that path, if collected: "An unsigned kernel driver" when it carries no signature;
  • the old VBoxDrv.sys. LOLDrivers lists vboxdrv.sys as a vulnerable driver, so a file whose hash matches one of its samples raises "A known vulnerable driver (LOLDrivers): vboxdrv.sys". Whether VirtualBox belongs on the host is your call.

For the 2023 generation it sees much less. The driver is never a .sys file or a driver service: it sits encrypted inside comadmin.dat and is loaded by a user-mode service, and the module lists only driver services. WerFaultSvc, the queue file, the registry blob and the in-memory module are outside what the checker reads, so check those as described above. No module applies to the boot path: Snake does not touch the EFI system partition or the boot sectors.

Removal and recovery

  1. Do not clean in place. A kernel implant maintained for two decades, with keylogging, covert storage and a covert network channel, cannot be shown to be gone from a running system. Capture memory and image the disk, then rebuild the host from known-good media.
  2. Change credentials from a clean system, and do not reuse anything similar to the old passwords: the advisory notes that Snake includes keylogging.
  3. Scope the network, not one host. Snake works peer-to-peer and relays traffic through other infected machines. The Justice Department notes that Operation MEDUSA removed nothing else the operators had left, so look for the rest of the Turla toolset the advisory describes.
  4. Raise the bar for kernel loading on rebuilt hosts: current Windows, memory integrity (HVCI) and Microsoft's vulnerable driver blocklist, which target the vulnerable-driver technique Snake used in 2014. Hunting vulnerable and malicious drivers offline covers the checks; Demodex and POORTRY are other kernel tools that depend on getting a driver loaded. For persistence through driver services in general, see kernel drivers on Windows Persistence.

Sources

Primary public reports, newest first.

  1. 2023-05-09Hunting Russian Intelligence "Snake" Malware (AA23-129A)CISA
  2. 2023-05-09Justice Department Announces Court-Authorized Disruption of Snake Malware Network Controlled by Russia's Federal Security ServiceU.S. Department of Justice
  3. 2014-03-07Uroburos: Deeper travel into kernel protection mitigationG DATA
  4. 2014-02-28Uroburos: Highly complex espionage software with Russian rootsG DATA

See also

Related families