Skip to main content
Live Webinar with SANS (June 25)— Agentic CTI Automation for Fun & ProfitRegister Free
Mallory
Malware

ESPecter

ESPecter is a real-world UEFI bootkit publicly analyzed by ESET in 2021. It persists on the EFI System Partition by patching the legitimate Windows Boot Manager, including bootmgfw.efi and the fallback bootloader bootx64.efi, and supports Windows 7 through Windows 10. Its UEFI persistence requires Secure Boot to be disabled or otherwise bypassed; ESET stated it was unknown how operators achieved this on affected systems, though possible scenarios included physical access, pre-disabled Secure Boot, or exploitation of UEFI firmware vulnerabilities. ESET also noted Lenovo firmware vulnerabilities (CVE-2021-3970, CVE-2021-3971, CVE-2021-3972) could facilitate deployment of SPI flash or ESP implants such as ESPecter.

ESPecter executes early in the boot chain by modifying Windows Boot Manager in memory. It patches BmFwVerifySelfIntegrity to force signature verification success, detours Archpx64TransferTo64BitApplicationAsm to modify the OS loader, reallocates its code using BlImgAllocateImageBuffer or BlMmAllocateVirtualPages so it survives UEFI application unload, and inserts a detour to OslArchTransferToKernel to patch the Windows kernel before execution. It bypasses Windows Driver Signature Enforcement by patching SepInitializeCodeIntegrity in memory, allowing it to load an unsigned kernel driver; it also patches MiComputeDriverProtection, although ESET could not determine that patch’s purpose.

The malware was assessed as primarily used for espionage. ESET observed it with user-mode components associated with keylogging and document theft. The kernel driver is dropped as \SystemRoot\System32\null.sys in the UEFI variant and creates the device \Device\WebBK. It supports IOCTL 0x22C004 to register an APC routine for processing intercepted keystrokes and captures keystrokes by setting a CompletionRoutine for IRP_MJ_READ requests on \Device\KeyboardClass0. The driver injects WinSys.dll into svchost.exe and Client.dll into winlogon.exe. WinSys.dll communicates with C2 over HTTPS using requests such as /Heart.aspx, /GetSysteminfo.aspx, /UpLoad.aspx, and /ModifyIpaddr.aspx. Client.dll communicates over custom TCP using single-byte XOR encryption; the analyzed campaign used XOR key 0x66. Client.dll supports command execution, power actions, screenshots, filesystem operations, data upload, service and process operations, configuration changes, and keylogger control, and it performs automatic exfiltration including document theft, keylogging, and periodic screenshots.

ESPecter stores an encrypted configuration as \SystemRoot\Temp\syslog in the UEFI variant, using a one-byte XOR key with Base64 encoding/decoding in WinSys.dll. ESET traced the malware’s roots to at least 2012. Earlier legacy BIOS versions persisted by modifying the MBR, hooking BIOS INT13h disk services, intercepting loading of bootmgr, storing encrypted configuration in hidden disk sector 5, and dropping drivers as \SystemRoot\System32\drivers\beep.sys on x86 or \SystemRoot\System32\drivers\null.sys on x64.

Attribution remains unconfirmed. ESET could not attribute ESPecter to a known threat actor, though Chinese debug messages in a client component suggested, with low confidence, a Chinese-speaking operator. ESET detections include EFI/Rootkit.ESPecter, Win32/Rootkit.ESPecter, and Win64/Rootkit.ESPecter. Reported infrastructure and indicators included C2 IPs 196.1.2[.]111, 103.212.69[.]175, 183.90.187[.]65, and 61.178.79[.]69; domains swj02.gicp[.]net, server.microsoftassistant[.]com, yspark.justdied[.]com, and crystalnba[.]com; and compromised Windows Boot Manager sample hashes 27AD0A8A88EAB01E2B48BA19D2AAABF360ECE5B8 and 8AB33E432C8BEE54AE759DFB5346D21387F26902.

Share:
For your environment

Hunt this family in your stack

Mallory pivots from this family to the IOCs, detections, and named campaigns that touch your stack, and pages you when something new lands.

MITRE ATT&CK

Techniques & procedures

35 distinct techniques documented for this family, organized by ATT&CK tactic.

Execution

1 technique
T1106Native APIEvidence1

“ESPecter leverages several Windows APIs: VirtualAlloc, WriteProcessMemory, and CreateRemoteThread for process injection.”

Persistence

4 techniques
T1112Modify RegistryEvidence1

“DefaultConfig value in HKLM\SYSTEM\CurrentControlSet\Control registry… can be used… to store configuration.”

T1542.001System FirmwareEvidence2

Secure Boot is designed to thwart UEFI bootkits, a form of malware that alters the Unified Extensible Firmware Interface, the successor to the BIOS, both of which begin the initial boot sequence. Because these bootkits load before the OS and most other code, they can be difficult to detect.

T1542.003BootkitEvidence1

“ESET researchers have analyzed a previously undocumented, real-world UEFI bootkit that persists on the EFI System Partition (ESP)… Today, we describe our recent discovery of ESPecter… a UEFI bootkit persisting on the ESP in the form of a patched Windows Boot Manager…”

T1547Boot or Logon Autostart ExecutionEvidence1

“ESPecter replaces the legitimate null.sys or beep.sys driver with its own malicious one in order to be executed on system startup.”

Privilege Escalation

2 techniques
T1055.001Dynamic-link Library InjectionEvidence1

“Execution of both WinSys.dll and Client.dll libraries is achieved by injecting them into svchost.exe and winlogon.exe… NotifyRoutine hooks the entry point… responsible for loading and executing the appropriate payload DLL.”

T1547Boot or Logon Autostart ExecutionEvidence1

“ESPecter replaces the legitimate null.sys or beep.sys driver with its own malicious one in order to be executed on system startup.”

Stealth

9 techniques
T1027.002Software PackingEvidence1

“WinSys.dll is an MPRESS-packed DLL embedded in the driver’s binary in an encrypted form.”

T1036.003Rename Legitimate UtilitiesEvidence1

“installers… copy cmd.exe to con1866.exe to evade detection.”

T1055.001Dynamic-link Library InjectionEvidence1

“Execution of both WinSys.dll and Client.dll libraries is achieved by injecting them into svchost.exe and winlogon.exe… NotifyRoutine hooks the entry point… responsible for loading and executing the appropriate payload DLL.”

T1140Deobfuscate/Decode Files or InformationEvidence1

“ESPecter uses single-byte XOR with subtraction to decrypt user-mode payloads… configuration… one-byte XOR key… Base64 decodes… XORs…”

T1497.003Time Based ChecksEvidence1

“can be configured to postpone C&C communication after execution or to communicate… only in a specified time range.”

T1542.001System FirmwareEvidence2

Secure Boot is designed to thwart UEFI bootkits, a form of malware that alters the Unified Extensible Firmware Interface, the successor to the BIOS, both of which begin the initial boot sequence. Because these bootkits load before the OS and most other code, they can be difficult to detect.

T1542.003BootkitEvidence1

“ESET researchers have analyzed a previously undocumented, real-world UEFI bootkit that persists on the EFI System Partition (ESP)… Today, we describe our recent discovery of ESPecter… a UEFI bootkit persisting on the ESP in the form of a patched Windows Boot Manager…”

T1564.001Hidden Files and DirectoriesEvidence1

“Client.dll component creates hidden directories to store collected data.”

T1564.005Hidden File SystemEvidence1

“Legacy Boot versions use unallocated disk space located right after the MBR to store its code, configuration and malicious driver… configuration… stays hidden in sector 5 of the compromised disk.”

Defense Impairment

3 techniques
T1112Modify RegistryEvidence1

“DefaultConfig value in HKLM\SYSTEM\CurrentControlSet\Control registry… can be used… to store configuration.”

T1553.006Code Signing Policy ModificationEvidence1

“ESPecter patches Windows kernel function SepInitializeCodeIntegrity directly in memory to disable Driver Signature Enforcement (DSE).”

T1601.001Patch System ImageEvidence1

“it looks for byte patterns identifying the desired functions in memory and patches them accordingly… patching the BmFwVerifySelfIntegrity function… patches… OslArchTransferToKernel… disabling DSE by patching the SepInitializeCodeIntegrity kernel function.”

Credential Access

1 technique
T1056.001KeyloggingEvidence1

“Interception of keystrokes is done by setting up CompletionRoutine for IRP_MJ_READ requests for the keyboard driver object \Device\KeyboardClass0… Client… register its logging function by sending IOCTL 0x22C004.”

Discovery

8 techniques
T1010Application Window DiscoveryEvidence1

“reports foreground window names along with keylogger information to provide application context.”

T1012Query RegistryEvidence1

“check for installed software under… HKLM\Software\Microsoft\Windows\CurrentVersion\Uninstall.”

T1057Process DiscoveryEvidence1

“Client.dll component can list running processes and their loaded modules.”

T1082System Information DiscoveryEvidence1

“Upload various system info (CPU name, OS version, memory size, ethernet MAC address, list of installed software, etc.).”

T1083File and Directory DiscoveryEvidence1

“Client.dll component can list file information for specific directories.”

T1120Peripheral Device DiscoveryEvidence1

“detects the insertion of new devices by listening for the WM_DEVICECHANGE window message.”

T1124System Time DiscoveryEvidence1

“WinSys.dll component can use GetLocalTime for time discovery.”

T1497.003Time Based ChecksEvidence1

“can be configured to postpone C&C communication after execution or to communicate… only in a specified time range.”

Collection

5 techniques
T1025Data from Removable MediaEvidence1

“can collect files with specified extension from removable drives.”

T1056.001KeyloggingEvidence1

“Interception of keystrokes is done by setting up CompletionRoutine for IRP_MJ_READ requests for the keyboard driver object \Device\KeyboardClass0… Client… register its logging function by sending IOCTL 0x22C004.”

T1074.001Local Data StagingEvidence1

“collected data is stored in a hidden directory, with separate subdirectories for each data source.”

T1113Screen CaptureEvidence1

“monitoring of the victim’s screen by periodically taking screenshots.”

T1119Automated CollectionEvidence1

“automatic data exfiltration capabilities including document stealing, keylogging, and… screenshots… stored in a hidden directory.”

Command and Control

5 techniques
T1071.001Web ProtocolsEvidence1

“WinSys.dll communicates with its C&C using HTTPS… https://<ip>/Heart.aspx?…”

T1095Non-Application Layer ProtocolEvidence1

“For communication with the C&C, it uses the TCP protocol…”

T1104Multi-Stage ChannelsEvidence1

“user-mode components use separate C&C channels.”

T1105Ingress Tool TransferEvidence1

“download and run additional malware… WinSys… Download or download and execute file… Client… ability to download and execute additional payloads.”

T1573.001Symmetric CryptographyEvidence1

“uses the TCP protocol with single-byte XOR encryption… key… 0x66… watermark/tag… WBKP…”

Exfiltration

3 techniques
T1020Automated ExfiltrationEvidence1

“creates a thread to automatically upload collected data to the C&C.”

T1029Scheduled TransferEvidence1

“set to upload collected data to the C&C every five seconds.”

T1041Exfiltration Over C2 ChannelEvidence1

“exfiltrates data over the same channel used for C&C.”

Other

1 technique
T1562Impair DefensesEvidence1

“This allows ESPecter to bypass Windows Driver Signature Enforcement (DSE) in order to execute its own unsigned driver at system startup… disabling DSE by patching the SepInitializeCodeIntegrity kernel function.”

What this page doesn’t show

The version that knows your environment.

This page is what’s public. Mallory adds the parts that aren’t: which of your assets match these IOCs, which detections are missing, which campaigns to expect next, and what to do in the next 30 minutes.
IOC matching

Match every observed IP, domain, and hash against your live telemetry.

Threat actor attribution

Named campaigns wielding this family, with evidence pinned to each claim.

Exploited vulnerabilities

CVEs this family uses for access and lateral movement.

Detection signatures

YARA, Sigma, Snort, and vendor rules, auto-deployed to your SIEM.

MITRE ATT&CK mapping35

Every documented technique, ranked by evidence weight.

Researcher chatter

Reddit, Mastodon, and CTI community discussion around this family.