|
[原创]Windbg调试的重要功能——内核态与用户态进行切换
大道在我 好的我去看看 多开几台不同操作系统的机器(虚拟机也可以),用WinDBG的symchk命令工具就可以把对应操作系统的符号表下载下来。 |
|
|
|
[原创]Whisper代码开源分享
谢谢提供!收藏了! |
|
[原创]Windbg调试的重要功能——内核态与用户态进行切换
大道在我 有没有教程挂梯子的 不向以前,现在国内访问微软的符号表服务器需要翻墙了。 调试内核没有符号表是很头疼的,通过稳定的代理服务器翻墙是要收费的: 1.如果是公司职员可以向公司申请费用。 2.如果是自行学习的学生可以购买1天的代理服务器(不贵:比如小舒代理: 1天8元左右), 然后在这24小时内翻墙把常用操作系统 的符号表都下载下来,以后就可以离线使用了。 |
|
[求助]文件驱动与2345安全卫士驱动的冲突问题的驱动定位(已解决)
找到原因了,FileMonitor.sys是基于sfilter框架自己绑定卷设备来过滤的,在IRP_MJ_CREATE的过滤中,文件打开前和文件打开后获得路径的方式都有, 在文件打开后对FileObject进行ObQueryNameString获得路径就和2345安全卫士不兼容了, 在文件打开前通过FileObject->FileName,FileObject->RelatedFileObject及StorageStackDeviceObject获得路径就没问题。 又试了下QQ电脑管家也有这个问题,如果要兼容2345安全卫士,QQ电脑管家,只有全部改为:文件打开前获取路径了!只是工作量有点大! 感谢大神提醒!
最后于 2020-11-7 16:44
被低调putchar编辑
,原因:
|
|
[求助]文件驱动与2345安全卫士驱动的冲突问题的驱动定位(已解决)
hhkqqs 你往虚拟机里装个同版本的2345卫士调试一下不就知道了,如果2345的驱动和你那个驱动都是minifilter,可能是其中某个驱动的文件IRP过滤处理的不好,传递到下一个驱动进行处理就gg了 好方法!这样就可以把有冲突的IRP找到了。我还是不想损失功能,麻烦点都要得! |
|
[求助]文件驱动与2345安全卫士驱动的冲突问题的驱动定位(已解决)
这也就是说:dmp中给出的IRQL_NOT_LESS_OR_EQUAL中的第一个参数可能不是准确的访问地址,可能是DISPATCH_LEVEL下访问了段换页内存造成的? IRQL_NOT_LESS_OR_EQUAL (a) An attempt was made to access a pageable (or completely invalid) address at an interrupt request level (IRQL) that is too high. This is usually caused by drivers using improper addresses. If a kernel debugger is available get the stack backtrace. Arguments: Arg1: 0000000000000000, memory referenced Arg2: 0000000000000002, IRQL DISPATCH_LEVEL Arg3: 0000000000000000, bitfield : bit 0 : value 0 = read operation, 1 = write operation bit 3 : value 0 = not an execute operation, 1 = execute operation (only on chips which support this level of status) Arg4: fffff80003eafa83, address which referenced memory Debugging Details: ------------------ OVERLAPPED_MODULE: Address regions for 'RefreshList' and 'crashdmp.sys' overlap READ_ADDRESS: GetPointerFromAddress: unable to read from fffff800040c60e0 0000000000000000 CURRENT_IRQL: 2 FAULTING_IP: nt!IopCompleteRequest+ae3 fffff800`03eafa83 488b09 mov rcx,qword ptr [rcx] 哎!蛋疼!关键是不能直接看到引起崩溃的驱动!各自装没问题,和2345一起安装就不行了,是兼容性问题。 |
|
[求助]文件驱动与2345安全卫士驱动的冲突问题的驱动定位(已解决)
也是!这种情况要定位具体驱动比较麻烦。只有先让他们和客户那边沟通,看能否把2345安全卫士卸了或换用其它的! 如果客户实在要坚持,那就只有研发这边改了。谢谢解答! |
|
[讨论]驱动中如何隐藏进程和模块?
确实!改了nt!_EPROCESS及相关数据结构相关的内容在x64上过一会儿要BOSD!
最后于 2020-11-1 10:48
被低调putchar编辑
,原因:
|
|
[讨论]驱动中如何隐藏进程和模块?
以前还没试过64位,现在改了写地方把以前的方法在x64上试了下,可行! 隐身咯![em_13] 一.ID:1496的进程Deamon.exe确实看不到了! 二. ID: 248的进程explorer.exe中的模块kernel32.dll确实看不到了 |
|
[原创]Windows内核驱动Hook入门
感谢楼主分享,收藏了! 以前的x86:SSDT/SSDT Shadow Hook,inline Hook都玩烂了,现正过渡到x64平台。 Infinity Hook,这里有个开源的东西可以深入学习,发出来方便其他人下载: https://github.com/everdox/InfinityHook |
|
[原创]Windows内核驱动Hook入门
好帖子! 从发帖数,回帖量可以看出:目前搞移动平台的多于桌面平台的,但当时一开始就搞了桌面平台,现在没必要转向了,不然再转去学移动平台要花费时间成本,年龄大了就算学出来也被动了,就在桌面平台方向一直干到退休这样最划算! |
|
[讨论]驱动中如何隐藏进程和模块?
经实践证明,楼主所说的ObRegisterCallbacks不能隐藏进程,可以防止R3层发起的TerminateProcess/ntdll!ZwTerminateProcess, ring0层:nt!ZwTerminateProcess也是防不住的 ring0层遍历线程链,暴力结束那更是防不住的。 nt!ZwTerminateProcess: fffff800`03e819e0 488bc4 mov rax,rsp fffff800`03e819e3 fa cli fffff800`03e819e4 4883ec10 sub rsp,10h fffff800`03e819e8 50 push rax fffff800`03e819e9 9c pushfq fffff800`03e819ea 6a10 push 10h fffff800`03e819ec 488d05fd2c0000 lea rax,[nt!KiServiceLinkage (fffff800`03e846f0)] fffff800`03e819f3 50 push rax fffff800`03e819f4 b829000000 mov eax,29h ;SSDT Index fffff800`03e819f9 e942640000 jmp nt!KiServiceInternal (fffff800`03e87e40) nt!KiServiceInternal: fffff800`03e87e40 4883ec08 sub rsp,8 fffff800`03e87e44 55 push rbp fffff800`03e87e45 4881ec58010000 sub rsp,158h fffff800`03e87e4c 488dac2480000000 lea rbp,[rsp+80h] fffff800`03e87e54 48899dc0000000 mov qword ptr [rbp+0C0h],rbx fffff800`03e87e5b 4889bdc8000000 mov qword ptr [rbp+0C8h],rdi fffff800`03e87e62 4889b5d0000000 mov qword ptr [rbp+0D0h],rsi fffff800`03e87e69 fb sti fffff800`03e87e6a 65488b1c2588010000 mov rbx,qword ptr gs:[188h] ;PKTHREAD fffff800`03e87e73 0f0d8bd8010000 prefetchw [rbx+1D8h] fffff800`03e87e7a 0fb6bbf6010000 movzx edi,byte ptr [rbx+1F6h] fffff800`03e87e81 40887da8 mov byte ptr [rbp-58h],dil fffff800`03e87e85 c683f601000000 mov byte ptr [rbx+1F6h],0 ; kThread->PreviousMode=KernelMode fffff800`03e87e8c 4c8b93d8010000 mov r10,qword ptr [rbx+1D8h] fffff800`03e87e93 4c8995b8000000 mov qword ptr [rbp+0B8h],r10 fffff800`03e87e9a 4c8d1d3d010000 lea r11,[nt!KiSystemServiceStart (fffff800`03e87fde)] fffff800`03e87ea1 41ffe3 jmp r11 0: kd> uf nt!KiSystemServiceStart nt!KiSystemCall64: ... fffff800`03e87fde 4889a3d8010000 mov qword ptr [rbx+1D8h],rsp fffff800`03e87fe5 8bf8 mov edi,eax fffff800`03e87fe7 c1ef07 shr edi,7 fffff800`03e87fea 83e720 and edi,20h fffff800`03e87fed 25ff0f0000 and eax,0FFFh nt!KiSystemServiceRepeat: fffff800`03e87ff2 4c8d1547782300 lea r10,[nt!KeServiceDescriptorTable (fffff800`040bf840)] ;SSDT fffff800`03e87ff9 4c8d1d80782300 lea r11,[nt!KeServiceDescriptorTableShadow (fffff800`040bf880)] ;SSDT Shadow fffff800`03e88000 f7830001000080000000 test dword ptr [rbx+100h],80h ;判断究竟是SSDT还是SSDT Shadow fffff800`03e8800a 4d0f45d3 cmovne r10,r11 fffff800`03e8800e 423b441710 cmp eax,dword ptr [rdi+r10+10h] fffff800`03e88013 0f83e9020000 jae nt!KiSystemServiceExit+0x1a7 (fffff800`03e88302) nt!KiSystemServiceRepeat+0x27: fffff800`03e88019 4e8b1417 mov r10,qword ptr [rdi+r10] ;ServiceTable基址 fffff800`03e8801d 4d631c82 movsxd r11,dword ptr [r10+rax*4] fffff800`03e88021 498bc3 mov rax,r11 fffff800`03e88024 49c1fb04 sar r11,4 ;Ntxxx相对于ServiceTable基址的偏移 fffff800`03e88028 4d03d3 add r10,r11 ;Ntxxx系统函数地址 ... fffff800`03e88150 41ffd2 call r10 ;调用Ntxxx系统函数 1: kd> uf nt!NtTerminateProcess nt!NtTerminateProcess: fffff800`04144b80 4c8bdc mov r11,rsp fffff800`04144b83 49895b18 mov qword ptr [r11+18h],rbx fffff800`04144b87 89542410 mov dword ptr [rsp+10h],edx fffff800`04144b8b 55 push rbp fffff800`04144b8c 56 push rsi fffff800`04144b8d 57 push rdi fffff800`04144b8e 4154 push r12 fffff800`04144b90 4155 push r13 fffff800`04144b92 4156 push r14 fffff800`04144b94 4157 push r15 fffff800`04144b96 4883ec40 sub rsp,40h fffff800`04144b9a 65488b3c2588010000 mov rdi,qword ptr gs:[188h] ;PKTHREAD fffff800`04144ba3 4533e4 xor r12d,r12d fffff800`04144ba6 4883cbff or rbx,0FFFFFFFFFFFFFFFFh fffff800`04144baa 4c8b6f70 mov r13,qword ptr [rdi+70h] fffff800`04144bae 8a87f6010000 mov al,byte ptr [rdi+1F6h] ;kThread->PreviousMode fffff800`04144bb4 4c8bf9 mov r15,rcx fffff800`04144bb7 493bcc cmp rcx,r12 fffff800`04144bba 0f8429010000 je nt!NtTerminateProcess+0x169 (fffff800`04144ce9) nt!NtTerminateProcess+0x40: fffff800`04144bc0 4c8b0559a4f7ff mov r8,qword ptr [nt!PsProcessType (fffff800`040bf020)] ; ObjectType fffff800`04144bc7 498d4b08 lea rcx,[r11+8] fffff800`04144bcb 4d8963b8 mov qword ptr [r11-48h],r12 ;HandleInformation fffff800`04144bcf 49894bb0 mov qword ptr [r11-50h],rcx ;Object fffff800`04144bd3 8d5302 lea edx,[rbx+2] ;DesiredAccess fffff800`04144bd6 448ac8 mov r9b,al ;AccessMode: kThread->PreviousMode fffff800`04144bd9 498bcf mov rcx,r15 ;Handle fffff800`04144bdc c744242044666c74 mov dword ptr [rsp+20h],746C6644h ;Tag fffff800`04144be4 e857590300 call nt!ObReferenceObjectByHandleWithTag (fffff800`0417a540) fffff800`04144be9 413bc4 cmp eax,r12d fffff800`04144bec 0f8cdf000000 jl nt!NtTerminateProcess+0x151 (fffff800`04144cd1) ... 因为ObReferenceObjectByHandleWithTag如果AccessMode为KernelMode的话,不受句柄权限控制了,能成功得到进程对象, 为UserMode的话,受句柄权限控制,不能成功得到进程对象,而nt!ZwTerminateProcess会将kThread->PreivousMode设为KernelMode, 所以,这个方法只能防ring3层发起的一般的TerminateProcess/ntdll!ZwTerminateProcess。不能隐藏进程,因为进程获取底层是遍历内核中的进程链完成的。别被误导了! //预处理回调 OB_PREOP_CALLBACK_STATUS ObjPreCallback( IN PVOID RegistrationContext, IN OUT POB_PRE_OPERATION_INFORMATION OperationInformation ) { KdPrintEx(( DPFLTR_IHVDRIVER_ID, DEVICE_LEVEL, "Entering ObjPreCallback...\n" )); if (IsTaskMgrProc(PsGetCurrentProcess())) { //当前进程任务管理器进程 if (IsProcNeedToHide((PEPROCESS)OperationInformation->Object)) { //目标进程是需要隐藏的进程(经验证:隐藏不了,可以防一般性的ring3层的终止,写入) switch (OperationInformation->Operation) { case OB_OPERATION_HANDLE_CREATE: //任务管理器试图打开目标进程 OperationInformation->Parameters->CreateHandleInformation.DesiredAccess = 0; //权限清空 break; case OB_OPERATION_HANDLE_DUPLICATE: //任务管理器试图复制目标进程句柄 OperationInformation->Parameters->DuplicateHandleInformation.DesiredAccess = 0; //权限清空 break; } } } return OB_PREOP_SUCCESS; }
最后于 2020-11-3 20:43
被低调putchar编辑
,原因:
|
|
[讨论]驱动中如何隐藏进程和模块?
一.进程隐藏:
最后于 2020-10-28 21:08
被低调putchar编辑
,原因:
|