Detailed: How Russian government's Fancy Bear UEFI rootkit sneaks onto Windows PCs

ESET sheds new light on 'Lojax' firmware infection

ESET eggheads have shed more light on the Unified Extensible Firmware Interface (UEFI) rootkit being used by the Kremlin's Fancy Bear hacking crew.

Dubbed Lojax, the software nasty embeds itself within the motherboard firmware of infected Windows PCs, allowing it to run as soon as the machine is powered up or reset, allowing it to ideally spy on the user and evade detection by the operating system or any antivirus tools. The firmware executes at the lowest levels, underneath OS kernels and apps, with full system access.

While ESET blew the whistle on Lojax with a disclosure back in September, the nitty-gritty of how the malware operates was withheld until the annual Computer Chaos Club conference at the end of December, where researcher Frederic Vachon described in a presentation how the UEFI-based rootkit is able to hide in modern firmware. ESET was able to get its hands on a copy of Lojax when one of its customers' computers picked up the cyber-nasty.

In short, Lojax – a modified version of the legitimate Lojack anti-theft software – starts out as a poisoned application delivered via spear phishing emails that, when run by hoodwinked victims, unpacks and runs code that hijacks a vulnerable driver, which is loaded by the UEFI firmware during startup, to install the rootkit in flash memory.

UEFI has a mechanism called DXE that locates and runs device drivers needed to get a machine going, before the OS is booted. Lojax tampers with one of the loaded drivers so that it flips the switch on the firmware's write protection, disabling the safeguard and allowing the chips' contents to be overwritten. At that point, the malware can inject its rootkit into the firmware so that it is run following a subsequent power or reset cycle.


Resident evil: Inside a UEFI rootkit used to spy on govts, made by you-know-who (hi, Russia)


So, the driver is fiddled with so that it unlocks the firmware during next boot, then Lojax alters the flash chip contents to inject its rootkit, and then on next boot, the spyware is up and running. This is because the firmware is expected to maintain its own security.

"The chipset exposes write protection mechanisms that need to be properly protected by the firmware," he explained. "Because there is no such thing as BIOS write protection by default, it is the job of the firmware to do that."

In order to turn off the firmware's write protection, Lojax exploits a known race-condition in Intel's flash memory controllers by repeatedly enabling BIOS updates and attempting to write to flash memory before the motherboard software steps in and automatically disables updates.

Once that is done, Lojax is able to write the full rootkit on to the UEFI firmware, which ensures the malware is installed and run during the operating system startup, making it nearly impossible to remove by anything short of a complete reflash of the board's SPI memory.

Fortunately, Vachon notes, vendors themselves can protect against the attack by fixing and patching the driver vulnerabilities, and/or enabling Secure Boot. This will cause the Lojax malware to automatically abort installation attempts. Secure Boot cryptographically ensures the firmware contents isn't altered. Also, not opening emailed applications as a system administrator helps a lot: the rootkit installer requires sysadmin access. However, it could exploit privilege escalation holes to gain admin control, so the real solution is enabling Secure Boot in the BIOS settings and set a password or other lock to prevent any changes.

"The tool only works if the platform is misconfigured," he explained. "If firmware vendors would have done their job correctly here, this tool would have failed at flashing the firmware, it's a great example of how [important] firmware security is." ®

Similar topics

Other stories you might like

  • Emotet malware gang re-emerges with Chrome-based credit card heistware
    Crimeware groups are re-inventing themselves

    The criminals behind the Emotet botnet – which rose to fame as a banking trojan before evolving into spamming and malware delivery – are now using it to target credit card information stored in the Chrome web browser.

    Once the data – including the user's name, the card's numbers and expiration information – is exfiltrated, the malware will send it to command-and-control (C2) servers that are different than the one that the card stealer module uses, according to researchers with cybersecurity vendor Proofpoint's Threat Insight team.

    The new card information module is the latest illustration of Emotet's Lazarus-like return. It's been more than a year since Europol and law enforcement from countries including the United States, the UK and Ukraine tore down the Emotet actors' infrastructure in January 2021 and – they hoped – put the malware threat to rest.

    Continue reading
  • HelloXD ransomware bulked up with better encryption, nastier payload
    Russian-based group doubles the extortion by exfiltrating the corporate data before encrypting it.

    Windows and Linux systems are coming under attack by new variants of the HelloXD ransomware that includes stronger encryption, improved obfuscation and an additional payload that enables threat groups to modify compromised systems, exfiltrate files and execute commands.

    The new capabilities make the ransomware, first detected in November 2021 - and the developer behind it even more dangerous - according to researchers with Palo Alto Networks' Unit 42 threat intelligence group. Unit 42 said the HelloXD ransomware family is in its initial stages but it's working to track down the author.

    "While the ransomware functionality is nothing new, during our research, following the lines, we found out the ransomware is most likely developed by a threat actor named x4k," the researchers wrote in a blog post.

    Continue reading
  • Symbiote Linux malware spotted – and infections are 'very hard to detect'
    Performing live forensics on hijacked machine may not turn anything up, warn researchers

    Intezer security researcher Joakim Kennedy and the BlackBerry Threat Research and Intelligence Team have analyzed an unusual piece of Linux malware they say is unlike most seen before - it isn't a standalone executable file.

    Dubbed Symbiote, the badware instead hijacks the environment variable (LD_PRELOAD) the dynamic linker uses to load a shared object library and soon infects every single running process.

    The Intezer/BlackBerry team discovered Symbiote in November 2021, and said it appeared to have been written to target financial institutions in Latin America. Analysis of the Symbiote malware and its behavior suggest it may have been developed in Brazil. 

    Continue reading

Biting the hand that feeds IT © 1998–2022