阅读:1505回复:8
在内核驱动里启动进程
大致搜索了一下,好像方法就是APC,但是下面代码及其丑陋0x7C86114D!!!
void ApcCreateProcess( PVOID NormalContext, PVOID SystemArgument1, PVOID SystemArgument2) { __asm { mov eax,0x7C86114D wowowowowowcock来提示下小弟啊,我很好学的 ![]() |
|
沙发#
发布于:2008-04-01 17:07
NTSYSAPI
NTSTATUS NTAPI NtReadVirtualMemory( IN HANDLE hProcess, IN PVOID BaseAddress, OUT PVOID Buffer, IN ULONG BytesToRead, OUT PULONG BytesRead ); 我声明了,但是编译通不过啊???我在DDK2000 + vc6 |
|
板凳#
发布于:2008-04-01 11:55
有没有在驱动里面得到Kernel32基地址的办法啊?
|
|
地板#
发布于:2008-04-01 08:53
wowowowowocock提示一下啊!我现在的思路是先枚举进程(不过好像各个系统的EPROCESS的ActiveProcessLinks不一样啊),得到WinLogin进程的PEB(该PEB貌似在用户空间),然后搜索其加载的DLL模块,这样太麻烦了,同样涉及到硬编码的问题啊
有没有一个通用的办法啊!!! ![]() |
|
地下室#
发布于:2008-03-31 17:50
因为用户模式下的FS和核心模式下的FS是不同的地址.你得取用户模式下的FS地址,自己到GDT里去找.
|
|
|
5楼#
发布于:2008-03-31 17:19
mov eax, fs:[30h]; eax->0xffffffff 宣布死亡
![]() |
|
6楼#
发布于:2008-03-31 17:15
ULONG
SearchApi(WORD api_hash) /* * 在kern32.dll中搜索指定API地址 * Hash(WinExec) = 0x72dc Hash(LoadLibraryA) = 0xae14 */ { //搜索k32dll的API地址 _asm { mov eax, fs:[30h]; mov eax, [eax+0x0c];//ldr mov esi, [eax+0x1c];//esi->ldr.InInitializationOrderMoudleList _LIST_ENTRY struct lodsd; //eax = [esi]; mov ebx, [eax+0x08];//k32dll is the first! and baseaddress is follow _LIST_ENTRY //now get pe image infos to find LoadLibrary and GetProcAddress API //assert ebx is the pe image base!!! mov ax, api_hash; //Hash(LoadLibraryA) = 0xae14 //Hash(WinExec) = 0x72dc //call search_api; //mov [ebp-4], eax; //this is LoadLibraryA API //------------------------------------------------------------------------------ //ebx-PE Image Base,eax-hash of api name, return eax!!! //------------------------------------------------------------------------------ //search_api: mov edx, eax; mov eax, [ebx+0x3c]; //File address of the new exe header mov eax, [eax+ebx+0x78]; //pe base ->data directory[16] add eax, ebx; //get directory[0] Address ->export table ->eax mov esi, [eax+0x20]; //get export funs names rva add esi, ebx; //esi->export names table address //mov ecx, [eax+0x18]; //get export funs numbers xor ecx, ecx; //search funs name tables next_api: mov edi, [esi+ecx*4]; // add edi, ebx; //----------------------------------- //计算[edi]字符串的hash值 //----------------------------------- pushad; xor eax, eax; cacul_next: shl eax, 2; movzx ecx, byte ptr[edi]; add ax, cx; inc edi; inc ecx; loop cacul_next; //test edx!!! cmp ax, dx; jz search_end; popad; inc ecx; jmp next_api; search_end: popad; //ecx is the GetProcAdress index mov eax, [eax+0x1c]; add eax, ebx; mov eax, [eax+4*ecx]; add eax, ebx; //ret; } } 我写的这段代码只能在用户模式才能正常工作啊!!!在内核模式下总是BSOD 哈哈 |
|
7楼#
发布于:2008-03-31 17:14
如何在内核模式下获取WinExec的API地址呢?
|
|
8楼#
发布于:2008-03-31 12:34
winexec的地址(自己先动态获得),在调用前先push SW_SHOWNORMAL,PUSH 0X12345678然后把目标路径动态覆盖0x12345678,然后插APC ,远端调用即可.
|
|
|