看流星社区

 找回密码
 注册账号
查看: 2317|回复: 0

某驱动保护检测 请高手赐教

[复制链接]

该用户从未签到

发表于 2013-3-20 09:03:30 | 显示全部楼层 |阅读模式
驱动保护已经过掉了 可以附加并调试
但它会检测调试工具
检测的非常快 打开后1分钟左右就发现了

于是自己写起了个驱动保护

一、 窗口检测 ShadowSSDT hook
NtUserFindWindowEx
NtUserQueryWindow
NtUserBuildHwndList
NtUserGetForegroundWindow
NtUserWindowFromPoint

二、进程检测
1、SSDT Hook :
NtOpenProcess
NtReadVirtualMemory
NtQuerySystemInformation
2、 inline hook  
ObReferenceObjectByHandle  
KeStachAttachProcess
KeAttachProcess
MiDoPoolCopy
3、 EPROCESS 断链

4、开启一条内核线程 定时2秒 枚举系统所有句柄
发现有我的进程、线程句柄 上去ZwClose

到此觉得已经非常安全了 因为 我的子对话框也显示不出来了

打开游戏几秒后 我崩溃了 还是弹出 非法模块

已经拿它没办法了 请高手支点招
  1. NTSTATUS MyQuerySystemHandle(

  2.                   IN SYSTEM_INFORMATION_CLASS SystemInformationClass,
  3.                   OUT PVOID               SystemInformation,
  4.                   IN ULONG                SystemInformationLength,
  5.                   OUT PULONG              ReturnLength OPTIONAL )
  6. {
  7.   NTSTATUS status;
  8.   ULONG index;
  9.   PSYSTEM_HANDLE_INFORMATION_EX HandleTable;
  10.   status =RealNtQuerySystemInformation(SystemHandleInformation,SystemInformation,SystemInformationLength,ReturnLength);
  11.   if(!NT_SUCCESS(status))
  12.     return status;
  13.   HandleTable=(PSYSTEM_HANDLE_INFORMATION)((PULONG)SystemInformation);
  14.   for (index =0 ;index!=*(PULONG)SystemInformation;index++)
  15.   {
  16.     if (HandleTable->Information[index].ProcessId == ProcessIdToProtect)
  17.     {
  18.       HandleTable->Information[index].ProcessId =NULL;
  19.       HandleTable->Information[index].ObjectTypeNumber=NULL;
  20.       HandleTable->Information[index].Object=NULL;
  21.       HandleTable->Information[index].Handle=NULL;
  22.       HandleTable->Information[index].GrantedAccess=NULL;
  23.       HandleTable->Information[index].Flags=NULL;

  24.     }
  25.   }
  26.   return status;
  27. }
  28. NTSTATUS MyNtQuerySystemInformation(

  29.                   IN SYSTEM_INFORMATION_CLASS SystemInformationClass,
  30.                   OUT PVOID               SystemInformation,
  31.                   IN ULONG                SystemInformationLength,
  32.                   OUT PULONG              ReturnLength OPTIONAL )
  33. {
  34.   if (SystemInformationClass ==SystemHandleInformation)
  35.   {
  36.     return MyQuerySystemHandle(SystemInformationClass,SystemInformation,SystemInformationLength,ReturnLength);
  37.   }
  38.   return RealNtQuerySystemInformation(SystemInformationClass,SystemInformation,SystemInformationLength,ReturnLength);
  39. }
复制代码
点击按钮快速添加回复内容: 支持 高兴 激动 给力 加油 苦寻 生气 回帖 路过 感恩
您需要登录后才可以回帖 登录 | 注册账号

本版积分规则

小黑屋|手机版|Archiver|看流星社区 |网站地图

GMT+8, 2024-3-28 19:03

Powered by Kanliuxing X3.4

© 2010-2019 kanliuxing.com

快速回复 返回顶部 返回列表