Firmware Biopsy
tweek <tweek@google.com>
Enterprise Infrastructure Protection
Firmware Biopsy tweek <tweek@google.com> Enterprise - - PowerPoint PPT Presentation
Firmware Biopsy tweek <tweek@google.com> Enterprise Infrastructure Protection Agenda Context Read Primitives More Read Primitives Collection at Scale Findings Q & A Context x86 in 2016 (Skylake) DDR SDRAM PEG
Enterprise Infrastructure Protection
CPU PCH
DDR SDRAM
SMBus DMI
GPU
PEG
DDR SDRAM
CPU PCH
System Flash DDR SDRAM
SMBus DMI
GPU
SPI PEG
DDR SDRAM
CPU PCH
System Flash
Embedded Controller
DDR SDRAM
SMBus DMI
GPU
SPI SMBUS SPI PEG
DDR SDRAM
CPU PCH
System Flash
Embedded Controller
DDR SDRAM
SMBus DMI
EC Flash GPU
SPI SMBUS SPI SPI PEG
DDR SDRAM
CPU PCH
System Flash
Embedded Controller
DDR SDRAM
SMBus DMI
EC Flash GPU
SPI SMBUS SPI SPI PEG SSD
SSD Flash
SPI
DDR SDRAM
SATA/PCIe
CPU PCH
System Flash
Embedded Controller
DDR SDRAM
SMBus DMI
EC Flash GPU
SPI SMBUS SPI SPI PEG Thunderbolt Controller (w EEPROM) USB-C Switch Controller USB-C Controller Flash SSD
SSD Flash
SPI
DDR SDRAM
SATA/PCIe
CPU MC BIOS/ME TPM SILEGO EC PD SSD BATTERY FUEL GAUGE AUDIO CODEC AUDIO DSP GPU EC SD CARD WIFI/BT
Firmware / Topic Published Research PCI Option ROM Heasman (2007) Snare (2013) Kovah & LegbaCore (2015) Hard Drive Goodspeed et al. (2013) Network Controller Triulzi (2008) x86 Modes and Design flaws Rutkowska (2009-2015) Cr4sh SMM research (2015-2016)
○ Equation Group, IRATEMONK, DEITYBOUNCE
○ Hacking Team
before being disclosed
○ Reliable ○ Generic ○ Complete
○ Trade-off between integrity and scalability of measurement ○ Physical: hook onto pins = easiest, not practical for internal flash
○ Hash of firmware ○ Partial copy
○ Similar objective ○ Partial measure of boot environment ○ Limited to boot path ○ Preventative method
Kernel Userspace Firmware
Measuring this
Hardware
Kernel Userspace Firmware
Measuring this From here
Hardware
○ Investigate the OS from the running kernel
○ For a specific firmware => have two or more read primitives ○ Increase the cost of hiding for an attacker
for their format
Descriptor BIOS Image Management Engine (ME) Image Ethernet Controller Firmware
8-PIN WSON Debug Header 8-PIN SOP
○ Software sequencing: Deprecated, forward white-listed operations to the flash ○ Hardware sequencing: PCH offers standard “API” to interact with flash
[1]
[2]
SPIBAR is at: 0xfed1c000 + 0x3800 (constant) = 0xfed1f800
Where? (0x00533e63)
Where? (0x00533e63) How much? [1-64]
Where? (0x00533e63) How much? [1-64] What? (r/w) + Go!
Where? (0x00533e63) How much? [1-64] What? (r/w) + Go! Content of the Flash
this range to DMI. This positive decode ensures any
boot vector and BIOS execute off the PCH.” - Intel Skylake datasheet
○ VRAM ○ PCI Option ROM ○ GPU firmware
○ Describes low-level interface of cards ○ Highly dependent on card generation
○ ACPI define two IO port ○ Index I/O for extra reads
○ Lenovo’s ThinkEngine ○ Apple’s SMC
○ Open Source EC ○ Read primitive available using flashrom (in dev mode)
○ Integrate Sleuthkit for live disk forensic ○ Integrate Rekall for memory forensic
○ Quickly extend the functionality in case of incident or public release
Execution Time (s) # clients
○ Older generation only supports software sequencing ○ Unsupported hardware by Chipsec ○ Execution on a VM
○ Load Chipsec ○ Dump the flash image
○ Previous versions from the same host ○ Official version ○ Other machine with the same BIOS version ○ Different read primitives
○ Lots of noise ○ E.g., BIOS contains variable areas, all flash images will be different
○ Vendor specific format ○ Extra care to consider “in-between” regions ○ Some regions will still be out of analysis ○ May need to run control flow analysis to uncover similar code
○ UEFI: UEFITools, uefi-firmware-parser ○ ME: me-tools, unhuffme
with official versions
vendor/BIOS version
regions
Descriptor BIOS Image Management Engine (ME) Image Ethernet Controller Firmware
○ Able to dump the ME part of the flash image ○ While the flash descriptor explicitly forbid such operation ??
expose such behaviour
[1]
○ chipsec/modules/common/spi_fdopss.py
Huge thanks to the team: Ben, Darren, Jan, Parth and Mario.
datasheet