Lazy loaded image
安全研究
契约锁-电子签约管理控制台-dbtest接口JDBC反序列化漏洞复现
字数 650阅读时长 2 分钟
2025-6-13
2025-6-24
type
status
date
slug
summary
tags
category
icon
password

基本信息

指纹信息:
默认端口为:9181
POC:
界面如图所示:
notion image
漏洞影响版本号:
 

漏洞详细分析

漏洞source位于:com.qiyuesuo.setup.SetupController#dbtest()
只会简单判断参数Host,Port,Name和Username是否存在,不判断password,所以Payload里面可以不用加password
这些参数用户可以完全可控
notion image
com.qiyuesuo.setup.SetupService#check
notion image
com.qiyuesuo.setup.SetupService#dbtest
notion image
com.qiyuesuo.database.DatabaseService#getConnection
notion image
com.qiyuesuo.database.DatabaseService#getConnectionManager
notion image
com.qiyuesuo.database.DatabaseService#getConnectionManager
notion image
com.qiyuesuo.database.DatabaseConnection#getConnection
notion image
漏洞sink,jdbc url用户可控导致类加载任意字节码
java.lang.Class#forName(java.lang.String)
notion image
整个Gadget
 
系统支持如下数据库驱动
com.qiyuesuo.config.ConsoleConfiguration 可以看出dbtest接口在setup路径下,不需要鉴权,所以这个洞是一个前台洞
notion image
接口修复前:
notion image
 
补丁修复:
notion image
 
接口修复后:
notion image

MySql任意文件读取

在下面这些范围的都能打这个洞:
Payload:
notion image
notion image
文件读取如图所示:
notion image
 

PostgreSQL RCE

打CVE-2022-21724需要满足PostgreSQL版本如下:
实测在5.1.*的20241122版本中PostgreSQL 版本为42.5.5不满足
notion image
在4.3.*的20230203版本中满足版本
notion image
预测能打的版本在下面
直接用Java Chains 起一个Http Server Payload「这里直接以打内存马为例,实战中一般是先打DNSLOG,再打内存马」
notion image
notion image
payload1:
 
notion image
 
 
 
payload2:
notion image
notion image
 
notion image
 

参考

感谢le1a师傅的帮助
 
上一篇
2022CISCN初赛WriteUp
下一篇
H5页面调试抓包