Blog

Living Off the Land - Secure Boot Style

Why Build Something When It’s Already There?

Attackers have been observed “living off the land,” that is, using tools that already exist on the system, to accomplish their goals for quite some time (dating back to attacks against UNIX systems using built-in shells such as “sh”). Rather than build specific tools, it is rather convenient for attackers to use the tools that already exist to avoid detection. After all, built-in utilities are supposed to be there and be executed on the system by design. Powershell, for example, is a powerful Windows scripting language that is beneficial to systems administrators but is also heavily used by attackers.

Modern computing architectures implement controls to define how select processes are trusted. For example, drivers are an integral part of the operating system, and Windows has facilities to moderate trust for a driver. However, attackers abuse this system of trust by discovering already trusted drivers and using their functionality to carry out attacks, earning the label LOLDrivers (Living off the Land Drivers).

UEFI Secure Boot implements a similar root of trust, allowing us to validate software used in the boot process and early-stage operating system loading. We’ve published many details on how Secure Boot works and can be bypassed, primarily how attackers can bypass the root of trust to execute code. While several techniques exist for bypassing Secure Boot, one such vector is living off the land: finding already trusted code and using it to attack the system similarly to using a LOLDriver.

In this case, attackers do not have to find 0-day vulnerabilities or write exploits; they just have to find something already signed with the correct set of capabilities. The Eclypsium research team was able to uncover this, and this time, it was included in an Intel ME/CSMEd (Management Engine) update.

The Discovery

Eclypsium research discovered that the Dell Edge Gateway 5200 ME update package contained the following:

  • A UEFI Shell utility (signed with the key labeled “Dell secure boot db key 2022”). A UEFI shell is a command-line interface that provides access to the UEFI environment, allowing users to perform tasks such as viewing system information, manipulating files, and configuring boot options
  • A UEFI program called “FwUpdLcl” (also signed with the key labeled  “Dell secure boot db key 2022”). This utility lets the user write to the SPI flash when secure boot is enabled.

Attack Scenarios

Similar to Black Lotus where an attacker can bring their own bootloader, the same concept applies here. If the attacker brings the UEFI shell included in the Edge Gateway 5200 ME update, it will pass Secure Boot checks on systems that have included the “Dell secure boot db key 2022”. This would allow an attacker to modify UEFI before the operating system starts, including executing unsigned code and/or disabling Secure Boot altogether (For example, you could use this example to disable Secure Boot from a UEFI shell). An attacker would likely use this functionality to disable operating system controls (such as disabling kernel-level protections like Driver Signature Enforcement (DSE) and bypass or disable other OS-level and EDR security defenses). 

Attackers with access to a signed copy of the “FwUpdLcl” could gain even higher privileges on the system by manipulating Intel ME/CSME firmware. For example, an attacker could downgrade the Intel Management Engine (ME) firmware to a vulnerable version and/or install malicious firmware that persists across OS reinstalls or disk replacements.

Note: The “FwUpdLcl” program is generally unavailable to the public. However, some online communities have discovered its usefulness for updating Intel ME/CSME on non-Windows systems.

In summary, attackers armed with a UEFI shell and/or a signed “FwUpdLcl” utility have a powerful mechanism for manipulating the system at its most fundamental level, potentially compromising the entire security model of the affected device.

Affected platforms

According to Dell, the key labeled “Dell secure boot db key 2022” is only present on the Dell Edge Gateway 3200, versions before 15.40.30.2879, and Edge Gateway 5200, versions before 12.0.94.2380. We are unaware of any other platforms that currently use the key mentioned above.

Mitigation

CVE-2024-38296 was issued to address this issue and Dell has published an advisory (DSA-2024-345: Security Update for Dell Networking Edge Gateway 5200 Vulnerability) containing information related to the vulnerability and workarounds/mitigations.

Supply Chain and Below The Surface Defenses

When acquiring technology, we cannot blindly trust that the system will be delivered securely to our doorstep. We must validate the security of our devices down to the component level, including validating the UEFI platform security and integrity. Monitoring our systems for vulnerabilities in components such as UEFI and Secure Boot will allow us to better defend against threats attacking systems before loading the operating system. This vulnerability is just one example of weaknesses in the underlying attack surface that deserve attention by defenders to protect against successful attacks, providing both stealth and persistence.