Hex dump of Gibe-F worm.

Hardware and Firmware Exploits and Bugs

Attacking the Platform

These are attacks on computer systems and networks based on exploiting hardware design or manufacturing bugs, or "not playing by the rules" in dealing with the hardware. The idea of violating the "rules" by freezing the semiconductors or overwriting Ethernet firmware data seems analogous to the very common software vulnerabilities caused by not fully validating user input. Well, maybe not just analogous, maybe we should consider frigid liquids or Firewire signals or Ethernet signals as user-supplied input just like packet contents or form data submitted to web servers.

What makes these different is that we don't generally have control of the hardware design and manufacturing. Yes, you could choose to buy an Ethernet card or CPU or motherboard from a different manufacturer, but you have to choose from what the existing market.

Furthermore, while there are some interesting open-source hardware projects, they are the exception and do not generally provide the features and performance needed. Enthusiasts must not forget that the features required by corporations and government agencies include a well-known and trusted hardware manufacturer.

Hardware / Firmware Exploits

Reverse Engineering Firmware with Radare

Radare is a portable reverse-engineering framework and tool set that runs on Linux, OSX, ANdroid, Windows, Solaris, and Haiku.

See this presentation for details on using the radare2 reverse engineering framework and toolset. This can take advantage of CPU microcode, Intel and AMD controller chipsets, PCIe chips, Intel Ethernet controllers, magnetic and solid-state disk controllers, controllers in mice and keyboards and touchpads, controllers in webcams, PCI/PCIe option ROMs,

Modify the main board firmware (BIOS, UEFI):

There was concern back in 2006 about an ACPI/BIOS based attack.

"Researcher Demonstrates Hardware Backdoor", software collection Rakshasa can reflash firmware, Dark Reading July 2012.

Researcher creates proof-of-concept malware that infects BIOS, network cards, also on Rakshasa.

"New Malware Can Bypass BIOS Security", can fool a host's Trusted Platform Module into thinking that the BIOS firmware is clean when it isn't, Dark Reading May 2013.

"Research Into BIOS Attacks Underscores Their Danger", Dark Reading Nov 2013.

Does Computrace / Absolute Track / LoJack deserve the title of rootkit or backdoor?

Hacking the Extensible Firmware Interface (UEFI) Thunderstrike: EFI bootkits for Apple MacBooks Attacks on UEFI security Speed Racer: Exploiting an Intel Flash Protection Race Condition Attacking UEFI Boot Script Attacking UEFI Boot Script Table Vulnerability How your Mac firmware security is completely broken

Modify or Replace the Volume Boot Record:

FireEye identified malware modifying the Volume Boot Record, hijacking the system boot process. FireEye calls the group "FIN1", which they speculate is located in Russia or at least the group largely speaks Russian. FireEye calls the specific software "BOOTRASH", it's part of an overall system that its developers call "Nemesis." FIN1 is targeting payment card data for financial gain. ArsTechnica also covered the story with comparisons to other so-called bootkits.

Update Intel and AMD Processor Microcode:

Ben Hawkes' Notes on Intel Microcode Updates discusses how updateable CPU microcode exists to work around hardware and firmware bugs. There is speculation that malicious changes might be able to move sensitive data to a known location, but Hawkes' work shows there are RSA digital signatures, using SHA-1 on older processor models and SHA-2-256 in newer processors.

Modify USB firmware:

The firmware is proprietary so we have no "known good" for comparison. Plus, as the U.S. Government has demonstrated, they have no interest in closing this particular security hole.

BadUSB is an attack on the firmware controllers in typical USB devices. Malware on the system can subvert an attached USB device, and a hostile USB device can attack a system into which it is plugged.

Practical BadUSB attack software is available.

Modify RAM contents while running:

The Rowhammer vulnerability in DRAM devices is based on repeatedly accessing a row in high-density DRAM devices and flipping bits in adjacent rows. A Google team has demonstrated and documented using this to gain kernel privileges.

In July 2015 a group of Austrian and French researchers demonstrated a JavaScript attack, Rowhammer.js, meaning that an attacker only had to insert hostile JavaScript code into a page and wait for someone on a vulnerable platform to view that page with a browser.

The good news is that it's a much larger challenge to flip the bits in a constructive way that provides access for the attacker.

Turn off the NX bit while running:

The NX bit, also called the XD bit, is used by CPUs to enforce memory segregation into instructions versus data. Intel calls it XD for eXecute Disable, AMD calls it Enhanced Virus Protection, and ARM processors call it XN for eXecute Never. This feature is enabled as a BIOS setting, and so it would appear to be down in the hardware where it might appear that neither applications nor the operating system can reach it. But... The NX bit is simply a hardware feature that may or may not be available. Even if available, the operating system may not use it.

For example, in Windows, Data Execution Prevention or DEP is Microsoft's name for support of this technology in the operating system. This page explains how to turn it on for specific programs or for all programs.

See the Wikipedia page on the NX bit for detailed descriptions of the technology and its support on various combinations of operating systems and processors.

Modify the TPM (Trusted Platform Module) chip:

In February, 2010, Christopher Tarnovsky announced a successful hardware exploit of an Infineon TPM chip.

Background: What is TPM?
Short overview at hackaday.com
Associated Press story
More technical article at Dark Reading, with links to more detail

Modify the processing hardware:

University of Illinois researchers exploited a system by modifying its processing hardware. With Linux running on a programmable LEON processor, based on Sun's Sparc design, they changed 1,341 of the over 1 million logic gates. A carefully crafted network packet injected the malicious firmware, and the attacker could then login as a legitimate user. Note that this would require a processor programmed with an OS with malicious hooks — this seems far-fetched but US DOD warned of this very attack in February 2005 because a shift toward overseas integrated circuit manufacturing could present a security problem. This was reported at the Usenix Workshop on Large-Scale Exploits and Emergent Threats in April 2008, and described in this IDG News article.

"Stealthy Dopant-Level Hardward Trojans", a paper discussing how to tamper with logic gates by changing the doping of one transistor. This sabotage would be undetectable by optical inspection or functional testing.

Freeze the memory:

Princeton researchers reported cold boot attacks — literally cold boot. The problem — sensitive information such as passwords used for file system encryption and some file contents themselves may remain in RAM for surprising amounts of time, especially if the RAM is chilled. See the original report from Princeton and discussion and news coverage:
Original report from Princeton New York Times 22 Feb 2008 Bruce Schneier's blog Wired magazine, February 2008

Break in through the Firewire port:

Winlockpwn is a tool where the attacker connects a Linux machine to the Firewire port. The attacker gets full read-write access to memory and the tool deactivates Window's password protection residing in local memory. Steal passwords, drop malware on the system, and so on. Similar hacks have been demonstrated against Linux and MacOS X. See the Dark Reading story

Break in through the network interface hardware:

There's been some work on attacking the firmware on network interface cards, some of which focuses on permanently damaging the card. But more interesting work looks at attacking the NICs on a firewall so they do PCI-to-PCI data transfers, moving information down at a hardware level where firewalls don't look. There is speculation this might allow reading the disk device through its PCI-based controller. See this discussion, referencing an excerpt from the Robust Open Source mailing list.

Kristian Kielhofner's Packets of Death describes how problems with Intel's 82574L Ethernet controller has vulnerabilities: "death packets" containing the correct pattern can shut down an interface. It turns it off — the link lights on the card and the switch go out and only a power cycle can turn it back on. The "kill code" data parttern can be in the application layer payload, so a hostile HTTP server could put the pattern in an HTTP 200 response and shut down client machines behind a firewall.

The network interface may have its own processor powerful enough to run an SSH server. See these examples:
What if you can't trust your network card? (paper) Can you still trust your network card? (presentation) CVE-2010-0104 Network Interface Card SSH Rootkit Project Maux Mk.II Closer to Metal: Reverse engineering the Broadcom NetExtreme's firmware

Exploit the disk controllers:

Storage devices, both rotating magnetic disk and solid-state drives, have their own controllers. That is, the SATA or SCSI or whatever interface has its own processor with firmware, but the storage device itself also has one. The SATA/SCSI/etc interface is on the motherboard or an expansion card, the drive controller is inside the small box containing the drive. Most of these are ARM and MIPS controllers. Some of the firmware is stored in an embedded flash chip, the rest is on hidden sectors of the disk.
Seagate: Exploring the impact of a hard drive backdoor Western Digital: Hard disk hacking

Exploit the SD/MMC memory cards:

They include 8051 and H8 processors.
The Exploration and Exploitation of an SD Memory Card (video) The Exploration and Exploitation of an SD Memory Card (slides)

Exploit the processor and firmware in the mouse and keyboard:

Logitech G600 mouse has an AVR architecture ATmega32u2 processor:
Mouse Trap: Exploiting Firmware Updates in USB Peripherals (paper and slides) Mouse Trap: Exploiting Firmware Updates in USB Peripherals (paper)

KBT Poker II keyboard has a Nuvoton NUC122SC1AN ARM Cortex-M0 CPU with reflashable firmware:
Manufacturer's announcement of firmware release Finding the executable code in the firmware Firmware, at GitHub

Ectool is a small utility that dumps the flash RAM of a laptop's Embedded/Environmental Controller or EC, typically an 8-bit or 16-bit processor.
Table of EC details, links to much more

Synaptics TouchPads use an AVR or PIC architecture.
Synaptics TouchPad Interfacing Guide Synaptics RM13 Interfacing Guide Synaptics RM14 Specification Synaptics PS/2 TouchPad Interfacing Guide

Exploit the webcam:

Reverse engineer and modify the firmware run by the processor in the webcam

Modify Intel AMT firmware:

Intel Active Management Technology or AMT is part of the Intel Management Engine, built into systems with Intel vPro technology. It's intended for remote out-of-band management.
Video explaining the exploit:
Persistent, Stealthy, Remote-controlled Dedicated Hardware Malware

Igor Skochinsky's presentation:
Intel ME Secrets: Hidden code in your chipset and how to discover what exactly it does

Come in through the back door provided by IPMI:

The IPMI or Intelligent Platform Management Interface protocol provides remote management for servers. The technology is called out-of-band management and there are several brand names including:

An embedded server called the BMC or Baseboard Management Controller is installed on server motherboards. The BMC typically runs Linux on its own small CPU with memory and storage, and runs independently of the operating system or hypervisor you think of as being installed directly on the system. IPMI and the BMC provide networked access to the hardware even when the system is powered down.

Papers and tools on IPMI security problems Bruce Schneier: "The Eavesdropping System in Your Computer" Internet Storm Center /SANS report: "IPMI: Hacking servers that are turned 'off'" Ars Technica: "'Bloodsucking leech' puts 100,000 servers at risk of potent attacks" USENIX report: "Illuminating the Security Issues Surrounding Lights-Out Server Management" Rapid7: "A Penetration Tester's Guide to IPMI and BMCs"

There are several by Dan Farmer:
IPMI security IPMI++ security best practices "Sold Down the River" on the state of IPMI vulnerability exposures "IPMI: Freight Train to Hell" on flaws in IPMI and BMC

Exploit PCI / PCIe Option ROMs

PCI / PCIe expansion cards can have their own firmware, and it might be exploited:
BIOS Disassembly Ninjutsu Uncovered
Building a "Kernel" in PCI Expansion ROM
Option ROMs: A Hidden (But Privileged) World

NSA ANT Attacks on Hardware

Der Spiegel image of NSA ANT catalog page describing the COTTONMOUTH USB surveillance device.

An article in Der Spiegel describes a 50-page internal "product catalog" from an NSA division called ANT, listing hardware and software (called "implants" in NSA terminology) which can penetrate systems to monitor, modify, and extract information. These include modified cables allowing "TAO personnel to see what is displayed on the targeted monitor", USB plugs and cables that covertly communicate over radio links (see the COTTONMOUTH device at right), replacement USB and Ethernet ports with covert data capture and communications built in, replacement chips and daughter cards to exploit the motherboard BIOS and using System Management Mode to reload itself at every boot, up to active GSM base stations that mimic legitimate mobile phone towers and therefore monitor and even control nearby mobile phones. ANT also attacks the firmware in disk drives manufactured by Western Digital, Seagate, Maxtor, and Samsung, and modifies hardware and/or firmware in Cisco, Juniper, and Huawei routers and firewalls. Cryptome has the full NSA ANT catalog available for download. A Wired article also discusses the catalog.

The router and firewall backdoors work by subverting the hardware's boot ROM, re-installing themselves every time the system starts and running below the operating system itself.

HEADWATER is a persistent backdoor software implant for selected Huawei routers. SCHOOLMONTANA, SIERRAMONTANA, and STUCCOMONTANA are persistent backdoor software implants for all modern versions of JUNOS, a version of FreeBSD customized by Juniper. They are for J-Series, M-Series, and T-Series routers, respectively.

FEEDTROUGH is a persistence technique for two software implants, BANANAGLEE and ZESTYLEAK, used against Juniper Netscreen firewalls. GOURMETTROUGH and SOUFFLETROUGH are used against other Juniper firewalls including the SSG 300 and SSG 500. JETPLOW is a similar product for Cisco PIX and ASA firewalls, HALLUXWATER is for Huawei Eudemon firewalls.

Der Spiegel image of NSA ANT catalog page describing the COTTONMOUTH USB surveillance device.
Der Spiegel image of NSA ANT catalog page describing the FIREWALK Ethernet surveillance device.
Der Spiegel image of NSA ANT catalog page describing the GODSURGE JTAG debugging interface surveillance device.
Der Spiegel image of NSA ANT catalog page describing the HOWLERMONKEY RF transceiver data extraction device.

HOWLERMONKEY variants are RF transceivers to exfiltrate data from air-gapped systems. Other ANT products are miniturized digital cores packaged in multi-chip-modules, basically miniturized computers running full operating systems like the Raspberry Pi but concealed beneath a chip on the motherboard.

badBIOS — Real or Not?

The badBIOS story appeared in October, 2013. Dragos Ruiu told about very advanced malware that infected both Mac and PC hardware, reflashing the BIOS, UEFI, or EFI firmware, spreading via ultrasound or signals from software defined radios, traveling in USB memory sticks that were merely plugged in but never mounted..

Compilation of Ruiu's observations

Ars Technica 31 Oct 2013 "Meet 'badBIOS,' the mysterious Mac and PC malware that jumps airgaps"

InfoWorld 1 Nov 2013 "BadBIOS: Next-gen malware or digital myth?"

Ars Technica 5 Nov 2013 "Researcher skepticism grows over badBIOS malware claims"

InfoWorld 12 Nov 2013 "4 reasons BadBIOS isn't real" includes this analysis:
People following this story fall into a few different camps. Many believe everything he says — or at least most of it — is true. Others think he's perpetrating a huge social engineering experiment, to see what he can get the world and the media to swallow. A third camp believes he's well-intentioned, but misguided due to security paranoia nurtured through the years. A few even think we're witnessing the public mental breakdown of a beloved figure. They point out that paranoid schizophrenics often claim to be targeted by hidden communication no one else can hear. To be honest, I've found myself in all these camps since the story broke, though I'm leaning toward those who think Ruiu is well-intentioned, but perhaps seeing too much of what he wants to see.

Is Your Hardware Really What You Think It Is?

There have been stories of counterfeit hardware from Cisco modules down to integrated circuits for some time. The first thing I noticed explaining just how these parts get into the parts supply stream was this Business Week article, "Dangerous Fakes", subtitled "How counterfeit, defective computer components from China are getting into U.S. warplanes and ships".

Given the horror stories it contains of entirely unmonitored suppliers chosen for U.S. military parts based largely if not entirely on their status as "disadvantaged", "woman and minority owned", and so on, I can see why the government didn't explain the details immediately....

Even If You Have AMD Hardware, Is It Really What You Thought It Was?

All AMD processors made during 2000-2010 included a secret debugging feature well outside the standard x86 architecture definition. All processors starting with the Athlon XP have a firmware-controlled feature that can put the CPU into debugging mode. See the article in The Register for an overview, the announcement by the discoverer for far more details, and this list of undocumented Machine Specific Registers in AMD processors.

Hardware Bugs

If the hardware won't even do what it's supposed to, there are big problems!

There were some interesting short articles about Intel Core 2 bugs, see here and here for the articles, and also see the background on Intel's quiet patch release. Affected CPUs were the Core 2 Duo E4000/E6000, Core 2 Quad Q6600, Core 2 Xtreme QX6800, QX6700, and QX6800.

Historical notes:

Remember the Pentium CPU's that were bad at floating-point division?

For some Pentium CPU's, a block of machine code starting 0xF00F will just plain halt it.

Virtualization / Emulation Bugs

VirtualBox is a virtualization product that used to be from Innobox, which was purchased by Sun, which was purchased by Oracle.

See this message from the OpenBSD project leader reporting that CPU registers become corrupted under VirtualBox. "We don't know how other operating system products continue running when the userland ecx register gets clobbered on a return from a page fault, but at least people should be aware that there is likely some security risk from running that product. That VM does not emulate the x86 correctly, (either)."

See my page on Violating Virtualization Security for more information on Type 1 and Type 2 virtualization vulnerabilities, VM escape, the use of malicious hypervisors, and more.

How Not to Respond to Intrusions

The IT security department of the Economic Development Administration within the Department of Commerce ridiculously over-reacted and spent over $2.7 million destroying $170,000 in hardware including desktop computers, cameras, printers, keyboards and even mice after they were informed of a potential malware infection. They would have destroyed even more hardware but they ran out of money to continue the idiotic operation.

See the Network World overview and the official Office of the Inspector General report for further details.

Back to the Security Page