diff --git a/README.md b/README.md index 589c7a1..74aae07 100644 --- a/README.md +++ b/README.md @@ -7,4 +7,30 @@ # HMDM - Highly Modular Driver Mapper -HMDM is a driver mapper which uses any method to allocate kernel memory and any method to copy kernel memory to map unsigned code into the windows kernel. This project is based off of physmeme and is what I intended on creating originally, but was unable to. This repo contains two examples of HMDM, one with VDM (Vulnerable Driver Manipulation of drivers exposing arbitrary physical memory read and write), and the other example using MSREXEC which uses any driver that can write to arbitrary MSR's to elevate to kernel execution. Besides VDM and MSREXEC, one could use any other method of executable kernel memory allocation and arbitrary kernel writes to interface with `drv::hmdm_ctx`. \ No newline at end of file +HMDM is a driver mapper which uses any method to allocate kernel memory and any method to copy kernel memory to map unsigned code into the windows kernel. This project is based off of physmeme and is what I intended on creating originally, but was unable to. This repo contains two examples of HMDM, one with VDM (Vulnerable Driver Manipulation of drivers exposing arbitrary physical memory read and write), and the other example using MSREXEC which uses any driver that can write to arbitrary MSR's to elevate to kernel execution. Besides VDM and MSREXEC, one could use any other method of executable kernel memory allocation and arbitrary kernel writes to interface with `drv::hmdm_ctx`. + +### Getting Started + +In order to create a `drv::hmdm_ctx`, one must first declare two lambdas. One lambda for allocating executable kernel memory, and another lambda for arbitrary kernel writes. Programmers can use any vulnerabilities to facilitate these requirements. + +#### executable kernel memory allocation + +Here are two examples of `drv::kalloc_t` lambdas. + +###### kalloc - VDM + +```cpp +vdm::vdm_ctx vdm(_read_phys, _write_phys); +drv::kalloc_t _kalloc = [&](std::size_t size) -> void* +{ + using ex_alloc_pool_t = + void* (*)(std::uint32_t, std::uint32_t); + + static const auto ex_alloc_pool = + reinterpret_cast( + utils::kmodule::get_export( + "ntoskrnl.exe", "ExAllocatePool")); + + return vdm.syscall(ex_alloc_pool, NULL, size); +}; +``` \ No newline at end of file