
Windows 10/11 के लिए Zydis-आधारित डायनामिक पैटर्न खोज के साथ कर्नेल-मोड syscall रैपर
अपडेटेड फोर्क btbd/access जिसमें Windows 10/11 संगतता के लिए Zydis-आधारित डायनामिक पैटर्न खोज है
एक कर्नेल-मोड syscall रैपर जो बिना हैंडल की आवश्यकता के विशेषाधिकार प्राप्त प्रोसेस संचालन सक्षम करता है। कर्नेल-यूज़रमोड संचार के लिए xKdEnumerateDebuggingDevices पॉइंटर हुकिंग का उपयोग करता है।
PROCESS_ALL_ACCESS ऑपरेशन करें.data सेक्शन हुक, कोई इनलाइन पैच नहींयह फोर्क मूल ड्राइवर को निम्न के साथ आधुनिक बनाता है:
[singular-access] उपसर्ग के साथ सूचनात्मक डीबग आउटपुटड्राइवर कर्नेल फ़ंक्शंस को डिसेम्बल करने और निम्न निकालने के लिए Zydis का उपयोग करता है:
User Mode (DLL)
↓ syscall with SYSCALL_UNIQUE
Kernel Hook (xKdEnumerateDebuggingDevices pointer)
↓ validates & dispatches
Kernel Syscall Handler
↓ performs privileged operation
Return to User Mode
cd Driver
msbuild Driver.vcxproj /p:Configuration=Release /p:Platform=x64
link_driver.bat
आउटपुट: Driver\x64\Release\Driver.sys
विकल्प 1: kdmapper (परीक्षण के लिए अनुशंसित)
kdmapper.exe Driver.sys
विकल्प 2: सेवा
sc create singular_access type= kernel binPath= C:\path\to\Driver.sys
sc start singular_access
[singular-access] Initializing driver...
[singular-access] Windows build: 26200
[singular-access] ntoskrnl.exe base: FFFFF80000000000
[singular-access] [*] Searching for PsResumeThread in PsRegisterPicoProvider...
[singular-access] [+] Found PsResumeThread at FFFFF803AAE331C0
[singular-access] [*] Searching for PsSuspendThread in PsRegisterPicoProvider...
[singular-access] [+] Found PsSuspendThread at FFFFF803AADFA1A0
[singular-access] [+] Found PreviousMode offset: 0x232
[singular-access] Searching for xKdEnumerateDebuggingDevices pointer...
[singular-access] xKdEnumerateDebuggingDevices pointer: FFFFF803AB200B68
[singular-access] Installing hook...
[singular-access] Driver initialized successfully
ड्राइवर निम्न को इंटरसेप्ट और हैंडल करता है:
प्रोसेस ऑपरेशन्स
NtOpenProcessNtSuspendProcess / NtResumeProcessNtQueryInformationProcess / NtSetInformationProcessNtQuerySystemInformationExNtFlushInstructionCacheमेमोरी ऑपरेशन्स
NtAllocateVirtualMemory / NtFreeVirtualMemoryNtReadVirtualMemory / NtWriteVirtualMemoryNtProtectVirtualMemoryNtQueryVirtualMemoryNtLockVirtualMemory / NtUnlockVirtualMemoryNtFlushVirtualMemoryथ्रेड ऑपरेशन्स
NtOpenThreadNtSuspendThread / NtResumeThreadNtGetContextThread / NtSetContextThreadNtQueryInformationThread / NtSetInformationThreadसिंक्रोनाइज़ेशन
NtWaitForSingleObjectपरीक्षण किया गया और कार्य करने की पुष्टि की गई:
PsResumeThread खोजना:
lea rcx, PsResumeThread ; Load function address
mov [rdx+40h], rcx ; Store in PICO provider table
xKdEnumerateDebuggingDevices खोजना (Win11 24H2):
mov rax, cs:off_140E00B68 ; Pattern: 48 8B 05 ? ? ? ? 74 ? E8
; Resolve RIP-relative pointer
PreviousMode ऑफ़सेट निकालना:
mov rax, gs:188h ; Get KTHREAD
movzx eax, byte ptr [rax+232h] ; Extract PreviousMode
ret
Driver/
├── main.c # Entry point, initialization, hook installation
├── core.c # Syscall handlers
├── util.c # Pattern scanning, memory utilities
├── zydis_util.c # Zydis-based pattern finders
├── zydis_util.h # Zydis function declarations
├── syscall.h # Syscall definitions
├── stdafx.h # Precompiled header
└── Zydis/ # Zydis disassembler library
ड्राइवर लोड होने में विफल:
bcdedit /set testsigning onपैटर्न नहीं मिला:
लिंकर त्रुटियाँ:
ZYDIS_STATIC_BUILD और ZYCORE_STATIC_BUILD परिभाषित हैंlink_driver.bat सही WDK lib पथों का उपयोग कर रहा हैsyscall.h में syscall enum जोड़ेंHANDLE_SYSCALL मैक्रो का उपयोग करके core.c में हैंडलर जोड़ेंxKdEnumerateDebuggingDevices पॉइंटर के लिए पैटर्न खोजेंmain.c में find_kd_enum_debug_devices_ptr() में जोड़ेंयह प्रोजेक्ट मूल btbd/access रिपॉज़िटरी के समान लाइसेंस रखता है।
यह सॉफ़्टवेयर केवल शैक्षिक और शोध उद्देश्यों के लिए है। जिम्मेदारी से उपयोग करें और केवल उन्हीं प्रणालियों पर करें जिनके स्वामी आप हैं या जिनके परीक्षण की स्पष्ट अनुमति आपके पास है।
| लक्ष्य | तरीका | ऑफ़सेट/पता |
|---|
| KTHREAD.PreviousMode | ExGetPreviousMode को डिसेम्बल करें | 0x232 (सभी संस्करण) |
| PsResumeThread | PsRegisterPicoProvider को डिसेम्बल करें | +0x40 पर RIP-relative LEA |
| PsSuspendThread | PsRegisterPicoProvider को डिसेम्बल करें | +0x50 पर RIP-relative LEA |
| xKdEnumerateDebuggingDevices | .text सेक्शन का पैटर्न स्कैन करें | संस्करण-विशिष्ट पैटर्न |
| OS संस्करण | बिल्ड | स्थिति |
|---|
| Windows 10 1607 | 14393 | ✅ |
| Windows 10 1709 | 16299 | ✅ |
| Windows 10 1809 | 17763 | ✅ |
| Windows 10 2004 | 19041 | ✅ |
| Windows 11 21H2 | 22000 | ✅ |
| Windows 11 22H2 | 22621 | ✅ |
| Windows 11 24H2 | 26100-26200 | ✅ |