setup for failure defea0ng uefi secure boot
play

Setup For Failure: Defea0ng UEFI Secure Boot Corey - PowerPoint PPT Presentation

Setup For Failure: Defea0ng UEFI Secure Boot Corey Kallenberg @coreykal Sam Cornwell @ssc0rnwell Xeno Kovah @xenokovah John BuGerworth


  1. Setup ¡For ¡Failure: ¡ ¡ Defea0ng ¡UEFI ¡Secure ¡Boot ¡ Corey ¡Kallenberg ¡ ¡@coreykal ¡ Sam ¡Cornwell ¡ ¡@ssc0rnwell ¡ Xeno ¡Kovah ¡ ¡@xenokovah ¡ John ¡BuGerworth ¡ ¡ ¡@jwbuGerworth3 ¡

  2. Introduc0on ¡ • Who ¡we ¡are: ¡ – Trusted ¡Compu0ng ¡and ¡firmware ¡security ¡researchers ¡at ¡ The ¡MITRE ¡Corpora0on ¡ • What ¡MITRE ¡is: ¡ – A ¡not-­‑for-­‑profit ¡company ¡that ¡runs ¡six ¡US ¡Government ¡ "Federally ¡Funded ¡Research ¡& ¡Development ¡ Centers" ¡(FFRDCs) ¡dedicated ¡to ¡working ¡in ¡the ¡public ¡ interest ¡ – The ¡first ¡.org, ¡!(.mil ¡| ¡.gov ¡| ¡.com ¡| ¡.edu ¡| ¡.net), ¡on ¡the ¡ ARPANET ¡ – Technical ¡lead ¡for ¡a ¡number ¡of ¡standards ¡and ¡structured ¡ data ¡exchange ¡formats ¡such ¡as ¡ CVE , ¡CWE, ¡OVAL, ¡CAPEC, ¡ STIX, ¡TAXII, ¡etc ¡

  3. The ¡Malware ¡Food ¡Chain ¡ • Rootkits ¡that ¡execute ¡earlier ¡on ¡the ¡pla`orm ¡are ¡in ¡a ¡ posi0on ¡to ¡compromise ¡code ¡that ¡executes ¡later ¡on ¡ the ¡pla`orm, ¡making ¡earliest ¡execu0on ¡desirable. ¡

  4. Malware ¡Food ¡Chain: ¡ Blood ¡in ¡the ¡Water ¡ • It’s ¡advantageous ¡for ¡malware ¡to ¡claw ¡its ¡way ¡up ¡the ¡food-­‑ chain ¡and ¡down ¡towards ¡hardware. ¡ ¡ • Previously, ¡malware ¡running ¡with ¡sufficient ¡privileges ¡on ¡ the ¡opera0ng ¡system ¡could ¡make ¡malicious ¡writes ¡to ¡both ¡ the ¡Master ¡Boot ¡Record ¡and ¡the ¡BIOS. ¡

  5. • Many ¡modern ¡pla`orms ¡implement ¡the ¡ requirement ¡that ¡updates ¡to ¡the ¡firmware ¡must ¡ be ¡signed. ¡This ¡makes ¡compromising ¡the ¡BIOS ¡ with ¡a ¡rootkit ¡harder. ¡

  6. More ¡on ¡Signed ¡BIOS ¡Requirement ¡ • Signed ¡BIOS ¡recommenda0ons ¡have ¡been ¡ around ¡for ¡a ¡while ¡now ¡and ¡preceded ¡ widespread ¡adop0on ¡of ¡UEFI. ¡ • Not ¡perfect, ¡but ¡significantly ¡raises ¡the ¡barrier ¡ of ¡entry ¡into ¡the ¡pla`orm ¡firmware. ¡ • “AGacking ¡Intel ¡BIOS” ¡by ¡Rafal ¡Wojtczuk ¡and ¡ Alexander ¡Tereshkin. ¡ • “Defea0ng ¡Signed ¡BIOS ¡Enforcement” ¡by ¡ Kallenberg, ¡BuGerworth, ¡Kovah ¡and ¡Cornwell. ¡

  7. • Signed ¡BIOS ¡requirement ¡did ¡not ¡address ¡ malicious ¡boot ¡loaders, ¡leaving ¡the ¡door ¡open ¡ for ¡bootkits/evil ¡maid ¡aGacks. ¡

  8. Enter ¡UEFI ¡ • UEFI ¡has ¡largely ¡replaced ¡conven0onal ¡BIOS ¡for ¡ PC ¡pla`orm ¡firmware ¡on ¡new ¡systems. ¡ • UEFI ¡2.3.1 ¡specifies ¡a ¡new ¡security ¡feature ¡ “Secure ¡Boot” ¡in ¡order ¡to ¡address ¡the ¡bootkit ¡ vulnerability ¡present ¡on ¡conven0onal ¡BIOS ¡ systems. ¡ ¡ • When ¡enabled, ¡Secure ¡Boot ¡validates ¡the ¡ integrity ¡of ¡the ¡opera0ng ¡system ¡boot ¡loader ¡ before ¡transferring ¡control ¡to ¡it. ¡ ¡

  9. • Secure ¡Boot ¡does ¡not ¡prevent ¡the ¡ini0al ¡malicious ¡ write ¡to ¡the ¡boot ¡loader ¡(unlike ¡signed ¡bios ¡ enforcement) ¡

  10. • Upon ¡discovery ¡of ¡the ¡overwriGen ¡(malicious) ¡ boot ¡loader, ¡the ¡pla`orm ¡firmware ¡will ¡aGempt ¡ to ¡cryptographically ¡verify ¡the ¡integrity ¡of ¡the ¡ target ¡OS ¡loader. ¡

  11. • Because ¡the ¡boot ¡loader ¡is ¡not ¡signed ¡with ¡a ¡ key ¡embedded ¡into ¡the ¡firmware, ¡UEFI ¡will ¡ refuse ¡to ¡boot ¡the ¡system. ¡

  12. • Secure ¡Boot ¡is ¡not ¡limited ¡to ¡verifying ¡only ¡the ¡boot ¡ loader. ¡ • Secure ¡Boot ¡will ¡aGempt ¡to ¡verify ¡any ¡EFI ¡executable ¡that ¡ it ¡aGempts ¡to ¡transfer ¡control ¡to. ¡ • Sort ¡of.. ¡

  13. • The ¡signature ¡check ¡on ¡target ¡EFI ¡executables ¡doesn’t ¡always ¡occur. ¡ • Depending ¡on ¡the ¡origin ¡of ¡the ¡target ¡executable, ¡the ¡target ¡may ¡be ¡ allowed ¡to ¡execute ¡automa0cally. ¡ • In ¡the ¡EDK2, ¡these ¡policy ¡values ¡are ¡hard ¡coded. ¡ Code ¡from ¡EDK2 ¡open ¡source ¡reference ¡implementa0on ¡available ¡at: ¡ hGps://svn.code.sf.net/p/edk2/code/trunk/edk2 ¡

  14. • For ¡instance, ¡an ¡unsigned ¡op0on ¡ROM ¡may ¡be ¡ allowed ¡to ¡run ¡if ¡the ¡OEM ¡is ¡concerned ¡about ¡ breaking ¡ajer ¡market ¡graphics ¡cards ¡that ¡the ¡user ¡ adds ¡in ¡later. ¡

  15. AGack ¡Proposal ¡ • If ¡a ¡Secure ¡Boot ¡policy ¡was ¡configured ¡to ¡allow ¡ unsigned ¡EFI ¡executables ¡to ¡run ¡on ¡any ¡ mediums ¡that ¡an ¡aGacker ¡may ¡arbitrarily ¡ write ¡to ¡(boot ¡loader, ¡op0on ¡rom, ¡others…) ¡ then ¡other ¡legi0mate ¡EFI ¡executables ¡can ¡be ¡ compromised ¡later. ¡

  16. • The ¡malicious ¡op0on ¡rom ¡will ¡run ¡before ¡the ¡ legi0mate ¡Windows ¡boot ¡loader. ¡

  17. • Malicious ¡op0on ¡rom ¡hooks ¡some ¡code ¡that ¡legi0mate ¡ Windows ¡boot ¡loader ¡will ¡call ¡later ¡(think ¡old ¡school ¡ BIOS ¡rootkit ¡IVT ¡hooking). ¡ * ¡The ¡actual ¡flash ¡chip ¡contents ¡aren’t ¡modified ¡here, ¡only ¡in-­‑memory ¡copies ¡of ¡relevant ¡firmware ¡code/ structures. ¡

  18. • Legi0mate ¡boot ¡loader ¡proceeds ¡to ¡execute ¡as ¡ normal. ¡

  19. • Boot ¡loader ¡is ¡compromised ¡by ¡BIOS ¡code. ¡ • Opera0ng ¡system ¡is ¡then ¡later ¡compromised. ¡

  20. • Malware ¡has ¡successfully ¡evolved ¡into ¡a ¡more ¡ dominant ¡species ¡on ¡the ¡malware ¡food ¡chain. ¡

  21. • What ¡does ¡the ¡secure ¡boot ¡policy ¡look ¡like ¡on ¡ real ¡systems? ¡ • How ¡can ¡you ¡detect ¡the ¡secure ¡boot ¡policy ¡of ¡ the ¡system ¡without ¡manually ¡tes0ng? ¡

  22. • The ¡above ¡shows ¡disassembly ¡of ¡the ¡secure ¡boot ¡ policy ¡ini0aliza0on ¡on ¡Dell ¡La0tude ¡E6430 ¡BIOS ¡ revision ¡A12. ¡

  23. • The ¡Secure ¡Boot ¡policy ¡can ¡be ¡either ¡hardcoded, ¡ or ¡derived ¡from ¡the ¡EFI ¡“Setup” ¡variable. ¡ ¡ • It ¡turns ¡out ¡the ¡contents ¡of ¡the ¡“Setup” ¡variable ¡ makes ¡this ¡determina0on. ¡

  24. • The ¡EFI ¡variables ¡are ¡typically ¡stored ¡on ¡the ¡ SPI ¡Flash ¡chip ¡that ¡also ¡contains ¡the ¡pla`orm ¡ firmware ¡(UEFI ¡code). ¡ ¡

  25. Cross ¡Roads ¡ • The ¡Dell’s ¡I ¡looked ¡at ¡did ¡not ¡have ¡relaxed ¡ op0on ¡rom ¡policies ¡as ¡I ¡had ¡previously ¡ hypothesized. ¡ ¡ • The ¡EFI ¡“Setup” ¡variable ¡became ¡my ¡next ¡ target ¡of ¡aGen0on. ¡

  26. • Setup ¡variable ¡is ¡marked ¡as ¡Non-­‑Vola0le ¡(Stored ¡ to ¡flash ¡chip), ¡and ¡as ¡accessible ¡to ¡both ¡Boot ¡ services ¡and ¡Run0me ¡Services. ¡ • We ¡should ¡be ¡able ¡to ¡modify ¡it ¡from ¡the ¡ opera0ng ¡system. ¡ • It’s ¡also ¡quite ¡large… ¡lots ¡of ¡stuff ¡in ¡here! ¡

  27. Secret ¡Protec0ons? ¡ • The ¡Setup ¡variable ¡is ¡of ¡obvious ¡importance ¡to ¡ the ¡security ¡of ¡the ¡pla`orm, ¡which ¡made ¡me ¡ wonder ¡if ¡there ¡was ¡some ¡secret ¡protec0on ¡ that ¡would ¡prevent ¡me ¡from ¡wri0ng ¡to ¡it. ¡ • As ¡a ¡first ¡aGempt ¡to ¡demonstrate ¡I ¡could ¡write ¡ to ¡the ¡Setup ¡variable ¡from ¡Windows, ¡I ¡tried ¡to ¡ just ¡zero ¡out ¡the ¡variable. ¡This ¡turned ¡out ¡to ¡ be ¡a ¡very ¡bad ¡idea… ¡

  28. • Star0ng ¡in ¡Windows ¡8, ¡Microsoj ¡provides ¡an ¡API ¡ for ¡interac0ng ¡with ¡EFI ¡non ¡vola0le ¡variables. ¡

  29. • Any ¡guesses ¡as ¡to ¡what ¡happened? ¡

  30. • Hint: ¡you ¡can ¡tell ¡I’ve ¡already ¡taken ¡the ¡laptop ¡apart ¡ (this ¡picture ¡was ¡taken ¡post-­‑surgical-­‑recovery). ¡

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend