国外高手谈卡巴斯基存隐患(2)

豆豆网   技术应用频道   2007年06月22日  【字号: 收藏本文

内容摘要:KAV的杀毒软件依靠诸多不安全内核层的黑客程序,从而将系统稳定性置于危险中。想要解决这个问题,首先KAV需要去掉不安全的内核层黑客程序,比如给非输出函数打补丁或者不加验证地关联系统服务等等。

  APC例行程序本身给kernel32的输出表打了补丁(并且生成thunk来调用内核层)并调整KAV的驱动镜像的PTE属性,以便允许用户层访问。

.text:F8221810 KavPatchNewProcessApcRoutine proc near ; DATA XREF: CheckInjectCodeForNewProcess+51o
.text:F8221810
.text:F8221810 var_8      = dword ptr -8
.text:F8221810 var_4      = dword ptr -4
.text:F8221810 ImageBase    = dword ptr 8
.text:F8221810
.text:F8221810  push  ebp
.text:F8221811  mov   ebp, esp
.text:F8221813  sub   esp, 8
.text:F8221816  mov   eax, [ebp+ImageBase]
.text:F8221819  push  esi
.text:F822181A  push  eax       ; ImageBase
.text:F822181B  call  KavPatchImageForNewProcess
.text:F8221820  mov   esi, dword_F8230518
.text:F8221826  mov   eax, dword_F823051C
.text:F822182B  and   esi, 0FFFFF000h
.text:F8221831  cmp   esi, eax
.text:F8221833  mov   [ebp+ImageBase], esi
.text:F8221836  jnb   short loc_F8221883
.text:F8221838
.text:F8221838 loc_F8221838:       ; CODE XREF: KavPatchNewProcessApcRoutine+71j
.text:F8221838  push  esi
.text:F8221839  call  KavPageTranslation0
.text:F822183F  push  esi
.text:F8221840  mov   [ebp+var_8], eax
.text:F8221843  call  KavPageTranslation1
.text:F8221849  mov   [ebp+var_4], eax
.text:F822184C  mov   eax, [ebp+var_8]
.text:F822184F  lock or dword ptr [eax], 4
.text:F8221853  lock and dword ptr [eax], 0FFFFFEFFh
.text:F822185A  mov   eax, [ebp+var_4]
.text:F822185D  invlpg byte ptr [eax]
.text:F8221860  lock or dword ptr [eax], 4
.text:F8221864  lock and dword ptr [eax], 0FFFFFEFDh
.text:F822186B  mov   eax, [ebp+ImageBase]
.text:F822186E  invlpg byte ptr [eax]
.text:F8221871  mov   eax, dword_F823051C
.text:F8221876  add   esi, 1000h
.text:F822187C  cmp   esi, eax
.text:F822187E  mov   [ebp+ImageBase], esi
.text:F8221881  jb   short loc_F8221838
.text:F8221883
.text:F8221883 loc_F8221883:       ; CODE XREF: KavPatchNewProcessApcRoutine+26j
.text:F8221883  pop   esi
.text:F8221884  mov   esp, ebp
.text:F8221886  pop   ebp
.text:F8221887  retn  0Ch
.text:F8221887 KavPatchNewProcessApcRoutine endp
.text:F8221750 ; int __stdcall KavPatchImageForNewProcess(PUCHAR ImageBase)
.text:F8221750 KavPatchImageForNewProcess proc near  ; CODE XREF: KavPatchNewProcessApcRoutine+Bp
.text:F8221750
.text:F8221750 ImageBase    = dword ptr 8
.text:F8221750
.text:F8221750  push  ebx
.text:F8221751  call  ds:KeEnterCriticalRegion
.text:F8221757  mov   eax, dword_F82282F4
.text:F822175C  push  1        ; Wait
.text:F822175E  push  eax       ; Resource
.text:F822175F  call  ds:ExAcquireResourceExclusiveLite
.text:F8221765  push  1
.text:F8221767  call  KavSetPageAttributes1
.text:F822176C  mov   ecx, [esp+ImageBase]
.text:F8221770  push  ecx       ; ImageBase
.text:F8221771  call  KavPatchImage
.text:F8221776  push  0
.text:F8221778  mov   bl, al
.text:F822177A  call  KavSetPageAttributes1
.text:F822177F  mov   ecx, dword_F82282F4 ; Resource
.text:F8221785  call  ds:ExReleaseResourceLite
.text:F822178B  call  ds:KeLeaveCriticalRegion
.text:F8221791  mov   al, bl
.text:F8221793  pop   ebx
.text:F8221794  retn  4
.text:F8221794 KavPatchImageForNewProcess endp

来源:赛迪网    作者:杜莉    责编:豆豆技术应用

正在加载评论...