Code Monkey home page Code Monkey logo

illusion-rs's Introduction

About

Hi, I'm memN0ps.

I develop experimental projects, often utilizing a substantial amount of unsafe Rust code. I'm passionate about open-source and hope that my contributions can benefit the community. My projects primarily serve as proofs-of-concept and may require a certain level of expertise and potential modifications to function correctly. I intentionally design certain projects to be challenging to discourage copy-pasting, malicous use and to emphasize understanding. Additionally, due to time constraints and laziness, I don’t create projects requiring ongoing support. While C was my first language, I ultimately focused on Rust after exploring various programming languages. Please don't contact me for help with bypassing anti-cheats, AVs, EDRs, bug fixes, issue resolutions, or OPSEC-related matters in my archived projects. I would appreciate proper attribution if you use my code; otherwise, please refrain from using it.

My interest in information security sparked during my university years while studying computer science, and exploring game hacking (CS:GO). This initial exploration then led me to engage in Hack The Box (CTF) challenges and participate in various information security courses and trainings. Over the last 6 years, I've explored various aspects of hacking, coding, reverse engineering, and software exploitation. It’s only recently that I’ve managed to allocate time for projects like developing a Windows Kernel Rookit in Rust (Codename: Eagle), Windows UEFI Bootkit in Rust (Codename: RedLotus), Windows Blue Pill Type-2 Hypervisor in Rust (Codename: Matrix), Windows UEFI Blue Pill Type-1 Hypervisor in Rust (Codename: Illusion), and Shellcode Reflective DLL Injection (sRDI) in Rust (Codename: Venom). These projects have helped me refine my goals and fuel my passion for security research, pushing me to expand my knowledge in this field continuously.

I've explored various areas without specializing in one, but now I'm seeking a niche to channel my passion and expertise. I consider myself a lifelong learner, and everything I do is driven by a desire for fun and learning during my spare time. All of my code is under the MIT license.

More information: https://memn0ps.github.io/about/

Note: All of my projects serve as proof-of-concept (PoCs) and are not intended for production use. Furthermore, all of them have been archived. Any future tools and projects will remain private for personal use only.

Disclaimer: For Educational Use Only

The content in my repositories is solely for educational and informational purposes, intended to foster security awareness. Any illegal or malicious use is strictly prohibited. By accessing this content, you agree to use it responsibly, and I’m not liable for any misuse or damage. Use at your own risk and ensure compliance with all applicable laws and permissions.

Please Read Before Contacting

Direct contact is reserved for those I have previously interacted with or who have been referred by mutual connections. Due to excessive unsolicited contacts and irrelevant issues, the Issues feature is disabled on all repositories.

If we have prior communication, feel free to reach out as usual. Thank you for understanding and respecting this boundary.

illusion-rs's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

illusion-rs's Issues

Implement Support for Running as a Nested Hypervisor Under Microsoft Hyper-V (Type-2) with VBS

Issue: Support for running as a nested hypervisor under Microsoft Hyper-V with Virtualization Based Security (VBS).

Environment: UEFI Rust hypervisor, with partial support for Hyper-V nested virtualization.

Current Status:

  • Implemented: Out of Range MSRs and Hyper-V Interface CPUID Leaves.
  • Pending:
    1. Implementation of Hyper-V Hypercalls (VMCALLs).
    2. Transition to Advanced Configuration and Power Interface (ACPI) from the older Multiprocessor Specification (MP Protocol).

Required Implementation:

  1. Hyper-V Hypercalls (VMCALLs) - Essential for managing interactions between the hypervisor and the nested virtual machine (VM). This includes recognizing and correctly handling VMCALLs from both the hypervisor and nested VMs to maintain system stability and functionality.
  2. Advanced Configuration and Power Interface (ACPI) - Transition from MP Protocol to ACPI is necessary to meet Hyper-V's configuration and power management standards.

Current Behavior: Without proper VMCALL handling and ACPI support, the hypervisor cannot correctly interact with Hyper-V, leading to potential failures or incorrect operations under Hyper-V nested virtualization.

Expected Behavior:

  • The hypervisor should intercept and manage VMCALLs effectively, ensuring smooth operation and compatibility within a Hyper-V environment.
  • Transition to ACPI support to enhance compatibility with Hyper-V's power management and configuration requirements.

Steps to Reproduce:

  1. Set up the hypervisor with Hyper-V.
  2. Observe operational issues related to unhandled VMCALLs and potential issues due to MP Protocol usage instead of ACPI.

Additional Information:
Implementing these functionalities is crucial for ensuring that the hypervisor can run efficiently under Hyper-V, handling all necessary hypercalls and configuration protocols as expected by the Hyper-V Hypervisor Top-Level Functional Specification (TLFS). Transitioning to ACPI will address compatibility issues with Hyper-V's advanced power management features.

AMD-V (SVM) Support

Plan to explore AMD support with Nested Page Tables (NPT) in the future, aiming for implementation within one year.

Support JMP, INT3, VMCALL, and CPUID Hooks Based on User Preference

The Windows hypervisor matrix-rs hook mechanism in the library relies on INT3, which causes VM exits and potential performance issues. To offer users flexibility, the hypervisor needs to support JMP, INT3, VMCALL, and CPUID hooks, allowing them to choose the preferred method based on their requirements. Additionally, supporting relative JMP hooks is essential for improved efficiency. Careful consideration should be given to selecting the appropriate library for hooking implementation.

Note: INT3, VMCALL, CPUID hooks will cause a vmexit.

Careful consideration should be given to allocating and executing the trampoline, which would be allocated in the host address space unless specified otherwise. This would disallow the guest to execute the allocated trampoline on the host PA space unless the guest itself allocates memory, but that would expose the trampoline. Alternative ways should be explored e.g Manipulation of EPT…

Develop Functionality Without Reliance on x86 Crate

Avoid using the x86 crate overall and develop the necessary functionality from scratch. This approach will facilitate learning and reduce dependence on external libraries, potentially increasing accuracy. However, it may require more effort. This task is optional and not urgent.

Option for Hypervisor Graceful Shutdown Over Panic

Errors in the hypervisor are typically handled using a custom error type, HypervisorError, through Result or Option. Despite this, errors default to causing a panic in the vmm.rs file, particularly during critical issues that necessitate halting the hypervisor. This panic approach, while highlighting problems quickly, isn't always ideal, especially when a graceful shutdown would be preferable. It can hinder debugging and disrupt processes unnecessarily, although there are cases where shutting down the hypervisor isn't desired, and panicking is the preferred option. I personally prefer handling all errors with a custom error type, returning Result<(), HypervisorError>, and funneling them to a single location in the main function (vmm.rs). If an error cannot be handled and I no longer want the hypervisor running or off, I opt for panicking the Windows guest OS (BSOD).

To improve the hypervisor's adaptability and robustness, a mechanism for a graceful shutdown and CPU devirtualization could be a better option. This would involve executing VMXOFF to cleanly exit VMX operation, restoring any altered states during VMXON, and orderly devirtualizing CPUs.

Serial Logs Freeze Post-Windows Boot

Issue: Serial logs stop updating after Windows OS boots, although the hypervisor continues to run.

Expected Behavior: Serial logs should continue to output after Windows OS boots.

Actual Behavior: Logs freeze upon Windows boot.

Steps to Reproduce:

  1. Boot Windows OS in the hypervisor environment.
  2. Observe the serial logs.

Additional Info: Hypervisor remains operational; issue only affects log visibility.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.