Sign in
Sign up
Explore
Enterprise
Education
Search
Help
Terms of use
About Us
Explore
Enterprise
Education
Gitee Premium
Gitee AI
AI teammates
Sign in
Sign up
Fetch the repository succeeded.
Open Source
>
Web System
>
Content Management System
&&
Donate
Please sign in before you donate.
Cancel
Sign in
Scan WeChat QR to Pay
Cancel
Complete
Prompt
Switch to Alipay.
OK
Cancel
Watch
Unwatch
Watching
Releases Only
Ignoring
4.2K
Star
32.4K
Fork
7.5K
GVP
铭飞
/
MCMS
Code
Issues
8
Pull Requests
1
Wiki
Insights
Pipelines
Service
JavaDoc
Quality Analysis
Jenkins for Gitee
Tencent CloudBase
Tencent Cloud Serverless
悬镜安全
Aliyun SAE
Codeblitz
SBOM
DevLens
Don’t show this again
Update failed. Please try again later!
Remove this flag
Content Risk Flag
This task is identified by
as the content contains sensitive information such as code security bugs, privacy leaks, etc., so it is only accessible to contributors of this repository.
恶意文件写入
Done
#I6592F
京墨
Opened this issue
2022-12-08 13:00
# 漏洞利用条件 Window环境 Tomcat部署war包运行 # 影响版本 目前测试发现 5.2.8、5.2.9、5.2.10都存在此漏洞 # 漏洞分析 漏洞触发点:后台系统管理->模板管理->编辑模板文件  这里我新上传了一个文件,编辑并保存,抓包查看  保存模板文件接口:`ms/template/writeFileContent.do` 根据接口查找实现代码 在net.mingsoft:ms-basic:2.1.14.1.jar包里> `net\mingsoft\ms-basic\2.1.14.1\ms-basic-2.1.14.1.jar!\net\mingsoft\basic\action\TemplateAction.class`  首先获取了文件名(fileName)进行判断文件后缀是否属于黑名单中的文件名(193-195) 调试查看系统黑名单  黑名单中的后缀:`exe,jsp,xml,sh,bat,py,ftl,jspx` 后面就是常规的对文件名进行判空然后将文件路径与文件名拼接写入操作 由于是直接对文件路径进行拼接,可以自行构造上传路径  但是加了一层判断,对于oldFileName和fileName文件名是否一致进行判断 如果不一致就将文件名重命名移动到newName,然后将oldFileName的文件进行删除 对于黑名单的绕过我想针对Windows系统相对容易一些如`shell.jsp.` 构造poc `fileName=test%5ctest.jsp.&name=testmoban.html&fileNamePrefix=template%5C1%2F%5Cdefault%5C&fileContent=shell text&oldFileName=test%5ctest.jsp.` 上传godzilla的webshell  测试连接状态  成功getshell  > 在Windows系统下使用tomcat部署war包可以绕过系统黑名单且可执行jsp文件
# 漏洞利用条件 Window环境 Tomcat部署war包运行 # 影响版本 目前测试发现 5.2.8、5.2.9、5.2.10都存在此漏洞 # 漏洞分析 漏洞触发点:后台系统管理->模板管理->编辑模板文件  这里我新上传了一个文件,编辑并保存,抓包查看  保存模板文件接口:`ms/template/writeFileContent.do` 根据接口查找实现代码 在net.mingsoft:ms-basic:2.1.14.1.jar包里> `net\mingsoft\ms-basic\2.1.14.1\ms-basic-2.1.14.1.jar!\net\mingsoft\basic\action\TemplateAction.class`  首先获取了文件名(fileName)进行判断文件后缀是否属于黑名单中的文件名(193-195) 调试查看系统黑名单  黑名单中的后缀:`exe,jsp,xml,sh,bat,py,ftl,jspx` 后面就是常规的对文件名进行判空然后将文件路径与文件名拼接写入操作 由于是直接对文件路径进行拼接,可以自行构造上传路径  但是加了一层判断,对于oldFileName和fileName文件名是否一致进行判断 如果不一致就将文件名重命名移动到newName,然后将oldFileName的文件进行删除 对于黑名单的绕过我想针对Windows系统相对容易一些如`shell.jsp.` 构造poc `fileName=test%5ctest.jsp.&name=testmoban.html&fileNamePrefix=template%5C1%2F%5Cdefault%5C&fileContent=shell text&oldFileName=test%5ctest.jsp.` 上传godzilla的webshell  测试连接状态  成功getshell  > 在Windows系统下使用tomcat部署war包可以绕过系统黑名单且可执行jsp文件
Comments (
2
)
Sign in
to comment
Status
Done
Backlog
Doing
Done
Closed
Assignees
Not set
Labels
Not set
Label settings
Milestones
No related milestones
No related milestones
Pull Requests
None yet
None yet
Successfully merging a pull request will close this issue.
Branches
No related branch
Branches (
-
)
Tags (
-
)
Planed to start   -   Planed to end
-
Top level
Not Top
Top Level: High
Top Level: Medium
Top Level: Low
Priority
Not specified
Serious
Main
Secondary
Unimportant
参与者(3)
Java
1
https://gitee.com/mingSoft/MCMS.git
git@gitee.com:mingSoft/MCMS.git
mingSoft
MCMS
MCMS
Going to Help Center
Search
Git 命令在线学习
如何在 Gitee 导入 GitHub 仓库
Git 仓库基础操作
企业版和社区版功能对比
SSH 公钥设置
如何处理代码冲突
仓库体积过大,如何减小?
如何找回被删除的仓库数据
Gitee 产品配额说明
GitHub仓库快速导入Gitee及同步更新
什么是 Release(发行版)
将 PHP 项目自动发布到 packagist.org
Comment
Repository Report
Back to the top
Login prompt
This operation requires login to the code cloud account. Please log in before operating.
Go to login
No account. Register