Microsoft Windows Tracing功能超长注册表字符串内存破坏漏洞

受影响系统:

Microsoft Windows Vista SP2
Microsoft Windows Vista SP1
Microsoft Windows Server 2008 SP2
Microsoft Windows Server 2008 R2
Microsoft Windows Server 2008
Microsoft Windows 7

描述:


BUGTRAQ  ID: 42259
CVE(CAN) ID: CVE-2010-2555

Microsoft Windows是微软发布的非常流行的操作系统。

一些Windows应用中使用了Tracing功能记录调试信息。该功能不是默认启用的,如果要启用必须编辑HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Tracing键下的注册表值。使用了这个Tracing功能的Windows进程会持续监控相关子键的变化,一旦注册表值发生了变化就会立即读取该值。其中的一个注册表值为FileDirectory,包含有Windows目录名。如果将该值设置为超过260个字符的超长字符串,则进程读取该值就可以触发内存破坏,导致崩溃或执行任意代码。注册表项对Users组开放了Set Value权限,因此任何通过认证的用户都可以设置任意值。

<*来源:Cesar Cerrudo (cesarc56@yahoo.com
  
  链接:http://secunia.com/advisories/40817/
        http://www.argeniss.com/research/ARGENISS-ADV-081001.txt
        http://www.microsoft.com/technet/security/bulletin/MS10-059.mspx?pf=true
        http://www.us-cert.gov/cas/techalerts/TA10-222A.html
*>

测试方法:


警 告

以下程序(方法)可能带有攻击性,仅供安全研究与教学之用。使用者风险自负!

1 – 找到HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Tracing\tapi32。
2 – 将EnableFileTracing值设置为1以启用Tracing功能。
3 – 调试dialer.exe应用。
4 – 将FileDirectory值设置为超过260字符的超长字符串,dialer.exe进程会监控注册表更改,因此会读取这个值。
5 – 查看调试器

74082022 8d85e8fdffff    lea     eax,[ebp-218h]
74082028 50              push    eax
74082029 8d85f0fdffff    lea     eax,[ebp-210h]
7408202f 50              push    eax
74082030 8d85e4fdffff    lea     eax,[ebp-21Ch]
74082036 50              push    eax
74082037 6a00            push    0
74082039 681c1d0874      push    offset rtutils!TracePrintfExA+0x148 (74081d1c)
7408203e ffb5e0fdffff    push    dword ptr [ebp-220h]
74082044 bb04010000      mov     ebx,104h                //buffer is only 260 bytes
74082049 899de8fdffff    mov     dword ptr [ebp-218h],ebx
7408204f c685f4feffff00  mov     byte ptr [ebp-10Ch],0
74082056 ffd7            call    edi {kernel32!RegQueryValueExA (775d2697)}  //if string in registry value is bigger than buffer then buffer is empty and ebp-218h has the string value length
74082058 85c0            test    eax,eax
7408205a 0f85271c0000    jne     rtutils!TraceDeregisterExA+0x8cd (74083c87)
74082060 83bde4fdffff02  cmp     dword ptr [ebp-21Ch],2
74082067 0f850d1c0000    jne     rtutils!TraceDeregisterExA+0x8c0 (74083c7a)
7408206d 8b85e8fdffff    mov     eax,dword ptr [ebp-218h]
74082073 53              push    ebx
74082074 c68405f0fdffff00 mov     byte ptr [ebp+eax-210h],0   //<– Here is the problem when trying to put null at end of string, eax value can be controlled and it’s possible to overwrite an address relative to ebp with a null value

建议:


厂商补丁:

Microsoft
———
Microsoft已经为此发布了一个安全公告(MS10-059)以及相应补丁:
MS10-059:Vulnerabilities in the Tracing Feature for Services Could Allow Elevation of Privilege (982799)
链接:http://www.microsoft.com/technet/security/bulletin/MS10-059.mspx?pf=true

发表评论?

0 条评论。

发表评论