Приветствую! Хочу перехватывать вызовы NtCreateFile из Ring0. Хотел это сделать через подмену адреса в ntoskrnl.exe. Для этого нашел адрес модуля ntoskrnl.exe и адрес функции NtCreateFile в нем и подменил его на свой обработчик. Результата нету. Это мой косяк в реализации (код могу показать) или все-таки нужно подменять адрес в SSDT? Если так, то где можно посмотреть номара функций IoCreateFile, NtCreateFile, NtOpenFile и тп для XP, 2000 и т.д.?
http://www.metasploit.com/users/opcode/syscalls.html Вообще-то, у Ms Rem'a были статьи по перехвату сисколов, ищи по форуму, примеры были
Спасиб ребят за инфу. Сделал перехват. Попробовал... При запуске файла на выполнение получил BSOD. Помогите плз понять причину. Вот дамп Код (Text): ******************************************************************************* * * * Bugcheck Analysis * * * ******************************************************************************* PAGE_FAULT_IN_NONPAGED_AREA (50) Invalid system memory was referenced. This cannot be protected by try-except, it must be protected by a Probe. Typically the address is just plain bad or it is pointing at freed memory. Arguments: Arg1: 8580d189, memory referenced. Arg2: 00000001, value 0 = read operation, 1 = write operation. Arg3: 80595452, If non-zero, the instruction address which referenced the bad memory address. Arg4: 00000000, (reserved) Debugging Details: ------------------ PEB is paged out (Peb.Ldr = 7ffdf00c). Type ".hh dbgerr001" for details PEB is paged out (Peb.Ldr = 7ffdf00c). Type ".hh dbgerr001" for details WRITE_ADDRESS: 8580d189 FAULTING_IP: nt!NtAcceptConnectPort+e5 80595452 ff8d45a4508d dec dword ptr [ebp-72AF5BBBh] MM_INTERNAL_CODE: 0 DEFAULT_BUCKET_ID: CODE_CORRUPTION BUGCHECK_STR: 0x50 PROCESS_NAME: csrss.exe TRAP_FRAME: f8302c18 -- (.trap 0xfffffffff8302c18) ErrCode = 00000002 eax=7fff0000 ebx=0069febc ecx=0000000b edx=0069fe98 esi=0069ff1c edi=f8302d28 eip=80595452 esp=f8302c8c ebp=f8302d44 iopl=0 nv up ei ng nz na pe nc cs=0008 ss=0010 ds=0023 es=0023 fs=0030 gs=0000 efl=00010286 nt!NtAcceptConnectPort+0xe5: 80595452 ff8d45a4508d dec dword ptr [ebp-72AF5BBBh] ss:0010:8580d189=???????? Resetting default scope MISALIGNED_IP: nt!NtAcceptConnectPort+e5 80595452 ff8d45a4508d dec dword ptr [ebp-72AF5BBBh] LAST_CONTROL_TRANSFER: from 8051c756 to 805266db STACK_TEXT: f8302bb4 8051c756 00000050 8580d189 00000001 nt!KeBugCheckEx+0x19 f8302c00 804dcc5e 00000001 8580d189 00000000 nt!MmAccessFault+0x6cf f8302c00 80595452 00000001 8580d189 00000000 nt!KiTrap0E+0xb8 f8302d44 804da140 0069fecc 00000025 0069ff04 nt!NtAcceptConnectPort+0xe5 f8302d44 7ffe0304 0069fecc 00000025 0069ff04 nt!KiSystemService+0xc4 0069fed4 00000000 00000000 00000000 00000000 SharedUserData!SystemCallStub+0x4 STACK_COMMAND: kb CHKIMG_EXTENSION: !chkimg -lo 50 -d !nt 804fee7b-804fee7f 5 bytes - nt!DebugPrint+1 [ 74 24 0c 8b 44:25 8c 46 5f f6 ] 8059543e-80595441 4 bytes - nt!NtAcceptConnectPort+d0 [ 03 0f 85 1d:93 e2 10 f6 ] 80636708-8063670a 3 bytes - nt!MiVerifierThunks (+0xa12ca) [ 5c 6e 63:17 bf 4e ] 80636710-80636712 3 bytes - nt!MiVerifierThunks+8 (+0x08) [ 40 6e 63:bc 28 51 ] 80636718-8063671a 3 bytes - nt!MiVerifierThunks+10 (+0x08) [ 24 6e 63:da 28 51 ] 80636720-80636722 3 bytes - nt!MiVerifierThunks+18 (+0x08) [ 04 6e 63:b0 cb 4e ] 80636728-8063672a 3 bytes - nt!MiVerifierThunks+20 (+0x08) [ ec 6d 63:aa ca 4e ] 80636730-80636732 3 bytes - nt!MiVerifierThunks+28 (+0x08) [ d8 6d 63:4e e4 4e ] 80636738-8063673a 3 bytes - nt!MiVerifierThunks+30 (+0x08) [ bc 6d 63:0c 6c 5c ] 80636740-80636742 3 bytes - nt!MiVerifierThunks+38 (+0x08) [ ac 6d 63:2f 9e 50 ] 80636748-8063674a 3 bytes - nt!MiVerifierThunks+40 (+0x08) [ 98 6d 63:55 f0 4f ] 80636750-80636752 3 bytes - nt!MiVerifierThunks+48 (+0x08) [ 78 6d 63:2a d0 4e ] 80636758-8063675a 3 bytes - nt!MiVerifierThunks+50 (+0x08) [ 68 6d 63:ce e6 4e ] 80636760-80636762 3 bytes - nt!MiVerifierThunks+58 (+0x08) [ 54 6d 63:a3 d7 4e ] 80636768-8063676a 3 bytes - nt!MiVerifierThunks+60 (+0x08) [ 44 6d 63:5c 9f 50 ] 80636770-80636772 3 bytes - nt!MiVerifierThunks+68 (+0x08) [ 30 6d 63:d4 95 6c ] 80636778-8063677a 3 bytes - nt!MiVerifierThunks+70 (+0x08) [ 18 6d 63:30 96 6c ] 80636780-80636782 3 bytes - nt!MiVerifierThunks+78 (+0x08) [ 04 6d 63:08 96 6c ] 80636788-8063678a 3 bytes - nt!MiVerifierThunks+80 (+0x08) [ f8 6c 63:60 d3 6c ] 80636790-80636792 3 bytes - nt!MiVerifierThunks+88 (+0x08) [ ec 6c 63:72 d3 6c ] 80636798-8063679a 3 bytes - nt!MiVerifierThunks+90 (+0x08) [ d8 6c 63:7e d3 6c ] 806367a0-806367a2 3 bytes - nt!MiVerifierThunks+98 (+0x08) [ c4 6c 63:90 d3 6c ] 806367a8-806367aa 3 bytes - nt!MiVerifierThunks+a0 (+0x08) [ a4 6c 63:27 1f 51 ] 806367b0-806367b2 3 bytes - nt!MiVerifierThunks+a8 (+0x08) [ 84 6c 63:2b 1f 51 ] 806367b8-806367ba 3 bytes - nt!MiVerifierThunks+b0 (+0x08) [ 6c 6c 63:dc b8 4e ] 806367c0-806367c2 3 bytes - nt!MiVerifierThunks+b8 (+0x08) [ 58 6c 63:22 62 4f ] 806367c8-806367ca 3 bytes - nt!MiVerifierThunks+c0 (+0x08) [ 44 6c 63:14 62 4f ] 806367d0-806367d2 3 bytes - nt!MiVerifierThunks+c8 (+0x08) [ 2c 6c 63:2b c8 4e ] 806367d8-806367da 3 bytes - nt!MiVerifierThunks+d0 (+0x08) [ 20 6c 63:38 91 6c ] 806367e0-806367e2 3 bytes - nt!MiVerifierThunks+d8 (+0x08) [ 08 6c 63:58 91 6c ] 806367e8-806367ea 3 bytes - nt!MiVerifierThunks+e0 (+0x08) [ fc 6b 63:90 91 6c ] 806367f0-806367f2 3 bytes - nt!MiVerifierThunks+e8 (+0x08) [ e8 6b 63:70 95 6c ] 806367f8-806367fa 3 bytes - nt!MiVerifierThunks+f0 (+0x08) [ d4 6b 63:b0 95 6c ] 80636800-80636802 3 bytes - nt!MiVerifierThunks+f8 (+0x08) [ c8 6b 63:bb c9 4e ] 80636808-8063680a 3 bytes - nt!MiVerifierThunks+100 (+0x08) [ b8 6b 63:50 d8 4e ] 80636810-80636812 3 bytes - nt!MiVerifierThunks+108 (+0x08) [ a4 6b 63:9d d7 4e ] 80636818-8063681a 3 bytes - nt!MiVerifierThunks+110 (+0x08) [ 84 6b 63:74 52 4e ] 80636820-80636822 3 bytes - nt!MiVerifierThunks+118 (+0x08) [ 64 6b 63:56 d8 4e ] 80636828-8063682a 3 bytes - nt!MiVerifierThunks+120 (+0x08) [ 50 6b 63:dc 65 5b ] 80636830-80636832 3 bytes - nt!MiVerifierThunks+128 (+0x08) [ 34 6b 63:d6 e0 6c ] 80636838-8063683a 3 bytes - nt!MiVerifierThunks+130 (+0x08) [ 24 6b 63:a4 c0 56 ] 80636840-80636842 3 bytes - nt!MiVerifierThunks+138 (+0x08) [ 04 6b 63:dc b9 6c ] 80636848-8063684a 3 bytes - nt!MiVerifierThunks+140 (+0x08) [ e8 6a 63:ee e7 57 ] 80636850-80636852 3 bytes - nt!MiVerifierThunks+148 (+0x08) [ d8 6a 63:ad ce 4e ] 80636858-8063685a 3 bytes - nt!MiVerifierThunks+150 (+0x08) [ c4 6a 63:8b 1d 4e ] 80636860-80636862 3 bytes - nt!MiVerifierThunks+158 (+0x08) [ b4 6a 63:4b c5 4e ] 80636868-8063686a 3 bytes - nt!MiVerifierThunks+160 (+0x08) [ a0 6a 63:d2 92 4f ] 80636870-80636872 3 bytes - nt!MiVerifierThunks+168 (+0x08) [ 88 6a 63:1a 1f 51 ] 80636878-8063687a 3 bytes - nt!MiVerifierThunks+170 (+0x08) [ 78 6a 63:2e d6 6d ] 80636880-80636882 3 bytes - nt!MiVerifierThunks+178 (+0x08) [ 68 6a 63:e0 c0 6c ] 80636888-8063688a 3 bytes - nt!MiVerifierThunks+180 (+0x08) [ 50 6a 63:48 c1 6c ] WARNING: !chkimg output was truncated to 50 lines. Invoke !chkimg without '-lo [num_lines]' to view entire output. 201 errors : !nt (804fee7b-8063690a) MODULE_NAME: memory_corruption IMAGE_NAME: memory_corruption FOLLOWUP_NAME: memory_corruption DEBUG_FLR_IMAGE_TIMESTAMP: 0 MEMORY_CORRUPTOR: LARGE FAILURE_BUCKET_ID: MEMORY_CORRUPTION_LARGE BUCKET_ID: MEMORY_CORRUPTION_LARGE Followup: memory_corruption ---------