Prior Work

Publications by Dark Mentor partners, from before they joined Dark Mentor.

BIOS Necromancy: Utilizing “Dead Code” for BIOS Attacks

During our work towards trying to help secure firmware, we have begun to discover a trend. There are situations where unused “dead code” can creep into firmware codebases. This can lead to situations where the developers correctly believe that they are not intentionally using the code in question. However, if that code has vulnerabilities that are still attacker-invokable, it leads to a situation where the vendor has increased attack surface. Apple’s vulnerability to CERT VU#552286, which we determined by black box binary analysis, is an example of this. But we have also seen examples of this in private engagements that we cannot speak to publicly. This document is meant to serve as a warning to BIOS developers that they need to check very carefully that no known-vulnerable code somehow ends up on their flash chip, when they dismiss a vulnerability as “not applicable” to their codebase. They could be wrong, and without careful scrutiny, low level vulnerabilities like this can and will fester for years.

(Note: This talk is an updated version of Thunderstrike 2: Sith Strike, with the new vulnerability VU#552286 added, and the new whitepaper about that vulnerability linked herein.)

Thunderstrike 2: Sith Strike

In this work we teamed up with Trammell Hudson to improve upon his previous Thunderstrike proof of concept. Previously it required physical access to rewrite the flash chip. We suspected that Macs were vulnerable to the same remotely-exploitable vulnerabilities we had shown in the past. And indeed, they were vulnerable to 5/6 issues we had seen previously. This helps show that just because you don’t hear about a vulnerability affecting a particular vendor, doesn’t mean they’re not affected.

To show the consequences of these vulnerabilities, Thunderstrike 2 uses CERT VU#976132 (Darth Venamis) to break into the BIOS from an Apple Thunderbolt Ethernet adapter. Once resident in the BIOS, it infects all new ethernet adapters that it comes in contact with. As such it represents a novel type of “firmworm” that only ever lives in firmware. Because it does not touch the OS or filesystem it will not be detected by traditional security products or forensics professionals.

How Many Million BIOSes Would you Like to Infect?

Because people don’t ever patch their BIOSes, it is extremely likely that the vast majority of systems in the wild are vulnerable to at least one known exploit. We made public the details of the new SMM “Incursion” vulnerabilities (CERT VU# 631788, reported Oct 29th), that can be found automatically from SMM dumps. We showed the “LightEater” SMM implant stealing GPG keys/passwords/decrypted messages from Tails on an MSI system. We also showed how an unskilled attacker can infect a BIOS with an off-the-shelf Dediprog programmer, by just pressing the start button. This was done against an HP system, from which LightEater subsequently used Intel Serial-Over-LAN to exfiltrate data over the network in a NIC-agnostic way. We also showed infecting an Asus system, with LightEater installing kernel-mode rootkit style hooks into Windows 10 preview, to get notified every time a process loads. We then provided data analysis evidence that indicated that UEFI systems are mostly homogeneous as far as an attacker is concerned, and consequently thousands of BIOSes could easily be hooked for the insertion of implants in an automated fashion.

Analyzing UEFI BIOS from Attacker and Defender Viewpoints

In 2013, MITRE released Copernicus 1, a best-effort system to capture a raw dump of the BIOS and whether it appears to be possible for an attacker to write to it. In 2014, we released Copernicus 2 to combat the ability of an attacker to subvert not just Copernicus 1, but all other BIOS capture systems. While these free tools are a good way to get a copy of your BIOS, analyzing it to detect malicious changes is still an open problem in need of further investigation before defenders can feel confident that they have un-infected BIOS. You can’t just compare the MD5s from two BIOS dumps and get a valid comparison. This is a problem that leads to firmware-level malware going under-reported and under-analyzed due to not enough people with the background to jump into this area.

In this presentation, we will assume that you have a suspected badBIOS dumped by Copernicus that you’d like to determine the integrity and authenticity of. We will perform a breadth-first discussion of the topics such as port IO, memory-mapped IO, PCI, SMM, UEFI, and others that you need to become more familiar with in order to effectively analyze modern BIOSes. We will especially focus on how UEFI’s removal of security through obscurity is a double edged sword which helps both attackers and defenders analyze BIOSes for attacks or integrity checks. This talk will serve as a gateway for people with existing reverse engineering knowledge to start analyzing modern PC firmware.

BIOS Chronomancy: Fixing the Core Root of Trust for Measurement

(The first appearance at NoSuchCon in May 2013 did not include a discussion of VU#912156, but subsequent talks did.) Discussed how the S-CRTM is supposed to provide trustworthy reporting to detect the presence of BIOS level attackers. First showed a way that an attacker could exploit their way into a BIOS, even if all security mechanisms were properly configured (VU#912156). Then showed “The Tick”, which is BIOS-resident malware that subverts the S-CRTM by lying to the TPM to replay or recalculate a clean measurement. Then showed “The Flea”, which was BIOS malware that could survive attempts to remove it through a reflash, by infecting the new BIOS as it is about to be written. To defense against such attacks, and build a stronger S-CRTM, we used our existing work on Timing-Based Attestation to create “BIOS Chronomancy”. This defensive technique allows for the customization of the BIOS to provide timing side-channel tamper-evidence to allow for the detection of BIOS malware. Also released “Copernicus”, a free Windows tool for inspecting the BIOS vulnerability/integrity state. This talk was effectively 3 talks crammed into one, so that we could guarantee we would get into BlackHat. ;)

No More Hooks: Trustworthy Detection of Code Integrity Attacks

Making the “New Results for Timing-Based Attestation” paper content accessible to a Defcon audience.