Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mcms v5.2.8文件上传漏洞 #95

Closed
1orangeSky opened this issue May 27, 2022 · 3 comments
Closed

Mcms v5.2.8文件上传漏洞 #95

1orangeSky opened this issue May 27, 2022 · 3 comments

Comments

@1orangeSky
Copy link

1.代码分析
从铭飞官网https://gitee.com/mingSoft/MCMS把源码考下来之后
经过审计找到上传点,form.ftl这里有个文章缩略图上传点看他有没有做过滤然后根据action找到上传接口
1

经过查找在FileAction.class这里只判断了../防止目录跳跃,继续往下看点击继承的那个类
2
BaseFileAction.class发现他这做了后缀判断接着看是在哪调用的过滤
3
我们复制denied全局搜索,application.yml发现他是在配置文件里写了过滤,过滤了 exe,jsp,jspx,sh那说明除了这四个其他都可以上传
4
5
接着看看他有没有可利用的接口来实现上传jsp,经过查找TemplateAction.class里有个专门解析zip的接口。那么结合上面的过滤 可以上传zip,可以通过zip包含jsp恶意文件上传上去 然后调用这个接口去解析zip并解析树jsp并访问。
6

2.根据分析的代码操作
找到文章缩略图地址,点击上传zip
7
8
上传上去之后右键复制图片路径,然后通过上面分析的调用解析zip的接口fileUrl=刚刚上传的zip回车提示执行成功
9
10
11
之后查看上传目录的地方,发现成功解压了在通过路径访问aaaaa.jsp,然后利用哥斯拉去连接他发现执行成功
12
13
14

.

@IMBALaunched
Copy link

您是如何配置环境的,我用idea搭建环境后,存放上传文件的目录下不对jsp文件进行解析

@killfen
Copy link
Contributor

killfen commented Sep 9, 2022

5.2.9 fix it

@killfen killfen closed this as completed Sep 9, 2022
@1orangeSky
Copy link
Author

1orangeSky commented Oct 11, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants