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

http://tech.ddvip.com   2007年06月22日    社区交流 收藏本文

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

  KAV的输出查询代码没有正确地验证就使用从PE页头储存的那些偏移地址:

.text:F8220CA0 LookupExportedFunction proc near    ; CODE XREF: sub_F8217A60+C9p
.text:F8220CA0        ; sub_F82181D0+Dp ...
.text:F8220CA0
.text:F8220CA0 var_20     = dword ptr -20h
.text:F8220CA0 var_1C     = dword ptr -1Ch
.text:F8220CA0 var_18     = dword ptr -18h
.text:F8220CA0 var_14     = dword ptr -14h
.text:F8220CA0 var_10     = dword ptr -10h
.text:F8220CA0 var_C      = dword ptr -0Ch
.text:F8220CA0 var_8      = dword ptr -8
.text:F8220CA0 var_4      = dword ptr -4
.text:F8220CA0 arg_0      = dword ptr 4
.text:F8220CA0 arg_4      = dword ptr 8
.text:F8220CA0 arg_8      = dword ptr 0Ch
.text:F8220CA0
.text:F8220CA0  mov   edx, [esp+arg_0]
.text:F8220CA4  sub   esp, 20h
.text:F8220CA7  cmp   word ptr [edx], 'ZM'
.text:F8220CAC  push  ebx
.text:F8220CAD  push  ebp
.text:F8220CAE  push  esi
.text:F8220CAF  push  edi
.text:F8220CB0  jnz   loc_F8220DE1
.text:F8220CB6  mov   eax, [edx+3Ch]
.text:F8220CB9  add   eax, edx
.text:F8220CBB  cmp   dword ptr [eax], 'EP'
.text:F8220CC1  jnz   loc_F8220DE1
.text:F8220CC7  mov   eax, [eax+78h]
.text:F8220CCA  mov   edi, [esp+30h+arg_4]
.text:F8220CCE  add   eax, edx
.text:F8220CD0  mov   [esp+30h+var_14], eax
.text:F8220CD4  mov   esi, [eax+1Ch]
.text:F8220CD7  mov   ebx, [eax+24h]
.text:F8220CDA  mov   ecx, [eax+20h]
.text:F8220CDD  add   esi, edx
.text:F8220CDF  add   ebx, edx
.text:F8220CE1  add   ecx, edx
.text:F8220CE3  cmp   edi, 1000h
.text:F8220CE9  mov   [esp+30h+var_4], esi
.text:F8220CED  mov   [esp+30h+var_C], ebx
.text:F8220CF1  mov   [esp+30h+var_18], ecx
.text:F8220CF5  jnb   short loc_F8220D27
.text:F8220CF7  mov   ecx, [eax+10h]
.text:F8220CFA  mov   eax, edi
.text:F8220CFC  sub   eax, ecx
.text:F8220CFE  mov   eax, [esi+eax*4]
.text:F8220D01  add   eax, edx
.text:F8220D03  mov   edx, [esp+30h+arg_8]
.text:F8220D07  test  edx, edx
.text:F8220D09  jz   loc_F8220DE3
.text:F8220D0F  mov   ebx, ecx
.text:F8220D11  shl   ebx, 1Eh
.text:F8220D14  sub   ebx, ecx
.text:F8220D16  add   ebx, edi
.text:F8220D18  pop   edi
.text:F8220D19  lea   ecx, [esi+ebx*4]
.text:F8220D1C  pop   esi
.text:F8220D1D  pop   ebp
.text:F8220D1E  mov   [edx], ecx
.text:F8220D20  pop   ebx
.text:F8220D21  add   esp, 20h
.text:F8220D24  retn  0Ch
.text:F8220D27 ; ---------------------------------------------------------------------------
.text:F8220D27
.text:F8220D27 loc_F8220D27:       ; CODE XREF: LookupExportedFunction+55j
.text:F8220D27  mov   edi, [eax+14h]
.text:F8220D2A  mov   [esp+30h+arg_0], 0
.text:F8220D32  test  edi, edi
.text:F8220D34  mov   [esp+30h+var_8], edi
.text:F8220D38  jbe   loc_F8220DE1
.text:F8220D3E  mov   [esp+30h+var_1C], esi
.text:F8220D42
.text:F8220D42 loc_F8220D42:       ; CODE XREF: LookupExportedFunction+13Bj
.text:F8220D42  cmp   dword ptr [esi], 0
.text:F8220D45  jz   short loc_F8220DC5
.text:F8220D47  mov   ecx, [eax+18h]
.text:F8220D4A  xor   ebp, ebp
.text:F8220D4C  test  ecx, ecx
.text:F8220D4E  mov   [esp+30h+var_10], ecx
.text:F8220D52  jbe   short loc_F8220DC5
.text:F8220D54  mov   edi, [esp+30h+var_18]
.text:F8220D58  mov   [esp+30h+var_20], ebx
.text:F8220D5C
.text:F8220D5C loc_F8220D5C:       ; CODE XREF: LookupExportedFunction+11Bj
.text:F8220D5C  mov   ebx, [esp+30h+var_20]
.text:F8220D60  xor   esi, esi
.text:F8220D62  mov   si, [ebx]
.text:F8220D65  mov   ebx, [esp+30h+arg_0]
.text:F8220D69  cmp   esi, ebx
.text:F8220D6B  jnz   short loc_F8220DAA
.text:F8220D6D  mov   eax, [edi]
.text:F8220D6F  mov   esi, [esp+30h+arg_4]
.text:F8220D73  add   eax, edx
.text:F8220D75
.text:F8220D75 loc_F8220D75:       ; CODE XREF: LookupExportedFunction+F3j
.text:F8220D75  mov   bl, [eax]
.text:F8220D77  mov   cl, bl
.text:F8220D79  cmp   bl, [esi]
.text:F8220D7B  jnz   short loc_F8220D99
.text:F8220D7D  test  cl, cl
.text:F8220D7F  jz   short loc_F8220D95
.text:F8220D81  mov   bl, [eax+1]
.text:F8220D84  mov   cl, bl
.text:F8220D86  cmp   bl, [esi+1]
.text:F8220D89  jnz   short loc_F8220D99
.text:F8220D8B  add   eax, 2
.text:F8220D8E  add   esi, 2
.text:F8220D91  test  cl, cl
.text:F8220D93  jnz   short loc_F8220D75
.text:F8220D95
.text:F8220D95 loc_F8220D95:       ; CODE XREF: LookupExportedFunction+DFj
.text:F8220D95  xor   eax, eax
.text:F8220D97  jmp   short loc_F8220D9E
.text:F8220D99 ; ---------------------------------------------------------------------------
.text:F8220D99
.text:F8220D99 loc_F8220D99:       ; CODE XREF: LookupExportedFunction+DBj
.text:F8220D99        ; LookupExportedFunction+E9j
.text:F8220D99  sbb   eax, eax
.text:F8220D9B  sbb   eax, 0FFFFFFFFh
.text:F8220D9E
.text:F8220D9E loc_F8220D9E:       ; CODE XREF: LookupExportedFunction+F7j
.text:F8220D9E  test  eax, eax
.text:F8220DA0  jz   short loc_F8220DED
.text:F8220DA2  mov   eax, [esp+30h+var_14]
.text:F8220DA6  mov   ecx, [esp+30h+var_10]
.text:F8220DAA
.text:F8220DAA loc_F8220DAA:       ; CODE XREF: LookupExportedFunction+CBj
.text:F8220DAA  mov   esi, [esp+30h+var_20]
.text:F8220DAE  inc   ebp
.text:F8220DAF  add   esi, 2
.text:F8220DB2  add   edi, 4
.text:F8220DB5  cmp   ebp, ecx
.text:F8220DB7  mov   [esp+30h+var_20], esi
.text:F8220DBB  jb   short loc_F8220D5C
.text:F8220DBD  mov   ebx, [esp+30h+var_C]
.text:F8220DC1  mov   edi, [esp+30h+var_8]
.text:F8220DC5
.text:F8220DC5 loc_F8220DC5:       ; CODE XREF: LookupExportedFunction+A5j
.text:F8220DC5        ; LookupExportedFunction+B2j
.text:F8220DC5  mov   ecx, [esp+30h+arg_0]
.text:F8220DC9  mov   esi, [esp+30h+var_1C]
.text:F8220DCD  inc   ecx
.text:F8220DCE  add   esi, 4
.text:F8220DD1  cmp   ecx, edi
.text:F8220DD3  mov   [esp+30h+arg_0], ecx
.text:F8220DD7  mov   [esp+30h+var_1C], esi
.text:F8220DDB  jb   loc_F8220D42
.text:F8220DE1
.text:F8220DE1 loc_F8220DE1:       ; CODE XREF: LookupExportedFunction+10j
.text:F8220DE1        ; LookupExportedFunction+21j ...
.text:F8220DE1  xor   eax, eax
.text:F8220DE3
.text:F8220DE3 loc_F8220DE3:       ; CODE XREF: LookupExportedFunction+69j
.text:F8220DE3        ; LookupExportedFunction+162j
.text:F8220DE3  pop   edi
.text:F8220DE4  pop   esi
.text:F8220DE5  pop   ebp
.text:F8220DE6  pop   ebx
.text:F8220DE7  add   esp, 20h
.text:F8220DEA  retn  0Ch
.text:F8220DED ; ---------------------------------------------------------------------------
.text:F8220DED
.text:F8220DED loc_F8220DED:       ; CODE XREF: LookupExportedFunction+100j
.text:F8220DED  mov   eax, [esp+30h+var_4]
.text:F8220DF1  mov   ecx, [esp+30h+arg_0]
.text:F8220DF5  lea   ecx, [eax+ecx*4]
.text:F8220DF8  mov   eax, [ecx]
.text:F8220DFA  add   eax, edx
.text:F8220DFC  mov   edx, [esp+30h+arg_8]
.text:F8220E00  test  edx, edx
.text:F8220E02  jz   short loc_F8220DE3
.text:F8220E04  pop   edi
.text:F8220E05  pop   esi
.text:F8220E06  pop   ebp
.text:F8220E07  mov   [edx], ecx
.text:F8220E09  pop   ebx
.text:F8220E0A  add   esp, 20h
.text:F8220E0D  retn  0Ch
.text:F8220E0D LookupExportedFunction endp

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

正在加载评论...