A custom CLI tool for manually mapping Windows kernel-mode drivers into physical memory by exploiting the iqvw64e.sys Intel driver vulnerability (CVE-2015-2291). Designed for stealth operations with comprehensive anti-forensic countermeasures.
⚠️ WARNING: This project is for educational purposes only. I am not responsible for any misuse of this software.
- How It Works
- System Requirements
- Build Instructions
- Usage
- Technical Details
- Anti-Forensic Features
- Driver Requirements
- Limitations
- License
STKMapper loads a driver into kernel memory without using standard Windows driver loading APIs (like ZwLoadDriver or the Service Control Manager). Instead, it performs manual mapping — a technique that bypasses Windows driver signature enforcement (DSE).
┌─────────────────────────────────────────────────────────────┐
│ 1. Open iqvw64e.sys (vulnerable Intel driver) │
│ └─ Uses IOCTL 0x8086200B to map physical memory │
├─────────────────────────────────────────────────────────────┤
│ 2. Parse the target .sys driver PE image │
│ └─ Validate DOS/NT headers, enumerate sections │
├─────────────────────────────────────────────────────────────┤
│ 3. Allocate contiguous physical memory │
│ └─ Scan 1MB–256MB range for free pages (0xFF probe) │
│ └─ Map physical pages to user-space via IOCTL │
├─────────────────────────────────────────────────────────────┤
│ 4. Copy PE sections to allocated kernel memory │
│ └─ Headers → kernel base │
│ └─ Each section → kernel base + section.VirtualAddress │
├─────────────────────────────────────────────────────────────┤
│ 5. Fix relocations (base address delta patching) │
│ └─ Process IMAGE_DIRECTORY_ENTRY_BASERELOC blocks │
│ └─ Apply delta = actualBase - preferredBase │
├─────────────────────────────────────────────────────────────┤
│ 6. Resolve imports (kernel API functions) │
│ └─ Use NtQuerySystemInformation to find ntoskrnl.exe │
│ └─ Parse ntoskrnl.exe exports to resolve function addrs │
├─────────────────────────────────────────────────────────────┤
│ 7. Erase PE headers from kernel memory (stealth) │
│ └─ Zero out SizeOfHeaders bytes at kernel base │
├─────────────────────────────────────────────────────────────┤
│ 8. Call ManualMapEntry(BaseAddress) │
│ └─ Find entry point via exports or AddressOfEntryPoint │
│ └─ Execute the driver's initialization routine │
├─────────────────────────────────────────────────────────────┤
│ 9. Self-destruct (anti-forensic cleanup) │
│ └─ Scramble PEB, delete prefetch, timestomp, etc. │
└─────────────────────────────────────────────────────────────┘
Instead of using VirtualAlloc/MmAllocateContiguousMemory, STKMapper:
- Scans physical memory from
0x100000(1MB) to0x10000000(256MB) looking for pages filled with0xFF(indicating unmapped/free memory). - Maps each candidate page into user space via the vulnerable driver's
IOCTL_IQVW64E_MAP_IO_SPACE(0x8086200B). - Probes the first byte — if it's
0xFF, the page is likely free. - Verifies contiguity by checking all pages in the required range.
- Maps the full region and zeroes it out for use as the driver's execution space.
Since the driver runs in kernel memory but is loaded from user space, it needs kernel function addresses. STKMapper:
- Calls
NtQuerySystemInformation(SystemModuleInformation, ...)to enumerate loaded kernel modules. - Finds
ntoskrnl.exein the module list and gets its kernel base address. - Loads
ntoskrnl.exeas a data file (without resolving imports) usingLoadLibraryExA(..., DONT_RESOLVE_DLL_REFERENCES). - Uses
GetProcAddresson the local copy to find function RVAs. - Calculates the actual kernel address:
kernelBase + functionRVA.
| OS | Support | Notes |
|---|---|---|
| Windows 10 x64 | ✅ Supported | All versions (1507–22H2) |
| Windows 11 x64 | ✅ Supported | All versions |
| Windows Server 2016 x64 | ✅ Supported | |
| Windows Server 2019 x64 | ✅ Supported | |
| Windows Server 2022 x64 | ✅ Supported | |
| Windows 7 x64 | Requires iqvw64e.sys availability | |
| Windows 8/8.1 x64 | Requires iqvw64e.sys availability | |
| x86 (32-bit) | ❌ Not supported | 64-bit only (AMD64) |
- Architecture: x64 (AMD64) only
- Privileges: Administrator rights (required for SCM access and IOCTL calls)
- Vulnerable Driver:
iqvw64e.sysmust be present atC:\Windows\System32\drivers\iqvw64e.sys- This is the Intel QuickPath Interconnect driver with a known physical memory mapping vulnerability
- Target Driver: A 64-bit kernel-mode driver (.sys) with a
ManualMapEntryexport
- Compiler: MSVC (Visual Studio 2022 or later) with C++17 support
- SDK: Windows 10 SDK (10.0.19041.0 or later)
- Build command:
Or open
cl /EHsc /std:c++17 stkmapper\mapper.cpp /Fe:stkmapper.exestkmapper.slnxin Visual Studio and build the solution.
stkmapper.exe <driver.sys>stkmapper.exe C:\Users\admin\Desktop\mydriver.sys========================================
[*] Initializing vulnerable driver interface...
========================================
[+] Vulnerable driver interface opened
========================================
[*] Loading driver image...
[+] Image base: 0x00007FF700000000, size: 0x5000
[+] Sections: 3
========================================
[*] Allocating kernel memory...
[*] Searching for free physical memory region...
[+] Kernel memory at 0x1a00000 (virtual: 0x7ffe0000)
========================================
[*] Fixing relocations...
[+] Fixed 42 relocations
========================================
[*] Resolving imports...
[+] Resolved 15 imports
========================================
[*] Erasing PE headers...
[+] PE headers erased from kernel memory
========================================
[*] Calling ManualMapEntry...
[+] Entry point at 0x7ffe0000
[+] Calling with BaseAddress = 0x7ffe0000
[+] ManualMapEntry returned: 0x00000000
========================================
[*] Cleaning up traces...
[*] Unloading vulnerable driver...
[*] Vulnerable driver stopped
[*] Vulnerable driver service deleted
========================================
[+] Driver loaded successfully!
[+] Driver base (kernel VA): 0x7ffe0000
========================================
| Code | Meaning |
|---|---|
0 |
Success — driver loaded and self-deletion initiated |
1 |
Failure — see error message for details |
The Intel iqvw64e.sys driver exposes two critical IOCTLs:
| IOCTL | Code | Function |
|---|---|---|
IOCTL_IQVW64E_MAP_IO_SPACE |
0x8086200B |
Maps physical memory to user-space virtual address |
IOCTL_IQVW64E_UNMAP_IO_SPACE |
0x8086200F |
Unmaps previously mapped physical memory |
These IOCTLs allow any user-mode process (with a handle to the driver) to read/write arbitrary physical memory, effectively providing ring-0 access from user mode.
The project includes a standalone pe_structures.h header that defines all necessary PE structures (IMAGE_DOS_HEADER, IMAGE_NT_HEADERS64, IMAGE_SECTION_HEADER, etc.) without requiring the Windows Driver Kit (WDK). The header is designed to:
- Work standalone when compiled without Windows SDK headers
- Gracefully coexist with Windows SDK headers (via
#ifndef _WINNT_guard) - Always define custom helper macros (
IMAGE_FIRST_SECTION,IMAGE_RELOCATION_COUNT, etc.)
┌──────────────────────────────┐
│ DOS Header (64 bytes) │ ← kernelBase
├──────────────────────────────┤
│ NT Headers │
│ ├─ Signature (PE\0\0) │
│ ├─ File Header │
│ └─ Optional Header64 │
├──────────────────────────────┤
│ Section Headers │
│ └─ .text, .data, .rdata │
├──────────────────────────────┤
│ Section Data │
│ ├─ .text (code) │ ← kernelBase + section[0].VirtualAddress
│ ├─ .data (data) │
│ └─ .rdata (read-only data) │
├──────────────────────────────┤
│ Import Address Table (IAT) │
│ └─ Resolved function addrs │
├──────────────────────────────┤
│ Base Relocation Table │
│ └─ Already applied │
└──────────────────────────────┘
After EraseHeaders(), the DOS and NT headers at the base are zeroed out, making forensic analysis of the memory dump more difficult.
STKMapper includes comprehensive anti-forensic countermeasures that activate after successful driver loading:
- XOR-scrambles the Process Environment Block's
CommandLineandImagePathNamebuffers - Prevents tools like Process Explorer from showing the correct executable path
- Uses incrementing XOR keys (
0xAA + i,0xBB + i)
- Deletes
C:\Windows\Prefetch\mapper-*.pffiles - Prevents Windows from recording execution history
- Uses wildcard matching since the prefetch hash is unpredictable
- Reads timestamps from
notepad.exe(orcalc.exeas fallback) - Applies the same creation/modification/access timestamps to the mapper executable
- Makes it appear as if the file was never modified
- Cleans
ComDlg32\OpenSavePidlMRUentries - Cleans
ComDlg32\LastVisitedPidlMRUentries - Scans both binary (REG_BINARY) and string (REG_SZ) data for executable name/directory matches
- Calls
system("cls")to clear all console output
- Launches a hidden
cmd.exechild process with a 3-second delay - The child process deletes the
.exefile after the main process exits - Uses
choice /C Y /N /D Y /T 3for the delay, thenDelto remove the file - The main process calls
ExitProcess(0)immediately
The target driver (.sys file) must meet these requirements:
- 64-bit (AMD64) — x86 drivers are not supported
- PE32+ format — Must use the PE32+ optional header (Magic = 0x020B)
- Export
ManualMapEntry— The driver should export a function namedManualMapEntrywith the signature:IfNTSTATUS ManualMapEntry(PVOID BaseAddress);
ManualMapEntryis not found in exports, the tool falls back toAddressOfEntryPoint.
Your driver should include something like:
#pragma section("MANUALMAP", read, execute)
__declspec(allocate("MANUALMAP"))
NTSTATUS ManualMapEntry(PVOID BaseAddress) {
// Your initialization code here
// BaseAddress points to the driver's base in kernel memory
// Example: call DriverEntry
typedef NTSTATUS (*DriverEntry_t)(PVOID, PVOID);
DriverEntry_t DriverEntry = (DriverEntry_t)((ULONG_PTR)BaseAddress + 0x1000);
return DriverEntry(BaseAddress, NULL);
}And export it in the .def file or via #pragma comment(linker, "/export:ManualMapEntry=ManualMapEntry").
- x64 only — Does not support 32-bit x86 systems
- Requires iqvw64e.sys — The vulnerable driver must be present on the target system
- Physical memory scanning — The allocation method (scanning for 0xFF pages) is heuristic and may fail on systems with unusual memory layouts
- No import forwarding — Ordinal imports are logged but not resolved
- Single-threaded — Does not handle multi-processor synchronization
- No exception handling — If the driver crashes, the system may bugcheck
- Antivirus detection — The IOCTL patterns and memory mapping behavior may be flagged by security software
This project is provided for educational and authorized security research purposes only. The authors are not responsible for any misuse or damage caused by this software.
- CVE-2015-2291: Intel iqvw64e.sys arbitrary physical memory mapping
- Windows PE Format specification (Microsoft)
- Windows kernel module loading internals