System Programming Lab

The next public class is September 30 - October 3 at Hexacon in Paris (in-person)

Hypervisor Development for Security Researchers on the Intel Platform

Overview

This course helps you gain the skills and knowledge to develop lightweight hypervisors as UEFI modules using Intel VT-x. This is a hands-on heavy class, and we will spend about 40% of the time with excesses.

In addition to the live sessions, you will receive materials beforehand and a recording after each day, and can ask questions asynchronously even after the period of the class. This is particularly helpful for those with challenging time zone differences (see Format and Package for more details).

Audiences

This class is geared towards software developers, security researchers, and those interested in expanding their knowledge of Intel VT-x, the x86_64 system architecture, and/or UEFI.

Level

Prerequisites

Required:

We will introduce recommended pre-class learning materials about 3 weeks prior to the class.

Learning Objectives

At the end of the class, you will gain enough knowledge and skills to develop your pass-through hypervisors. Covered topics include but are not limited to:

Outline

  1. Hypervisor and UEFI
    • Lectures: various use of hypervisors, UEFI module-based hypervisors, comparison with kernel module-based hypervisors, and UEFI/EDK2
  2. VT-x Basics
    • Lectures: processor modes, VMCS, “host” vs “guest”, VM-exit, VM-entry, and high-level design options
    • Lab: source-level debugging with VMware
    • Lab: configuring and starting host and guest, monitoring CPUID execution
    • Lab: troubleshooting VMX instruction errors with Bochs
  3. OS Boot
    • Lectures: system boot phases, boot time vs runtime, physical vs virtual mode, and runtime drivers for monitoring OS activities
    • Lab: controlling VM-exits with MSR bitmaps
    • Lab: booting Windows and isolating resources between guest and host
    • Lab: tracing guest page faults with exception interception and event injection
    • Advanced lectures and demos: analysis of Hyper-V configurations and common vulnerabilities in pass-through hypervisors
  4. Extended Page Tables (EPT)
    • Lectures: traditional x64 address translation vs EPT-enabled translation, EPT setup and activation, EPT-induced VM-exits
    • Lab: building and enabling pass-through EPT
    • Lab: tracing guest execution with EPT
    • Advanced lectures and demos: memory types emulation, caches invalidation, VPID, stealth hooking with EPT, MBEC, VT-rp (HLAT), device virtualization and VT-d (IOMMU/DMA remapping)
  5. Multi-processors Support
    • Lectures: multi-processor protocol, processor activity state, application processors startup, unrestricted guest, Hypervisor Top Level Functional Specification (TLFS) and enlightenment
    • Lab: virtualizing all processors
    • Lab: booting multi-processor Windows by emulating INIT-SIPI-SIPI
  6. Control Register Shadowing
    • Lectures: control register guest/host mask, read shadow VMCS, and complexities with emulation of control register access
    • Lab: booting Ubuntu by properly emulating MOV-to-CRx
  7. Demos and References
    • Nested virtualization (software-based, VMCS shadowing, enlightened VMCS, EPT virtualization strategies), snapshot-based fuzzing hypervisors, PPAM, hardware debuggers (DCI), single board computers, and relevant open source projects

Contents may change in a way that does not impact the learning objectives.

Details

A hypervisor is a critical component in cloud computing, and there is also an increasing interest in applying virtualization technologies in software security and analysis. How can hypervisors be used to secure system software? How to write custom hypervisors to perform reverse engineering and fuzzing more efficiently?

In this class, you will have the answers to those questions by developing simple hypervisors together. The class is designed in a way such that everything is built from scratch and optimized for learning. This allows you to better understand the building blocks of real-world applied use of virtualization technologies and expand the knowledge for their interests afterward.

This is a hands-on-oriented class. We believe that we can learn and retain knowledge best by tackling concrete challenges and not by being taught. With this philosophy, the class is designed for lab activities as the primary learning opportunities, and lectures are to explain the theories behind them. We will spend about 40% of the time on hands-on exercises.

At the beginning of the class, you will receive a skeleton implementation of a hypervisor and incrementally update it through a series of exercises along with discussions of other design options to understand the pros and cons.

As we learn concepts, we will discuss various applications of virtualization technologies and their implementations. This includes snapshot-based system-level fuzzing, performant system hardening with MBEC and HLAT (VT-rp), eg, HyperGuard, HVCI and KDP on Windows, dynamic analysis with stealth-hooking, and SMM security reporting (PPAM).

Additionally, you will receive a full version of our hypervisor. This includes the implementation of advanced concepts, such as stealth-hooking hypercall, use of VT-d (DMA protection), guest hardening, host hardening with CET, SMAP, and UMIP, and handling of uncommon events like microcode update, NMI, and MTRR updates. This version can complement your understanding of advanced topics and be a reference to explore more as you wish.

Hypervisor_Development_for_Security_Researchers.png

Pricing

Type Individual Company
Early Bird 2700 USD 3600 USD
Standard 3000 USD 4000 USD

All prices are per seat.

Format and Package

Format:

Package:

📝 It is perfectly fine to start learning yourself earlier, skip live sessions, watch recordings, and ask questions asynchronously at your own pace by taking advantage of the package. One of past students did this and successfully developed his hypervisor from scratch! The trainer is here for you to learn in any reasonable style that works for both of us.

Hardware and Software Requirements

You are expected to have the following hardware and software:

The newer versions of the operating systems and other software are supported. Older versions of software and another Linux distro may be workable but not tested. Other hypervisors such as KVM, Hyper-V, or VirtualBox cannot be used.

The host system can also be a cloud-provided machine if the host machine cannot be arranged locally. Those are confirmed to be usable:

Contact us for suggestions if you need a cloud-provided machine.

You are expected to complete the setup instructions that will be sent by the instructor before the class.

Registration and Contacts