• Stars
    star
    476
  • Rank 92,280 (Top 2 %)
  • Language
    C++
  • Created over 4 years ago
  • Updated almost 4 years ago

Reviews

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

Repository Details

PoC EFI runtime driver for memory r/w & kdmapper fork

Efi-memory is a proof-of-concept EFI runtime driver for reading and writing to virtual memory. It uses EfiGuards method of hooking SetVariable to communicate with the user-mode process. Here is an example how it works.

Repo content

driver/

  • EFI driver itself

client/efi-mapper/

  • kdmapper fork that uses efi-memory to manual map any Windows driver

Compiling

Compiling any of the example client programs is pretty simple. Open the solution file in Visual Studio and compile the project with it's default settings.

Compiling the driver is also pretty simple. First you need a working Linux install (or you can use Linux subsystem for Windows) and install gnu-efi (commands for Ubuntu 20.04):

sudo apt install gnu-efi build-essential

That's all you need to install. Package manager (in the example apt) should take care of all the depencies for you. Once the installation is complete, clone this repo (make sure you have git installed):

git clone https://github.com/SamuelTulach/efi-memory

Than navigate to the driver folder and compile the driver with make:

cd efi-memory
cd driver
make

If the compile was successful, you should now see memory.efi in the driver folder.

Usage

In order to use the efi-memory driver, you need to load it. First, obtain a copy of memory.efi (compile it or download it from release section) and a copy of EDK2 efi shell. Now follow these steps:

  1. Extract downloaded efi shell and rename file Shell.efi (should be in folder UefiShell/X64) to bootx64.efi
  2. Format some USB drive to FAT32
  3. Create following folder structure:
USB:.
 │   memory.efi
 │
 └───EFI
      └───Boot
              bootx64.efi
  1. Boot from the USB drive
  2. An UEFI shell should start, change directory to your USB (FS0 should be the USB since we are booting from it) and list files:
FS0:
ls
  1. You should see file memory.efi, if you do, load it:
load memory.efi
  1. Now there should be a nice efi-memory ascii logo printed in your UEFI shell. If there is, the driver was loaded successfuly. If that is the case, type exit to start standard boot procedure (while Windows is booting the screen should go blue with confirmation text)

Thanks

I would like to thank @z175 for kdmapper project since that is a masterpiece. @Mattiwatti for EfiGuard project and the idea of SetVariable hooking. Roderick W. Smith for rodsbooks.com (really useful site to read about EFI basics).

License

This repo is licensed under MIT if not stated otherwise in subfolders.

More Repositories

1

VirusTotalUploader

C# Open-Source Winforms application for uploading files to VirusTotal
C#
1,128
star
2

mutante

Kernel-mode Windows HWID spoofer
C++
524
star
3

rainbow

Hide SMBIOS/disk/NIC serials from EFI bootkit
C
270
star
4

negativespoofer

PoC HWID spoofer that runs in EFI
C++
269
star
5

LightHook

Single-header, minimalistic, cross-platform hook library written in pure C
C++
246
star
6

RwxMeme

State of the art DLL injector that took 20 minutes to make
C++
192
star
7

tpm-spoofer

Simple proof of concept kernel mode driver hooking tpm.sys dispatch to randomize any public key reads
C
179
star
8

nullmap

Using CVE-2023-21768 to manual map kernel mode driver
C
171
star
9

memhv

Minimalistic AMD-V/SVM hypervisor with memory introspection capabilities
C++
152
star
10

meme-rw

Archive R/W into any protected process by changing the value of KTHREAD->PreviousMode
C++
146
star
11

OverlayCord

Simple proof of concept showing how you can abuse Discord's in-game internal module to draw on top of the game (even if the game is in fullscreen) from an external application without modifying any Discord files or loading its modules.
C++
139
star
12

SecureFakePkg

Simple EFI runtime driver that hooks GetVariable function and returns data expected by Windows to make it think that it's running with secure boot enabled (faking secure boot)
C
125
star
13

BetterTiming

PoC TSC offsetting in KVM
122
star
14

PwnedBoot

Using Windows' own bootloader as a shim to bypass Secure Boot
C
103
star
15

voidmap

Using CVE-2021-40449 to manual map kernel mode driver
C
97
star
16

CanetisRadar

Open-source application for detecting sound direction using 7.1 audio device in games
C#
93
star
17

PatchBoot

Guide for patching AMI Aptio V UEFI firmware to circumvent Secure Boot checks
87
star
18

windowhide

Hide external overlay by using SetWindowDisplayAffinity
C++
86
star
19

DirectPageManipulation

A basic demonstration of directly overwriting paging structures for physical memory r/w and interprocess memory copy
C++
75
star
20

ImGui-AppKit

Project template for single-window GUI apps using Dear ImGui
C++
44
star
21

eac_cr3_shuffle

C++
41
star
22

ida-unity-pdb-downloader

Simple IDA Pro plugin to download Unity debug symbols from their symbol server
C++
41
star
23

EfiDump

PoC EFI runtime driver for direct Windows interprocess memory copy
C
37
star
24

InjectMouseInputExample

C/C++ example of InjectMouseInput function
C++
30
star
25

MemoryGuard

Experiment with PAGE_GUARD protection to hide memory from other processes
C
29
star
26

human-mouse

Adopted SRL-6 mouse movement to C++
C++
29
star
27

memdrv

C++
26
star
28

GetDeviceInterfacesMemoryLeak

Small memory leak PoC that is happening in IopGetDeviceInterfaces
C++
24
star
29

SaberHighlight

Beat Saber mod enabling NVIDIA Highlights functionality
C#
24
star
30

be_shellcode_dump

December 2023 BattlEye shellcode dump
C
24
star
31

SoundReplacer

BSIPA mod for replacing hit sounds, menu music, click sounds and much more!
C#
19
star
32

EvilKaspersky

C++
19
star
33

vmcheck

C
18
star
34

OcuFix

Simple mod to automatically disable ASW and change services/runtime priority
C#
16
star
35

RecoilTime

A simple program made in C# for reducing recoil in games under Windows environment
C#
14
star
36

EasyUefi

Visual Studio template for GNU-EFI
C
14
star
37

eft-profile-api

Reversing the newly added EFT feature that allows you to view other players' stats
C#
13
star
38

EmuAuth

KeyAuth server emulator
C++
11
star
39

DiscordLeech

Read Discord user info from process memory
C#
10
star
40

esea-control

Simple program to temporarly disable ESEA anti-cheat
C#
9
star
41

lrdp

8
star
42

InactiveTitlebarPatch

Simple registry patch to turn inactive title bar color dark
8
star
43

ByeMouse

C#
5
star
44

obs-dda

C
3
star
45

EasyDump

C#
3
star
46

PowerControl

C#
3
star
47

MapPasswordTool

TM2020 tool to remove password lock for editing from maps
C#
2
star
48

virtmgr

C++
2
star
49

OneplusDebloat

Remove crappy useless apps in Oxygen OS (both 3rd party and Google)
Shell
2
star
50

NekoSwap

C++
1
star