• Stars
    star
    114
  • Rank 308,031 (Top 7 %)
  • Language
    Rust
  • License
    MIT License
  • Created almost 2 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Rusty Hypervisor - Windows Blue Pill Type-2 Hypervisor in Rust (Codename: Matrix)

Windows Blue Pill Type-2 Hypervisor in Rust (Codename: Matrix)

Blog: https://memn0ps.github.io/hypervisor-development-in-rust-part-1/

This is a Rust-based research hypervisor for Intel VT-x virtualization, designed to be lightweight and focused on studying the core concepts. While it currently lacks memory management unit (MMU) virtualization using Intel Extended Page Tables (EPT), this feature is planned for future implementation.

Credit and gratitude are extended to the following individuals and their respective blogs or repositories for their invaluable contributions and references: @daax_rynd, @Intel80x86, @not_matthias, and @standa_t.

The inspiration for this endeavor emerged shortly after the release of @not_matthias's AMD SVM hypervisor in Rust, as well as the enlightening articles by Secret Club and the unveiling of DarthTon's HyperBone (based on the legendary Alex Ionescu's version) on UnknownCheats.

Furthermore, in my pursuit of knowledge and expertise, I have been preparing for the legendary Satoshi Tanda's Hypervisor Development for Security Researchers training, which has further fueled my determination to embark on this captivating journey of hypervisor development.

Additionally, I have gained valuable insights and knowledge from the exploration of BluePill by @_xeroxz (IDontCode) and various blog posts, such as AMD-V Hypervisor Development and Voyager - A Hyper-V Hacking Framework. The talented individuals at Back Engineering Labs have been instrumental in providing a wealth of information and expertise. Their contributions have served as a valuable reference, further enriching my understanding and inspiring me to delve deeper into this field.

Features

  • Type-2 Intel VT-x Hypervisor (under development): This hypervisor is being developed with a focus on Intel VT-x virtualization. The following features are currently in progress:

    • Extended Page Tables (EPT)
    • Model Specific Register (MSR) Bitmaps
  • Type-2 AMD SVM Hypervisor Integration: Integration of AMD SVM hypervisor support is planned for future development.

By combining these features, my goal is to create a comprehensive hypervisor solution that supports both Intel VT-x and AMD SVM virtualization technologies. I'm actively working on the Intel VT-x hypervisor and have plans to integrate the AMD SVM hypervisor in the future.

Install

Install Rust

To start using Rust, download the installer, then run the program and follow the onscreen instructions. You may need to install the Visual Studio C++ Build tools when prompted to do so.

Install and change to Rust nightly

rustup toolchain install nightly
rustup default nightly

Install cargo-make

cargo install cargo-make

Install WDK/SDK

  • Step 1: Install Visual Studio 2022
  • Step 2: Install Windows 11, version 22H2 SDK
  • Step 3: Install Windows 11, version 22H2 WDK

Build

Change directory to .\driver\ and build driver and hypervisor

cargo make sign

Enable Test Mode or Test Signing Mode

bcdedit /set testsigning on

[Optional] Debug via Windbg

bcdedit /debug on
bcdedit /dbgsettings net hostip:<IP> port:<PORT>

[Optional] Debug Print Filter

  • Navigate to: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager
  • Create a new Key called Debug Print Filter
  • Create a new DWORD (32) Value
  • Give it the name DEFAULT
  • Give it the Value data: 8

Create / Start Service

sc.exe create matrix type= kernel binPath= C:\Windows\System32\drivers\matrix.sys
sc.exe query matrix
sc.exe start matrix

Credits / References / Thanks / Motivation