|  
 帖子460 积分963 威望1445  金钱821  在线时间5 小时 
 | 
| MPEG2 0DAY漏洞分析报告 
 
 
 
 
 
 ??该漏洞表现在在MSVidCtl.dll(xpsp2:6.5.2600.2180,vista:6.5.6000.16386)中,MSVidCtl.dll为系统标准组件。产生漏洞的原因是不正确读取持久化的字节数组(VT_UI1|VT_ARRAY),攻击者可以通过构造特殊的文件触发该漏洞,最终导致以当前进程权限执行任意代码。 黑客
 
 以下是存在漏洞代码的分析:
 以6.5.2600.2180版本的MSVidCtl.dll为例:
 
 .text:59F0D5E3                 push    edi
 .text:59F0D5E4                 mov     edi, [ebp+arg_3C] 网络安全
 .text:59F0D5E7                 mov     eax, [edi]
 .text:59F0D5E9                 push    ebx
 .text:59F0D5EA                 push    2
 .text:59F0D5EC                 lea     ecx, [ebp+vt]
 .text:59F0D5EF                 push    ecx
 .text:59F0D5F0                 push    edi
 .text:59F0D5F1                 call    dword ptr [eax+0Ch] 网络安全
 .text:59F0D5F4                 cmp     eax, 1
 .text:59F0D5F7                 jnz     short loc_59F0D5FE 信息来自:http://www.3ast.com.cn
 .text:59F0D5F9                 mov     eax, 80004005h
 
 在0x59F0D5F1处,读取了2字节,以确定被读取的VARIANT的类型(VARTYPE)。
 
 .text:59F0D67F                 cmp     eax, 2011h
 .text:59F0D684                 jnz     loc_59F0D70E
 .text:59F0D68A                 mov     eax, [edi]
 .text:59F0D68C                 push    ebx
 .text:59F0D68D                 push    8
 .text:59F0D68F                 lea     ecx, [ebp+cElmts] 信息来自:http://www.3ast.com.cn
 .text:59F0D692                 push    ecx
 .text:59F0D693                 push    edi
 .text:59F0D694                 call    dword ptr [eax+0Ch] 网络安全
 .text:59F0D697                 cmp     eax, ebx
 .text:59F0D699                 jl      loc_59F0D760
 .text:59F0D69F                 cmp     eax, 1
 
 接着,从0x59F0D68A处开始进入VARTYPE为2011h,即VT_UI1|VT_ARRAY的处理流程:在0x59F0D694处读取了8个字节,但只使用低32位来确定该字节数组的大小。 .text:59F0D6E8                 push    [ebp+cElmts]
 .text:59F0D6EB             lea     ecx, [ebp+ pvData]
 .text:59F0D6EE             push    ecx
 .text:59F0D6EF             push    edi
 .text:59F0D6F0             call    dword ptr [eax+0Ch] 网络安全
 .text:59F0D6F3                 push    ebx             ; psa 黑客
 .text:59F0D6F4                 mov     [ebp+var_18], eax 黑客
 .text:59F0D6F7                 call    ds:SafeArrayUnaccessData 黑客
 .text:59F0D6FD                 mov     eax, [ebp+var_18]
 .text:59F0D700                 test    eax, eax
 .text:59F0D702                 jl      short loc_59F0D760 网络安全
 .text:59F0D704                 cmp     eax, 1
 .text:59F0D707                 jz      short loc_59F0D6A4 黑客
 .text:59F0D709                 mov     [esi+8], ebx
 .text:59F0D70C                 xor     ebx, ebx
 
 接下来,使用SafeArrayAccessData获得SAFEARRAY的数据区域,并将该指针保存到局部变量pvData(ebp+8)中。 黑客
 
 在0x59F0D6EB处,代码错误地将pvData的地址作为IStream::Read (0x59F0D6F0)的参数,而不是pvData的值,而该值指向的内存才是真正用于存放从流中读取数据的缓冲区。 网络安全
 
 这样就导致了以下情况:试图将任意长度的数据放入原本4字节长度的内存中,导致了缓冲区溢出。
 
 攻击者可随意覆盖SEH或者RET,将EIP设置成任意数值。结合JS堆喷射,“挂马”利用成功率将相当高,风险很大。 网络安全
 
 注:
 在6.5.6000.16386版本的MSVidCtl.dll中,也存在类似代码:
 
 .text:37D46DFF                 push    ebx
 .text:37D46E00                 push    8
 .text:37D46E02                 lea     ecx, [ebp-20h]; 数组大小 信息来自:http://www.3ast.com.cn
 .text:37D46E05                 push    ecx
 .text:37D46E06                 push    edi
 .text:37D46E07                 call    dword ptr [eax+0Ch] 网络安全
 …
 …
 .text:37D46E42                 lea     eax, [ebp+0Ch]
 .text:37D46E45                 push    eax             ; ppvData
 .text:37D46E46                 push    ebx             ; psa 黑客
 .text:37D46E47                 call    ds:SafeArrayAccessData 信息来自:http://www.3ast.com.cn
 .text:37D46E4D                     test    eax, eax
 .text:37D46E4F                     jl      loc_37D46ED5 黑客
 .text:37D46E55                     mov     eax, [edi]
 .text:37D46E57                     push    0
 .text:37D46E59                 push    dword ptr [ebp-20h]; 数组大小 网络安全
 .text:37D46E5C                 lea     ecx, [ebp+0Ch]
 .text:37D46E5F                 push    ecx ; 读取缓冲区指向参数 黑客
 .text:37D46E60                 push    edi
 .text:37D46E61                 call    dword ptr [eax+0Ch] 黑客
 .text:37D46E64                      push    ebx             ; psa 网络安全
 
 但是在VISTA+IE7环境下,该漏洞并不会触发,因为导致漏洞的代码不会被调用到。
 | 
 |