CONTENTS IN DETAIL

FOREWORD by Rodrigo Rubira Branco

ACKNOWLEDGMENTS

ABBREVIATIONS

INTRODUCTION

Why Read This Book?

What’s in the Book?

Part 1: Rootkits

Part 2: Bootkits

Part 3: Defense and Forensic Techniques

How to Read This Book

PART I: ROOTKITS

1
WHAT’S IN A ROOTKIT: THE TDL3 CASE STUDY

History of TDL3 Distribution in the Wild

Infection Routine

Controlling the Flow of Data

Bring Your Own Linker

How TDL3’s Kernel-Mode Hooks Work

The Hidden Filesystem

Conclusion: TDL3 Meets Its Nemesis

2
FESTI ROOTKIT: THE MOST ADVANCED SPAM AND DDOS BOT

The Case of Festi Botnet

Dissecting the Rootkit Driver

Festi Configuration Information for C&C Communication

Festi’s Object-Oriented Framework

Plug-in Management

Built-in Plug-ins

Anti–Virtual Machine Techniques

Antidebugging Techniques

The Method for Hiding the Malicious Driver on Disk

The Method for Protecting the Festi Registry Key

The Festi Network Communication Protocol

Initialization Phase

Work Phase

Bypassing Security and Forensics Software

The Domain Generation Algorithm for C&C Failure

Malicious Functionality

The Spam Module

The DDoS Engine

Festi Proxy Plug-in

Conclusion

3
OBSERVING ROOTKIT INFECTIONS

Methods of Interception

Intercepting System Events

Intercepting System Calls

Intercepting the File Operations

Intercepting the Object Dispatcher

Restoring the System Kernel

The Great Rootkits Arms Race: A Nostalgic Note

Conclusion

PART II: BOOTKITS

4
EVOLUTION OF THE BOOTKIT

The First Bootkits

Boot Sector Infectors

Elk Cloner and Load Runner

The Brain Virus

The Evolution of Bootkits

The End of the BSI Era

The Kernel-Mode Code Signing Policy

The Rise of Secure Boot

Modern Bootkits

Conclusion

5
OPERATING SYSTEM BOOT PROCESS ESSENTIALS

High-Level Overview of the Windows Boot Process

The Legacy Boot Process

The Windows Boot Process

BIOS and the Preboot Environment

The Master Boot Record

The Volume Boot Record and Initial Program Loader

The bootmgr Module and Boot Configuration Data

Conclusion

6
BOOT PROCESS SECURITY

The Early Launch Anti-Malware Module

API Callback Routines

How Bootkits Bypass ELAM

Microsoft Kernel-Mode Code Signing Policy

Kernel-Mode Drivers Subject to Integrity Checks

Location of Driver Signatures

The Legacy Code Integrity Weakness

The ci.dll Module

Defensive Changes in Windows 8

Secure Boot Technology

Virtualization-Based Security in Windows 10

Second Level Address Translation

Virtual Secure Mode and Device Guard

Device Guard Limitations on Driver Development

Conclusion

7
BOOTKIT INFECTION TECHNIQUES

MBR Infection Techniques

MBR Code Modification: The TDL4 Infection Technique

MBR Partition Table Modification

VBR/IPL Infection Techniques

IPL Modifications: Rovnix

VBR Infection: Gapz

Conclusion

8
STATIC ANALYSIS OF A BOOTKIT USING IDA PRO

Analyzing the Bootkit MBR

Loading and Decrypting the MBR

Analyzing the BIOS Disk Service

Analyzing the Infected MBR’s Partition Table

VBR Analysis Techniques

Analyzing the IPL

Evaluating Other Bootkit Components

Advanced IDA Pro Usage: Writing a Custom MBR Loader

Understanding loader.hpp

Implementing accept_file

Implementing load_file

Creating the Partition Table Structure

Conclusion

Exercises

9
BOOTKIT DYNAMIC ANALYSIS: EMULATION AND VIRTUALIZATION

Emulation with Bochs

Installing Bochs

Creating a Bochs Environment

Infecting the Disk Image

Using the Bochs Internal Debugger

Combining Bochs with IDA

Virtualization with VMware Workstation

Configuring the VMware Workstation

Combining VMware GDB with IDA

Microsoft Hyper-V and Oracle VirtualBox

Conclusion

Exercises

10
AN EVOLUTION OF MBR AND VBR INFECTION TECHNIQUES: OLMASCO

The Dropper

Dropper Resources

Tracing Functionality for Future Development

Antidebugging and Antiemulation Tricks

The Bootkit Functionality

Bootkit Infection Technique

Boot Process of the Infected System

The Rootkit Functionality

Hooking the Hard Drive Device Object and Injecting the Payload

Maintaining the Hidden Filesystem

Implementing the Transport Driver Interface to Redirect Network Communication

Conclusion

11
IPL BOOTKITS: ROVNIX AND CARBERP

Rovnix’s Evolution

The Bootkit Architecture

Infecting the System

Post-Infection Boot Process and IPL

Implementing the Polymorphic Decryptor

Decrypting the Rovnix Bootloader with VMware and IDA Pro

Taking Control by Patching the Windows Bootloader

Loading the Malicious Kernel-Mode Driver

Kernel-Mode Driver Functionality

Injecting the Payload Module

Stealth Self-Defense Mechanisms

The Hidden Filesystem

Formatting the Partition as a Virtual FAT System

Encrypting the Hidden Filesystem

Accessing the Hidden Filesystem

The Hidden Communication Channel

Case History: The Carberp Connection

Development of Carberp

Dropper Enhancements

Leaked Source Code

Conclusion

12
GAPZ: ADVANCED VBR INFECTION

The Gapz Dropper

Dropper Algorithm

Dropper Analysis

Bypassing HIPS

Infecting the System with the Gapz Bootkit

Reviewing the BIOS Parameter Block

Infecting the VBR

Loading the Malicious Kernel-Mode Driver

Gapz Rootkit Functionality

Hidden Storage

Self-Defense Against Antimalware Software

Payload Injection

Payload Communication Interface

Custom Network Protocol Stack

Conclusion

13
THE RISE OF MBR RANSOMWARE

A Brief History of Modern Ransomware

Ransomware with Bootkit Functionality

The Ransomware Modus Operandi

Analyzing the Petya Ransomware

Acquiring Administrator Privileges

Infecting the Hard Drive (Step 1)

Encrypting with the Malicious Bootloader Configuration Data

Crashing the System

Encrypting the MFT (Step 2)

Wrapping Up: Final Thoughts on Petya

Analyzing the Satana Ransomware

The Satana Dropper

The MBR Infection

Dropper Debug Information

The Satana Malicious MBR

Wrapping Up: Final Thoughts on Satana

Conclusion

14
UEFI BOOT VS. THE MBR/VBR BOOT PROCESS

The Unified Extensible Firmware Interface

Differences Between the Legacy BIOS and UEFI Boot Processes

The Boot Process Flow

Disk Partitioning: MBR vs. GPT

Other Differences

GUID Partition Table Specifics

How UEFI Firmware Works

The UEFI Specification

Inside the Operating System Loader

The Windows Boot Loader

Security Benefits of UEFI Firmware

Conclusion

15
CONTEMPORARY UEFI BOOTKITS

Overview of Historical BIOS Threats

WinCIH, the First Malware to Target BIOS

Mebromi

An Overview of Other Threats and Counters

All Hardware Has Firmware

UEFI Firmware Vulnerabilities

(In)Effectiveness of Memory Protection Bits

Checks for Protection Bits

Ways to Infect the BIOS

Modifying an Unsigned UEFI Option ROM

Adding or Modifying a DXE Driver

Understanding Rootkit Injection

UEFI Rootkits in the Wild

Hacking Team’s Vector-EDK Rootkit

Conclusion

16
UEFI FIRMWARE VULNERABILITIES

What Makes Firmware Vulnerable?

Classifying UEFI Firmware Vulnerabilities

Post-Exploitation Vulnerabilities

Compromised Supply Chain Vulnerabilities

Supply Chain Vulnerability Mitigation

A History of UEFI Firmware Protections

How BIOS Protections Work

SPI Flash Protections and Their Vulnerabilities

Risks Posed by an Unauthenticated BIOS Update

BIOS Protection with Secure Boot

Intel Boot Guard

Intel Boot Guard Technology

Vulnerabilities in Boot Guard

Vulnerabilities in the SMM Modules

Understanding SMM

Exploiting SMI Handlers

Vulnerabilities in the S3 Boot Script

Understanding the S3 Boot Script

Targeting Weaknesses of the S3 Boot Script

Exploiting the S3 Boot Script Vulnerability

Fixing the S3 Boot Script Vulnerability

Vulnerabilities in the Intel Management Engine

A History of ME Vulnerabilities

ME Code Attacks

Case Studies: Attacks on Intel AMT and BMC

Conclusion

PART III: DEFENSE AND FORENSIC TECHNIQUES

17
HOW UEFI SECURE BOOT WORKS

What Is Secure Boot?

UEFI Secure Boot Implementation Details

The Boot Sequence

Executable Authentication with Digital Signatures

The db Database

The dbx Database

Time-Based Authentication

Secure Boot Keys

UEFI Secure Boot: The Complete Picture

Secure Boot Policy

Protection Against Bootkits Using Secure Boot

Attacking Secure Boot

Patching PI Firmware to Disable Secure Boot

Modifying the UEFI Variables to Bypass Security Checks

Protecting Secure Boot with Verified and Measured Boot

Verified Boot

Measured Boot

Intel BootGuard

Finding the ACM

Exploring FIT

Configuring Intel BootGuard

ARM Trusted Boot Board

ARM Trust Zone

ARM Boot Loaders

Trusted Boot Flow

Verified Boot vs. Firmware Rootkits

Conclusion

18
APPROACHES TO ANALYZING HIDDEN FILESYSTEMS

Overview of Hidden Filesystems

Retrieving Bootkit Data from a Hidden Filesystem

Retrieving Data from an Offline System

Reading Data on a Live System

Hooking the Miniport Storage Driver

Parsing the Hidden Filesystem Image

The HiddenFsReader Tool

Conclusion

19
BIOS/UEFI FORENSICS: FIRMWARE ACQUISITION AND ANALYSIS APPROACHES

Limitations of Our Forensic Techniques

Why Firmware Forensics Matter

Attacking the Supply Chain

Compromising BIOS Through Firmware Vulnerability

Understanding Firmware Acquisition

The Software Approach to Firmware Acquisition

Locating PCI Configuration Space Registers

Calculating SPI Configuration Register Addresses

Using the SPI Registers

Reading Data from the SPI Flash

Considering the Drawbacks of the Software Approach

The Hardware Approach to Firmware Acquisition

Reviewing a Lenovo ThinkPad T540p Case Study

Locating the SPI Flash Memory Chip

Reading the SPI Flash with the FT2232 Mini Module

Analyzing the Firmware Image with UEFITool

Getting to Know the SPI Flash Regions

Viewing SPI Flash Regions with UEFITool

Analyzing the BIOS Region

Analyzing the Firmware Image with Chipsec

Getting to Know the Chipsec Architecture

Analyzing Firmware with Chipsec Util

Conclusion

INDEX

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset