Se ha denunciado esta presentación.
Utilizamos tu perfil de LinkedIn y tus datos de actividad para personalizar los anuncios y mostrarte publicidad más relevante. Puedes cambiar tus preferencias de publicidad en cualquier momento.
Bootkits: Past, Present 
& Future 
Alexander Matrosov 
@matrosov 
Eugene Rodionov 
@vxradius 
David Harley 
@DavidHarleyBl...
Agenda 
 Modern Bootkits History 
 Legacy BIOS vs. UEFI Boot Environment & Proof of Concept vs. In the Wild 
 Legacy BI...
Modern Bootkit History 
Mebroot 
Vbootkit 
22000055 22000077 22000088 22000099 22001100 22001111 22001122 22001133 2200114...
Legacy BIOS vs. UEFI 
 No more MBR and VBR/IPL code 
 Different hard drive partitioning 
scheme: GPT (GUID Partition Tab...
The Target of Modern Bootkits (MBR/VBR)
Classification of MBR/VBR Bootkits 
Bootkits 
MBR VBR/IPL 
MBR Code 
modification 
Partition Table 
modification 
IPL Code...
IPL Code Modification: Rovnix 
 Win64/Rovnix overwrites bootstrap code of the active partition 
MBR VBR Bootstrap Code Fi...
Gapz VBR Bootkit 
Main features: 
 Relies on Microsoft Windows VBR layout 
 The infections result in modifying only 4 by...
Gapz BPB Layout 
struct BIOS_PARAMETER_BLOCK 
{ 
WORD BytesPerSector; 
BYTE SecPerCluster; 
WORD ReservedSectors; 
BYTE Re...
Gapz 
NTFS Volume 
0x200 0x1E00 
MBR VBR IPL NTFS File System 
Number of 
“Hidden Sectors” 
0x200 0x1E00 
Infected 
VBR 
H...
Olmarik 
(TDL4) 
Rovnix 
(Cidox) 
Modern Bootkits Comparison Functionality Gapz 
Goblin 
(XPAJ) 
Olmasco 
(MaxSS) 
MBR mod...
HiddenFsReader as a Forensic Tool (MBR/VBR)
HiddenFsReader as a Forensic Tool (MBR/VBR)
In The Beginning… 
In 1998-99 CIH (Chernobyl) virus 
written by a student of Taipei Tatung 
Institute of Technology in Tai...
Signed BIOS Updates Are Rare 
• Mebromi malware includes BIOS 
infector & MBR bootkit components 
• Patches BIOS ROM binar...
UEFI BIOS Firmware 
SEC 
S-CRTM; Init caches/MTRRs; Cache-as-RAM (NEM); Recovery; TPM Init 
Pre-EFI Init 
(PEI) 
Driver Ex...
UEFI Bootkits 
OS Kernel / Drivers 
UEFI OS Loaders 
DXE 
Driver 
DXE 
Driver 
UEFI DXE Core / Dispatcher 
System Firmware...
Malware 
OS Kernel / Drivers 
UEFI OS Loaders 
DXE 
Driver 
DXE 
Driver 
UEFI DXE Core / Dispatcher 
System Firmware (SEC/...
UEFI Bootkits 
Replacing Windows Boot Manager 
EFI System Partition (ESP) on Fixed Drive 
ESPEFIMicrosoftBootbootmgfw.efi ...
Malware 
OS Kernel / Drivers 
UEFI OS Loaders 
DXE 
Driver 
DXE 
Driver 
UEFI DXE Core / Dispatcher 
System Firmware (SEC/...
UEFI Bootkits 
Adding/Replacing DXE Driver 
Stored on Fixed Drive 
Not embedded in Firmware Volume (FV) in ROM 
Modified D...
Malware 
OS Kernel / Drivers 
UEFI OS Loaders 
DXE 
Driver 
DXE 
Driver 
UEFI DXE Core / Dispatcher 
System Firmware (SEC/...
UEFI Bootkits 
Patching UEFI “Option ROM” 
UEFI DXE Driver in Add-On Card (Network, Storage..) 
Non-Embedded in FV in ROM ...
UEFI Bootkits 
Replacing OS Loaders (winload.efi, winresume.efi) 
Patching GUID Partition Table (GPT)
Malware 
OS Kernel / Drivers 
UEFI OS Loaders 
DXE 
Driver 
DXE 
Driver 
UEFI DXE Core / Dispatcher 
System Firmware (SEC/...
What about Secure Boot?
OS Kernel / Early Launch Anti-Malware (ELAM) 
UEFI OS Loaders (winload.efi, winresume.efi) 
UEFI 
App 
DXE 
Driver 
UEFI D...
Secure Boot bypass possible? 
OS Driver OS Exploit 
UEFI OS Loaders 
UEFI DXE Core / Dispatcher 
System Firmware (SEC/PEI)...
First Public Windows 8 Secure Boot Bypass (Aug 2013) 
A Tale Of One Software Bypass Of Windows 8 Secure Boot
BIOS Attack Surface 
SPI Flash 
Protection 
System 
FW/BIOS 
BIOS 
Update 
SMRAM 
Protection 
Hardware 
Config. 
SMI 
Hand...
From Analytics, and Scalability, and UEFI Exploitation by Teddy Reed 
Patch attempts to enable BIOS write protection (sets...
CHIPSEC 
Platform Security 
Assessment Framework 
https://github.com/chipsec/chipsec 
@CHIPSEC
CHIPSEC: Platform Security Assessment Framework
CHIPSEC: Platform Security Assessment Framework 
chipsec_main.py runs modules (see modules dir below) 
chipsec_util.py run...
Known Threats and CHIPSEC modules 
Issue CHIPSEC Module References 
SMRAM Locking common.smm CanSecWest 2006 
BIOS Keyboar...
BIOS/Firmware Forensics 
Live system firmware analysis 
chipsec_util spi info 
chipsec_util spi dump rom.bin 
chipsec_util...
How to dump BIOS firmware directly from chip?
How to dump BIOS firmware directly from chip?
DEMO TIME
Thank you for your attention! 
Eugene Rodionov 
@vxradius 
Alexander Matrosov 
@matrosov 
David Harley 
@DavidHarleyBlog
Bootkits: past, present & future
Bootkits: past, present & future
Bootkits: past, present & future
Bootkits: past, present & future
Próxima SlideShare
Cargando en…5
×

Bootkits: past, present & future

Bootkit threats have always been a powerful weapon in the hands of cybercriminals, allowing them to establish persistent and stealthy presence in their victims' systems. The most recent notable spike in bootkit infections was associated with attacks on 64-bit versions of the Microsoft Windows platform, which restrict the loading of unsigned kernel-mode drivers. However, these bootkits aren't effective against UEFI-based platforms. So, are UEFI-based machines immune against bootkit threats (or would they be)?

The aim of this presentation is to show how bootkit threats have evolved over time and what we should expect in the near future. Firstly, we will summarize what we've learned about the bootkits seen in the wild targeting the Microsoft Windows platform: from TDL4 and Rovnix (which was used by the Carberp banking trojan) up to Gapz (which employs one of the stealthiest bootkit infection techniques seen so far). We will review their infection approaches and the methods they have employed to evade detection and removal from the system.

Secondly, we will look at the security of the increasingly popular UEFI platform from the point of view of the bootkit author, as UEFI is becoming a target of choice for researchers in offensive security, and proof-of-concept bootkits targeting Windows 8 OS using UEFI have already been released. We will focus on various attack vectors against UEFI and discuss available tools and what measures should be taken to mitigate against them.

  • Sé el primero en comentar

Bootkits: past, present & future

  1. 1. Bootkits: Past, Present & Future Alexander Matrosov @matrosov Eugene Rodionov @vxradius David Harley @DavidHarleyBlog
  2. 2. Agenda  Modern Bootkits History  Legacy BIOS vs. UEFI Boot Environment & Proof of Concept vs. In the Wild  Legacy BIOS Bootkit Classification  UEFI Bootkits  Bootkit Implementation Strategies  Attacks against Secure Boot  Forensic Software  HiddenFsReader  CHIPSEC
  3. 3. Modern Bootkit History Mebroot Vbootkit 22000055 22000077 22000088 22000099 22001100 22001111 22001122 22001133 22001144 eEye BootRoot Mebratix Mebroot v2 Olmarik (TDL4) Olmasco (TDL4-based) Vbootkit x64 Vbootkit x64 Rovnix Evil Core Stoned Bootkit Mebromi DeepBoot Stoned Bootkit x64 Gapz VGA Bootkit OldBoot Dream Boot (Android Bootkit) Microsoft x64 platform gains popularity Secure Boot implemented in Windows 8 In the Wild Proof of Concept
  4. 4. Legacy BIOS vs. UEFI  No more MBR and VBR/IPL code  Different hard drive partitioning scheme: GPT (GUID Partition Table)  Secure Boot technology is implemented in Windows 8 BIOS BIOS boot code MBR (Master Boot Record) VBR/IPL (Volume Boot Record/ Initial Program Loader) bootmgr winload.efi Load kernel and boot start drivers UEFI UEFI boot code UEFI boot loader (bootmgfw.efi) winload.efi Load kernel and boot start drivers
  5. 5. The Target of Modern Bootkits (MBR/VBR)
  6. 6. Classification of MBR/VBR Bootkits Bootkits MBR VBR/IPL MBR Code modification Partition Table modification IPL Code modification BIOS Parameter Block modification TDL4 Olmasco Rovnix Gapz
  7. 7. IPL Code Modification: Rovnix  Win64/Rovnix overwrites bootstrap code of the active partition MBR VBR Bootstrap Code File System Data VBR Malicious Code File System Data Bootstrap Code MBR NTFS bootstrap code (15 sectors) Before Infecting After Infecting Malicious Unsigned Driver Compressed Data “Hasta La Vista, Bootkit: Exploiting the VBR” http://www.welivesecurity.com/2011/08/23/hasta-la-vista-bootkit-exploiting-the-vbr/
  8. 8. Gapz VBR Bootkit Main features:  Relies on Microsoft Windows VBR layout  The infections result in modifying only 4 bytes of VBR  The patched bytes might differ on various installations 0x000 0x003 0x054 0x19C 0x1FE 0x200 jmp BIOS Parameter Block (BPB) VBR code Text Strings 0x55 0xAA transfer control “Mind the Gapz: The most complex bootkit ever analyzed?” http://www.welivesecurity.com/wp-content/uploads/2013/04/gapz-bootkit-whitepaper.pdf
  9. 9. Gapz BPB Layout struct BIOS_PARAMETER_BLOCK { WORD BytesPerSector; BYTE SecPerCluster; WORD ReservedSectors; BYTE Reserved[5]; BYTE MediaDescriptorID; WORD Reserved2; WORD SectorsPerTrack; WORD NumberOfHeads; DWORD HiddenSectors; DWORD Reserved3[2]; LONGLONG TotalSectors; LONGLONG StartingCluster; LONGLONG MFTMirrStartingCluster; DWORD ClustersPerMFTRecord; DWORD ClustersPerIndexBuffer; LONGLONG VolumeSerialNumber; DWORD Reserved4; };
  10. 10. Gapz NTFS Volume 0x200 0x1E00 MBR VBR IPL NTFS File System Number of “Hidden Sectors” 0x200 0x1E00 Infected VBR Hard Drive NTFS Volume MBR IPL NTFS File System Modified value of number of “Hidden Sectors” before infection after infection Bootkit
  11. 11. Olmarik (TDL4) Rovnix (Cidox) Modern Bootkits Comparison Functionality Gapz Goblin (XPAJ) Olmasco (MaxSS) MBR modification      VBR modification      Hidden file system FAT16 FAT32 custom type modification custom (TDL4 based) custom Crypto implementation AES-256, RC4, MD5, SHA1, ECC XOR/RC4 Custom (XOR+ROL)  RC6 modification Compression algorithm   aPlib aPlib  Custom TCP/IP network stack implementation     
  12. 12. HiddenFsReader as a Forensic Tool (MBR/VBR)
  13. 13. HiddenFsReader as a Forensic Tool (MBR/VBR)
  14. 14. In The Beginning… In 1998-99 CIH (Chernobyl) virus written by a student of Taipei Tatung Institute of Technology in Taiwan infected ~60 million PCs CIH (Chernobyl) erased BIOS ‘ROM’ boot block and boot sectors on a hard drive causing ~1B US dollars in damage
  15. 15. Signed BIOS Updates Are Rare • Mebromi malware includes BIOS infector & MBR bootkit components • Patches BIOS ROM binary injecting malicious ISA Option ROM with legitimate BIOS image mod utility • Triggers SW SMI 0x29/0x2F to erase SPI flash then write patched BIOS binary No Signature Checks of OS boot loaders (MBR/VBR) • No concept of Secure or Verified Boot • Wonder why TDL4 and likes flourished?
  16. 16. UEFI BIOS Firmware SEC S-CRTM; Init caches/MTRRs; Cache-as-RAM (NEM); Recovery; TPM Init Pre-EFI Init (PEI) Driver Exec Env (DXE) Boot Dev Select (BDS) Runtime / OS S-CRTM: Measure DXE/BDS Early CPU/PCH Init Memory (DIMMs, DRAM) Init, SMM Init Continue initialization of platform & devices Enum FV, dispatch drivers (network, I/O, service..) Produce Boot and Runtime Services Boot Manager (Select Boot Device) EFI Shell/Apps; OS Boot Loader(s) CPU Reset ACPI, UEFI SystemTable, SMBIOS table ExitBootServices. Minimal UEFI services (Variable)
  17. 17. UEFI Bootkits OS Kernel / Drivers UEFI OS Loaders DXE Driver DXE Driver UEFI DXE Core / Dispatcher System Firmware (SEC/PEI) Hardware UEFI Boot Loader Bootx64.efi Bootmgfw.efi UEFI OROM UEFI OROM I/O Memory Network Graphics HDD Malware
  18. 18. Malware OS Kernel / Drivers UEFI OS Loaders DXE Driver DXE Driver UEFI DXE Core / Dispatcher System Firmware (SEC/PEI) Hardware UEFI Boot Loader Bootx64.efi Bootmgfw.efi UEFI OROM UEFI OROM I/O Memory Network Graphics HDD UEFI Bootkits
  19. 19. UEFI Bootkits Replacing Windows Boot Manager EFI System Partition (ESP) on Fixed Drive ESPEFIMicrosoftBootbootmgfw.efi UEFI technology: say hello to the Windows 8 bootkit! by ITSEC Replacing Fallback Boot Loader ESPEFIBootbootx64.efi UEFI and Dreamboot by Sébastien Kaczmarek, QUARKSLAB Adding New Boot Loader (bootkit.efi) Modified BootOrder / Boot#### EFI variables
  20. 20. Malware OS Kernel / Drivers UEFI OS Loaders DXE Driver DXE Driver UEFI DXE Core / Dispatcher System Firmware (SEC/PEI) Hardware UEFI Boot Loader Bootx64.efi Bootmgfw.efi UEFI OROM UEFI OROM I/O Memory Network Graphics HDD UEFI Bootkits
  21. 21. UEFI Bootkits Adding/Replacing DXE Driver Stored on Fixed Drive Not embedded in Firmware Volume (FV) in ROM Modified DriverOrder + Driver#### EFI variables
  22. 22. Malware OS Kernel / Drivers UEFI OS Loaders DXE Driver DXE Driver UEFI DXE Core / Dispatcher System Firmware (SEC/PEI) Hardware UEFI Boot Loader Bootx64.efi Bootmgfw.efi UEFI OROM UEFI OROM I/O Memory Network Graphics HDD UEFI Bootkits
  23. 23. UEFI Bootkits Patching UEFI “Option ROM” UEFI DXE Driver in Add-On Card (Network, Storage..) Non-Embedded in FV in ROM Mac EFI Rootkits by @snare, Black Hat USA 2012
  24. 24. UEFI Bootkits Replacing OS Loaders (winload.efi, winresume.efi) Patching GUID Partition Table (GPT)
  25. 25. Malware OS Kernel / Drivers UEFI OS Loaders DXE Driver DXE Driver UEFI DXE Core / Dispatcher System Firmware (SEC/PEI) Hardware UEFI Boot Loader Bootx64.efi Bootmgfw.efi UEFI OROM UEFI OROM I/O Memory Network Graphics HDD UEFI Bootkits
  26. 26. What about Secure Boot?
  27. 27. OS Kernel / Early Launch Anti-Malware (ELAM) UEFI OS Loaders (winload.efi, winresume.efi) UEFI App DXE Driver UEFI DXE Core / Dispatcher System Firmware (SEC/PEI) Hardware UEFI OROM UEFI Boot Loader Bootx64.efi Bootmgfw.efi I/O Memory Network Graphics Signed BIOS Update UEFI OROM UEFI App DXE Driver UEFI Secure Boot OS Driver OS Driver Windows 8.1 Secure Boot Secure Boot on MS Windows 8.1
  28. 28. Secure Boot bypass possible? OS Driver OS Exploit UEFI OS Loaders UEFI DXE Core / Dispatcher System Firmware (SEC/PEI) Hardware DXE Driver UEFI Boot Loader Bootx64.efi Bootmgfw.efi I/O Memory Network Graphics Signed BIOS Update DXE Driver OS Kernel Modify Secure Boot FW or config in ROM
  29. 29. First Public Windows 8 Secure Boot Bypass (Aug 2013) A Tale Of One Software Bypass Of Windows 8 Secure Boot
  30. 30. BIOS Attack Surface SPI Flash Protection System FW/BIOS BIOS Update SMRAM Protection Hardware Config. SMI Handlers BIOS Settings (NVRAM, Variables) … Secure Boot Summary of Attacks Against BIOS and Secure Boot
  31. 31. From Analytics, and Scalability, and UEFI Exploitation by Teddy Reed Patch attempts to enable BIOS write protection (sets BIOS_CONTROL[BLE]). Picked up by Subzero
  32. 32. CHIPSEC Platform Security Assessment Framework https://github.com/chipsec/chipsec @CHIPSEC
  33. 33. CHIPSEC: Platform Security Assessment Framework
  34. 34. CHIPSEC: Platform Security Assessment Framework chipsec_main.py runs modules (see modules dir below) chipsec_util.py runs manual utilities (see utilcmd dir below) /chipsec /cfg platform specific configuration /hal all the HW stuff you can interact with /helper support for OS/environments /modules modules (tests/tools/PoCs) go here /utilcmd utility commands for chipsec_util
  35. 35. Known Threats and CHIPSEC modules Issue CHIPSEC Module References SMRAM Locking common.smm CanSecWest 2006 BIOS Keyboard Buffer Sanitization common.bios_kbrd_buffer DEFCON 16 2008 SMRR Configuration common.smrr ITL 2009 CanSecWest 2009 BIOS Protection common.bios_wp BlackHat USA 2009 CanSecWest 2013 Black Hat 2013 NoSuchCon 2013 Flashrom SPI Controller Locking common.spi_lock Flashrom Copernicus BIOS Interface Locking common.bios_ts PoC 2007 Access Control for Secure Boot Keys common.secureboot.keys UEFI 2.4 Spec Access Control for Secure Boot Variables common.secureboot.variables UEFI 2.4 Spec
  36. 36. BIOS/Firmware Forensics Live system firmware analysis chipsec_util spi info chipsec_util spi dump rom.bin chipsec_util spi read 0x700000 0x100000 bios.bin chipsec_util uefi var-list chipsec_util uefi var-read db D719B2CB-3D3A-4596-A3BC-DAD00E67656F db.bin Offline system firmware analysis chipsec_util uefi keys PK.bin chipsec_util uefi nvram vss bios.bin chipsec_util uefi decode rom.bin chipsec_util decode rom.bin
  37. 37. How to dump BIOS firmware directly from chip?
  38. 38. How to dump BIOS firmware directly from chip?
  39. 39. DEMO TIME
  40. 40. Thank you for your attention! Eugene Rodionov @vxradius Alexander Matrosov @matrosov David Harley @DavidHarleyBlog

    Sé el primero en comentar

    Inicia sesión para ver los comentarios

  • cwZerro

    Sep. 29, 2014
  • mnajem

    Sep. 30, 2014
  • youngjunchang14

    Oct. 16, 2014
  • hiropooh

    Aug. 13, 2015
  • fouaksel

    Jan. 26, 2017
  • NamishChaturvedi

    Feb. 28, 2019

Bootkit threats have always been a powerful weapon in the hands of cybercriminals, allowing them to establish persistent and stealthy presence in their victims' systems. The most recent notable spike in bootkit infections was associated with attacks on 64-bit versions of the Microsoft Windows platform, which restrict the loading of unsigned kernel-mode drivers. However, these bootkits aren't effective against UEFI-based platforms. So, are UEFI-based machines immune against bootkit threats (or would they be)? The aim of this presentation is to show how bootkit threats have evolved over time and what we should expect in the near future. Firstly, we will summarize what we've learned about the bootkits seen in the wild targeting the Microsoft Windows platform: from TDL4 and Rovnix (which was used by the Carberp banking trojan) up to Gapz (which employs one of the stealthiest bootkit infection techniques seen so far). We will review their infection approaches and the methods they have employed to evade detection and removal from the system. Secondly, we will look at the security of the increasingly popular UEFI platform from the point of view of the bootkit author, as UEFI is becoming a target of choice for researchers in offensive security, and proof-of-concept bootkits targeting Windows 8 OS using UEFI have already been released. We will focus on various attack vectors against UEFI and discuss available tools and what measures should be taken to mitigate against them.

Vistas

Total de vistas

2.088

En Slideshare

0

De embebidos

0

Número de embebidos

368

Acciones

Descargas

77

Compartidos

0

Comentarios

0

Me gusta

6

×