|
[分享]用ObRegisterCallbacks实现进程防杀
晕,我睡觉了,希望能睡着,,唉 |
|
|
|
|
|
[分享]用ObRegisterCallbacks实现进程防杀
我也觉得ms没那么s13,既然都用上pg了,肯定修改重要的数据都会被检测的。 可能最开始的pg检测不够完善,导致改object type不会蓝屏。这只是我的猜测。 不管怎样,hook咱不用了,呵呵 |
|
|
|
[分享]用ObRegisterCallbacks实现进程防杀
这里是有问题, |
|
[分享]用ObRegisterCallbacks实现进程防杀
win7下我测试了,这个方法确实可行,呵呵,感谢 |
|
[分享]用ObRegisterCallbacks实现进程防杀
64位下的object hook,我没有试过,不知道行不行 函数Hook、ssdt hook 试过了的,是行不通的。 既然微软用了新框架,我打算hook这种方式就只用于xp下了, vista及其以后的系统我就用新框架了, |
|
[分享]用ObRegisterCallbacks实现进程防杀
就是考虑到64位系统下不能hook了,所以我才搞这种框架。很蛋疼,代码都要写两套 |
|
|
|
[分享]用ObRegisterCallbacks实现进程防杀
00CF843A |. FF15 5013CE00 CALL DWORD PTR DS:[<&USER32.SendMessageTimeoutW>] ; \SendMessageTimeoutW 02DEFC30 00150332 |hWnd = 00150332 ('test_kill',class='#32770') 02DEFC34 00000010 |Message = WM_CLOSE 02DEFC38 00000000 |wParam = 0 02DEFC3C 00000000 |lParam = 0 02DEFC40 00000003 |Flags = SMTO_BLOCK|SMTO_ABORTIFHUNG 02DEFC44 000001F4 |Timeout = 500. ms 02DEFC48 02DEFC58 \pResult = 02DEFC58 |
|
[分享]用ObRegisterCallbacks实现进程防杀
win7 的任务管理器在结束任务时: int __stdcall EndTaskThreadProc(LPVOID lpMem) { LPVOID v1; // esi@1 int v2; // edi@2 BOOL v3; // eax@4 DWORD v4; // eax@8 DWORD v5; // eax@14 DWORD v6; // eax@19 bool v7; // zf@19 bool v8; // sf@19 char v9; // of@19 HANDLE v10; // eax@27 int v11; // ST14_4@28 int v12; // eax@28 ULONG_PTR dwResult; // [sp+8h] [bp-Ch]@12 int v15; // [sp+Ch] [bp-8h]@4 int v16; // [sp+10h] [bp-4h]@1 int lpMema; // [sp+1Ch] [bp+8h]@3 v1 = lpMem; v16 = 40046; if ( !lpMem ) { v2 = -2147467259; goto LABEL_28; } v16 = *((_DWORD *)lpMem + 4); lpMema = *((_DWORD *)lpMem + 3); if ( !lpMema ) { v3 = IsHungAppWindow(*((HWND *)v1 + 1)); v15 = v3 == 0; if ( v3 != 0 ) { TmGetProcessStatus(*((_DWORD *)v1 + 5), (int)&v15); lpMema = v15 == 0; if ( !v15 ) v16 = 40207; } } if ( !SetThreadDesktop(*(HDESK *)v1) ) { v4 = GetLastError(); if ( (signed int)v4 > 0 ) v4 = (unsigned __int16)v4 | 0x80070000; v2 = v4; if ( (v4 & 0x80000000u) != 0 ) goto LABEL_26; } if ( !lpMema ) { if ( SendMessageTimeoutW(*((HWND *)v1 + 1), 0x10u, 0, 0, 3u, 0x1F4u, &dwResult) ) { v2 = 0; } else { v5 = GetLastError(); if ( (signed int)v5 > 0 ) v5 = (unsigned __int16)v5 | 0x80070000; v2 = v5; if ( (v5 & 0x80000000u) != 0 ) { LABEL_18: v2 = 0; if ( !EndTask(*((_DWORD *)v1 + 1), 0, 0) ) { v6 = GetLastError(); v9 = 0; v7 = v6 == 0; v8 = (v6 & 0x80000000u) != 0; LABEL_23: if ( !((unsigned __int8)(v8 ^ v9) | v7) ) v6 = (unsigned __int16)v6 | 0x80070000; v2 = v6; goto LABEL_26; } goto LABEL_26; } } Sleep(0x1F4u); if ( !IsWindowVisible(*((HWND *)v1 + 1)) ) goto LABEL_26; goto LABEL_18; } if ( !EndTask(*((_DWORD *)v1 + 1), 0, 1) ) { v6 = GetLastError(); v9 = 0; v7 = v6 == 0; v8 = (v6 & 0x80000000u) != 0; goto LABEL_23; } v2 = 0; LABEL_26: if ( *((_DWORD *)v1 + 6) ) { v10 = GetProcessHeap(); HeapFree(v10, 0, v1); } LABEL_28: v11 = v16; v12 = IsUserAdmin(); TmSqmAction(v12, 0, v11, 0, v2); return v2; } |
|
[分享]用ObRegisterCallbacks实现进程防杀
代码有个错误, 在 函数 OB_PREOP_CALLBACK_STATUS ObjectPreCallback_Thread_Dispatch( IN PVOID RegistrationContext, IN POB_PRE_OPERATION_INFORMATION OperationInformation ) 里 需要将 PROCESS_TERMINATE 换成 THREAD_TERMINATE |
|
|
|
[分享]taskmgr.exe 结束任务
这里只是在xp下, |
|
[分享]taskmgr.exe 结束任务
进程防杀我没搞过,它是不是很老的东西,跟我无关。对我来说,没搞过的东西就是新东西。 会的鸟赶紧飞开就是了。 更新了程序,增加了对terminatethread的hook ,并修复了一些漏洞。 现在不管oooshit.exe,还是oooshit2.exe都杀不了了。 顺便说1下, oooshit.exe是通过枚举进程信息,然后用terminatethread来杀主线程; 而oooshit2.exe就有点的猥琐了,我估计kman看了下我的驱动,才这样搞的。 在驱动里,我是把内核路径转换为dos路径进行比较,转的过程中会打开需要保护的进程文件。 而oooshit2.exe就是先把要保护的进程文件打开了,然后我在驱动中打开文件时就会报错,所以无法将内核路径转换为dos路径,就无法比较了。 呵呵,kman的思路很好,非常感谢。 我现在的比较函数如下,kman继续搞搞看。 BOOL IsNeedProtectEx( IN PEPROCESS pEProcess ) { BOOL bRet = FALSE; UNICODE_STRING uniDosPath; PUNICODE_STRING pImageFileName = NULL; if( wcslen( g_wszDestPath ) > 0 && GetProcessImagePath( pEProcess, &pImageFileName ) ) { if( ConvertKernelPathToDosPath( pImageFileName, &uniDosPath ) ) // 比较dos路径 { if( _wcsicmp( uniDosPath.Buffer, g_wszDestPath ) == 0 ) { bRet = TRUE; DbgOutput( "\r\nIn IsNeedProtectEx(), Process{%wZ} is being protected.", pImageFileName ); } } else // 无法得到dos路径,则比较内核路径 { WCHAR szKrnlPath[ MAX_PATH + 20 ] = { 0 }; if( ConvertDosPathToKrnlPath( g_wszDestPath, szKrnlPath ) ) { if( _wcsicmp( pImageFileName->Buffer, szKrnlPath ) == 0 ) { bRet = TRUE; DbgOutput( "\r\nIn IsNeedProtectEx(), Process{%wZ} is being protected.", pImageFileName ); } } } ExFreePool( pImageFileName ); } return bRet; } |
|
|
|
[分享]taskmgr.exe 结束任务
我在想,驱动是通过判断进程eprocess和路径来实现的, 如果吧杀进程的路径改了,驱动也会判断失效的。 只要我自己的程序在退出的时候搞点东西,这样就没什么问题了。 |
|
[分享]taskmgr.exe 结束任务
我这里杀不了的, |
操作理由
RANk
{{ user_info.golds == '' ? 0 : user_info.golds }}
雪币
{{ experience }}
课程经验
{{ score }}
学习收益
{{study_duration_fmt}}
学习时长
基本信息
荣誉称号:
{{ honorary_title }}
能力排名:
No.{{ rank_num }}
等 级:
LV{{ rank_lv-100 }}
活跃值:
在线值:
浏览人数:{{ visits }}
最近活跃:{{ last_active_time }}
注册时间:{{ user_info.create_date_jsonfmt }}
勋章
兑换勋章
证书
证书查询 >
能力值