Windows kernel rootkit
ZeroAccess (Sirefef) Rootkit: Traces and Checks
ZeroAccess, the click-fraud botnet rootkit: replaced Windows drivers, services.exe extended attributes, hidden folders, host checks and recovery steps.
- Kind
- Windows kernel rootkit · Kernel layer
- Platforms
- Windows
- First seen
- 2010
- Status
- Historical
- Also known as
- Sirefef, Max++, ZAccess
- Checked by
- Windows drivers
Overview
ZeroAccess, which Microsoft detects as Sirefef, is a Windows rootkit and peer-to-peer botnet run for profit. Microsoft describes its payloads as search hijacking, click fraud and Bitcoin mining, downloaded as components from other infected computers. Public technical analyses date from 2010, such as InfoSec Institute's series, when it was already a kernel-mode rootkit that created hidden volumes on disk; the name Max++ comes from a kernel device object named __max++> that early versions created.
Its history matters for an investigation, because the traces changed completely:
| Period | Design | Source |
|---|---|---|
| 2010 to early 2012 | Kernel-mode driver that replaces a randomly chosen Windows driver, with encrypted hidden storage | Microsoft, Bitdefender |
| From May 2012 | No kernel driver; shellcode in services.exe, payload in NTFS extended attributes, COM hijacking | Bitdefender (May 2012), ESET (June 2012) |
| Later variants | Files under fake Google Desktop folders, a service shown as gupdate, a Run key | Microsoft |
Microsoft lists distribution through exploits and pirated software ("keygens" and "cracks"); Bitdefender reported a fake Flash Player installer served from adult sites. On 5 December 2013, Microsoft's Digital Crimes Unit, Europol's EC3 and the FBI disrupted the botnet. Microsoft put it at more than 2 million infected computers and said it did not expect to eliminate it completely. Press reports describe the botnet coming back in 2014 and again in early 2015; reporting tails off after that, and the family is catalogued as historical. It is listed as a kernel rootkit for its early versions; the later ones are user-mode malware.
How it loads and hides
Kernel-mode versions. The dropper replaces a randomly selected system driver with a malicious copy. Microsoft's examples are afd.sys, i8042prt.sys, ipsec.sys, mrxsmb.sys, netbt.sys, raspppoe.sys and serial.sys, and it says the list is not complete. Because the original driver's service key is reused, nothing new appears among the services. The clean copy of the replaced driver and further components go into an encrypted folder that is a reparse point, %SystemRoot%\$NtUninstallKB<number>, with a random number. A disk-level hook returns the clean copy whenever the replaced driver is read, so a hash or signature check from the running system sees the original file. Microsoft also notes that it tries to stop and delete any process that accesses it.
User-mode versions. In May 2012 Bitdefender found droppers without the 32-bit rootkit component. In June 2012 ESET described the new installation: shellcode injected into services.exe (the Service Control Manager), then a new services.exe written to disk with the original file's times and attributes copied onto it. The malicious DLL is not inside the file: it is stored in an NTFS extended attribute, which ESET reports is named 731. Persistence moved to COM hijacking: Bitdefender describes replacing the InprocServer32 entry of a well-known class under HKLM\Software\Classes\CLSID.
Later variants and side effects, per Microsoft:
GoogleUpdate.exeand a file named@under%ProgramFiles%\Google\Desktop\Install\<GUID>\or%LOCALAPPDATA%\Google\Desktop\Install\<GUID>\, with three folders whose names are non-printable bytes, then another<GUID>folder;@and a file namednin another folder, for example underC:\recycler\;- a service whose name starts with the right-to-left override character and reads
etadpug, so it is displayed asgupdate; - the default value of
HKCU\Software\Microsoft\Windows\CurrentVersion\Runpointing to thatGoogleUpdate.exe; HKLM\Software\Classes\clsid\{5839fca9-774d-42a1-acda-d6a79037f57f}\InprocServer32changed from<system folder>\wbem\wbemess.dllto the path ofn;- a Winsock service provider file named
%windir%\assembly\GAC\desktop.inior%windir%\assembly\GAC_32\desktop.ini; - security services stopped and deleted, among them
BFE,iphlpsvc,WinDefend,MpsSvcandwscsvc, and Windows Firewall turned off.
Traces on disk
| Location | What | Generation |
|---|---|---|
A driver in C:\Windows\System32\drivers\ (e.g. afd.sys, i8042prt.sys, netbt.sys) | Replaced by a malicious copy; service key unchanged | Kernel-mode (Microsoft) |
%SystemRoot%\$NtUninstallKB<number> | Encrypted reparse-point folder with the clean driver and extra components | Kernel-mode (Microsoft) |
C:\Windows\System32\services.exe | Rewritten file with copied times; DLL in an extended attribute named 731 | User-mode, 2012 (ESET) |
HKLM\Software\Classes\CLSID\{...}\InprocServer32 | Default value hijacked; {5839fca9-774d-42a1-acda-d6a79037f57f} in Microsoft's description | User-mode (Bitdefender, Microsoft) |
...\Google\Desktop\Install\<GUID>\... | GoogleUpdate.exe and @ in folders with non-printable names | Later (Microsoft) |
HKCU\Software\Microsoft\Windows\CurrentVersion\Run (default value) | Points to that GoogleUpdate.exe | Later (Microsoft) |
HKLM\SYSTEM\CurrentControlSet\Services\ | Service displayed as gupdate with a right-to-left override in its name; security services missing | Later (Microsoft) |
%windir%\assembly\GAC\desktop.ini, GAC_32\desktop.ini | Winsock service provider file | Later (Microsoft) |
How to check a host
Kernel-mode generation. Work from an image or a collection read from outside the running system, since the disk hook hides the replaced driver. Compare every driver in System32\drivers with a known-good copy from the same Windows build and patch level, by hash. On a mounted image, catalog-based signature checks done on another machine are unreliable for a different build, so hashes against a clean reference are the firmer test. Look for reparse-point folders named $NtUninstallKB… in the Windows folder: with the image mounted as E:, dir /a:l E:\Windows lists reparse points.
User-mode generations. These hide less, and a live look is useful:
sfc /verifyonly
reg query "HKLM\Software\Classes\CLSID\{5839fca9-774d-42a1-acda-d6a79037f57f}\InprocServer32" /ve
reg query "HKCU\Software\Microsoft\Windows\CurrentVersion\Run" /ve
Get-CimInstance Win32_Service | Where-Object { $_.Name -match '\u202E' } | Select-Object Name, DisplayName, PathName
Get-Service BFE, iphlpsvc, WinDefend, MpsSvc, wscsvc
Get-ChildItem C:\Windows -Force -Attributes ReparsePoint
sfc /verifyonly checks protected system files, services.exe among them, without repairing anything. The CLSID query should return the wbemess.dll path under System32\wbem. A Get-Service error for a name in that list means the service is gone. Offline, the same keys are in the SOFTWARE, SYSTEM and NTUSER.DAT hives; an MFT parser that reports $EA attributes shows an extended attribute on services.exe, and the $FILE_NAME times may show when the file was rewritten, since only the standard times were copied. See COM hijacking, Run keys and the MFT for how to read these.
What the checker looks for
windrivers is the only module with something to read, and only for the kernel-mode generation. It lists driver services from the SYSTEM hive and reads every .sys file in the collection: PE header, Authenticode signature, hashes, compile time and imports. A replaced Windows driver keeps its service key, so the key itself looks normal. What can stand out is the file: a driver with no embedded signature raises "An unsigned kernel driver", and a signed driver whose bytes changed raises "The driver was changed after it was signed". The checker does not compare a driver's compile time, size or imports with those of its neighbours; it shows them in the detail sheet for you to compare. It checks only embedded signatures, and some drivers are signed through catalog files instead, so confirm an unsigned Windows driver against the host's catalogs. A collection taken through the infected running system may contain the clean copy the rootkit served.
The user-mode generations are outside the checker's scope: services.exe and its extended attributes, the COM hijack, the Run key, the gupdate service and the folders are persistence artefacts. ZeroAccess has no boot-sector, EFI or Linux component, so bootsector, esp, measuredboot and linuxkernel have nothing to show.
Removal and recovery
- Microsoft's guidance is to scan with Microsoft Defender Antivirus, the Safety Scanner or the Malicious Software Removal Tool, and notes that cleaning may reset
BFE,Iphlpsvc,MsMpSvc,SharedAccess,WinDefendandwscsvcto their defaults. Reapply your own settings and turn the firewall back on. - For the kernel-mode generation, a scan from the running system works against a rootkit that serves clean copies of what it changed. Scan offline, from a rescue medium, and restore the replaced driver from known-good media.
- ZeroAccess downloaded arbitrary components from its peers, so its payload at any given time is unknown. Prefer a rebuild to cleaning in place, and rotate the credentials used on the host.
- Restore the security services and firewall that it stopped or deleted, and check that Windows Update works.
For other old Windows rootkits that hid in the boot path rather than in drivers, see TDL4; for a user-mode rootkit that hides through hooking, see r77.
Sources
Primary public reports, newest first.
- 2013-12-05Microsoft, the FBI, Europol and industry partners disrupt the notorious ZeroAccess botnetMicrosoft
- 2012-06-25ZeroAccess: code injection chroniclesESET
- 2012-05-18No More Rootkit in ZeroAccess?Bitdefender
- 2012-04-12Win32/Sirefef threat descriptionMicrosoft
See also
Related families
- TDL4 (TDSS / Alureon)MBR bootkit
- SnakeWindows kernel rootkit
- r77 rootkitWindows user-mode rootkit