Advanced x86: BIOS and System Management Mode Internals SMI Suppression Xeno Kovah && Corey Kallenberg LegbaCore, LLC.

Slides:



Advertisements
Similar presentations
1/1/ / faculty of Electrical Engineering eindhoven university of technology Memory Management and Protection Part 3:Virtual memory, mode switching,
Advertisements

M2 – Explain the tools and techniques used in the creation of an interactive website. By Arturas Vitkovskij.
Internet of Things with Intel Edison GPIO on Edison
Protecting cells in the worksheet from being changed. June 21, 2012.
The 8085 Microprocessor Architecture
© 2013 The MITRE Corporation. All rights reserved. For internal MITRE use Corey Kallenberg John Butterworth Sam Cornwell Xeno Kovah Defeating Signed BIOS.
NetAcumen ActiveX Download Instructions
Georgia Institute of Technology Workshop for CS-AP Teachers Chapter 3 Advanced Object-Oriented Concepts.
CSC Timers Since this is a microcontroller it mainly finds itself in embedded devices Quite often embedded devices need to synchronize events The.
Week:#14 Windows Recovery
Blackfin BF533 EZ-KIT Control The O in I/O
4 Things that affect your pictures… ISO Aperture Shutter Speed LIGHT.
Host and Application Security Lesson 4: The Win32 Boot Process.
Computer Maintenance Unit Subtitle: Basic Input/Output System (BIOS) Excerpted from 1 Copyright © Texas Education Agency, All.
The Protection of Information in Computer Systems Part I. Basic Principles of Information Protection Jerome Saltzer & Michael Schroeder Presented by Bert.
Moodle (Course Management Systems). Managing Your class In this Lecture, we’ll cover course management, including understanding and using roles, arranging.
Using Advanced Options Lesson 14 © 2014, John Wiley & Sons, Inc.Microsoft Official Academic Course, Microsoft Word Microsoft Word 2013.
Advanced x86: BIOS and System Management Mode Internals Tools
Advanced x86: BIOS and System Management Mode Internals SPI Flash Xeno Kovah && Corey Kallenberg LegbaCore, LLC.
Interrupt driven I/O. MIPS RISC Exception Mechanism The processor operates in The processor operates in user mode user mode kernel mode kernel mode Access.
Advanced x86: BIOS and System Management Mode Internals Input/Output
Advanced x86: BIOS and System Management Mode Internals PCI
Advanced x86: BIOS and System Management Mode Internals Conclusion Xeno Kovah && Corey Kallenberg LegbaCore, LLC.
Microsoft ® Office ® 2010 Office 2010 Security: Protecting your files.
Xeno Kovah && Corey Kallenberg LegbaCore, LLC
Advanced x86: BIOS and System Management Mode Internals System Management Mode (SMM) Xeno Kovah && Corey Kallenberg LegbaCore, LLC.
Advanced x86: BIOS and System Management Mode Internals SPI Flash Programming Xeno Kovah && Corey Kallenberg LegbaCore, LLC.
Advanced x86: BIOS and System Management Mode Internals SMRAM (System Management RAM) Xeno Kovah && Corey Kallenberg LegbaCore, LLC.
Advanced x86: BIOS and System Management Mode Internals Introduction
Advanced x86: BIOS and System Management Mode Internals SPI Flash Protection Mechanisms Xeno Kovah && Corey Kallenberg LegbaCore, LLC.
Advanced x86: BIOS and System Management Mode Internals Memory Map Xeno Kovah && Corey Kallenberg LegbaCore, LLC.
Advanced x86: BIOS and System Management Mode Internals Boot Process Xeno Kovah && Corey Kallenberg LegbaCore, LLC.
Advanced x86: BIOS and System Management Mode Internals More Fun with SMM Xeno Kovah && Corey Kallenberg LegbaCore, LLC.
Xeno Kovah && Corey Kallenberg
SEM Basics 2 Byrne Chapter 2 Kline pg 7-15, 50-51, ,
Advanced x86: BIOS and System Management Mode Internals Flash Descriptor Xeno Kovah && Corey Kallenberg LegbaCore, LLC.
Xeno Kovah && Corey Kallenberg
Advanced x86: BIOS and System Management Mode Internals SMM & Caching Xeno Kovah && Corey Kallenberg LegbaCore, LLC.
Introduction to Microprocessors - chapter3 1 Chapter 3 The 8085 Microprocessor Architecture.
Chess Strategies Component Skills Strategies Prototype Josh Waters, Ty Fenn, Tianyu Chen.
Interrupt driven I/O Computer Organization and Assembly Language: Module 12.
I/O Interface. INTRO TO I/O INTERFACE I/O instructions (IN, INS, OUT, and OUTS) are explained. Also isolated (direct or I/O mapped I/O) and memory-mapped.
7/27/2004IETF San-Diego Plenary meeting 8/2004 EPON MIBs Lior Khermosh – Passave Technologies
CSCI 156: Lab 11 Paging. Our Simple Architecture Logical memory space for a process consists of 16 pages of 4k bytes each. Your program thinks it has.
Computer Maintenance I
LECTURE 12 Virtual Memory. VIRTUAL MEMORY Just as a cache can provide fast, easy access to recently-used code and data, main memory acts as a “cache”
Security Settings Everything-well almost everything, ok-some things that will help you with Security Settings!
Text2PTO: Modernizing Patent Application Filing A Proposal for Submitting Text Applications to the USPTO.
Advance startup options Shift Restart. Restart options.
Difference between External and Internal Server Monitoring.
/Reimage-Repair-Tool/ /u/6/b/ /channel/UCo47kkB-idAA-IMJSp0p7tQ /alexwaston14/reimage-system-repair/
Bootloaders Many embedded processors have flash memory. This allows us to alter a product even though it is in the users hands: -fix bugs -upgrade or enhance.
Setup For Failure: Defeating Secure Boot Corey Sam Xeno John
Homework Reading Machine Projects Labs
Bootloaders Many embedded processors have flash memory. This allows us to alter a product even though it is in the users hands: -fix bugs -upgrade or.
The 8085 Microprocessor Architecture
Data Virtualization Tutorial… CORS and CIS
Computer Maintenance Unit Subtitle: Basic Input/Output System (BIOS)
CHAPTER 7.
The 8085 Microprocessor Architecture
Introduction to Computers
Booting Up 15-Nov-18 boot.ppt.
Xeno Kovah && Corey Kallenberg LegbaCore, LLC
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
Introduction to Intel x86-64 Assembly, Architecture, Applications, & Alliteration Xeno Kovah – 2014 xkovah at gmail.
The 8085 Microprocessor Architecture
Lab Notes LAB 1 Setup.
TPM, UEFI, Trusted Boot, Secure Boot
The bios.
Presentation transcript:

Advanced x86: BIOS and System Management Mode Internals SMI Suppression Xeno Kovah && Corey Kallenberg LegbaCore, LLC

All materials are licensed under a Creative Commons “Share Alike” license. 2 Attribution condition: You must indicate that derivative work "Is derived from John Butterworth & Xeno Kovah’s ’Advanced Intel x86: BIOS and SMM’ class posted at

SMI Suppression SMM stands as the first line of defense for protecting the BIOS flash from being overwritten –We’ll cover how in the flash BIOS portion of the course What if the attacker simply suppressed SMI from being generated? They can, if the system isn’t locked down properly: I/O Controller Hub Family 9 3

SMI_EN: SMI Control and Enable Register Located in the Power Management IO Registers (memory-mapped at PMBASE defined in LPC D31:F0) The SMI_EN register can enable or disable some very specific instances of SMI# or globally enable/disable all SMI# Shown above is the Global Enable/Disable for SMI# 4

SMI_EN We can disable the generation of SMI# on writes to IO port 0xB2 And a slough of others (BIOS_EN refers to BIOS being able to receive ACPI “messages”, it has nothing to do with enabling/disabling BIOS itself) 5

SMI_EN SMI_EN provides a lot of control over the generation of SMI# It can also enable/disable that periodic generation of SMI# You get the idea… 6

Demo: SMI Suppression As we know, we (should be) unable to assert bit 0 in the BIOS_CNTL register located in LPC D31:F0, offset DCh Let’s “fix” that! BIOS_CNTL register 7

Demo: SMI Suppression Locate the PMBASE address from LPC D31:F0, offset 40h This is mapped to the I/O address space, as indicated in the Base Address register description 8

Demo: SMI Suppression In this case we can see it is mapped to I/O starting at address 0x1000 Open up an I/O ports window and enter 0x1000 Be sure to check ACPI Power Management Base On some systems not doing this causes lockups or system crashes 9

Demo: SMI Suppression The bit to suppress global SMI# is at bit 0 in the SMI_EN register located at PMBASE + 30h It looks like uninitialized space, but everything is enabled Just not locked down 10

Demo: SMI Suppression Commence SMI# suppression! De-assert bit 0 so that SMI_EN is FFFF_FFFEh 11

Demo: SMI Suppression Now with SMI# suppressed we can enable writes to the BIOS flash by asserting bit 0 in the BIOS_CNTL register We’ll cover this in more detail in the next section BIOS_CNTL register 12

Demo: SMI Suppression Notice that bit 0 remains asserted now whereas before disabling SMI# it would have been reset to 0 Now we can write to the BIOS. This is very bad. 13

Demo: SMI Suppression Running the write_bios_base_deadbeef.sys writes to the BIOS base to prove this point 14

Ring0 can modify authenticated EFI Variables, which allows trivial bypassing of Secure Boot –We’ll cover this in the UEFI secure boot portion of the class. For now just take my word for it: this is not good Demo Video: Charizard 15

SMI Suppression As we’ll see in the next section, there is one secondary defense that could still work to prevent an attacker from being able to flash the BIOS under these circumstances –However they can’t be used to protect the UEFI variables because those must always be writeable Locking down the SMI_EN register is something that vendors don’t really know about: 3216 of 8005 (~40%) systems measured did not have SMI_LOCK set –The numbers are much higher if you rollback the BIOS to a vulnerable revision, which is typically permitted 16

SMI Suppression Prevention 1: GEN_PMCON1 GEN_PMCON1 is located in the LPC D31:F0 Power Management registers The vendor must (must must!) assert SMI_LOCK in the GEN_PMCON_1 register Don’t give attackers the option of suppressing SMI# Especially since the system depends on SMM to protect the BIOS Flash!!! 17

SMI Suppression Prevention 2: BIOS_CNTL.SMM_BWP We’ll cover this register during the BIOS flash portion of the course Raises the security level of the platform Suffice to say this is a very useful (newish) feature –That isn’t utilized very often 18