OKLite v1.2.25 任意文件删除漏洞(CVE-2019-16132)
漏洞描述:
An issue was discovered in OKLite v1.2.25. framework/admin/tpl_control.php allows remote attackers to delete arbitrary files via a title directory-traversal pathname followed by a crafted substring.
影响版本:
OKLite v1.2.25
漏洞复现:
首先,下载并安装OKLite v1.2.25,请注意php版本以及中间件的问题,可能会导致页面显示不正常
![](https://raw.githubusercontent.com/DarkLord-W/CloudImage/main/Image/image-20201119090346210.png)
登陆后台,选择右上角设置–>风格管理–>文件管理
![](https://raw.githubusercontent.com/DarkLord-W/CloudImage/main/Image/image-20201119090736397.png)
![](https://raw.githubusercontent.com/DarkLord-W/CloudImage/main/Image/image-20201119090943952.png)
预先在OKLite的网站根目录下创建几个测试文件,如test1,test2等等
![](https://raw.githubusercontent.com/DarkLord-W/CloudImage/main/Image/image-20201119091513274.png)
开启burpsuite代理,然后点击上图中任意一个文件的删除选项
下图中是正常的删除数据包,但是在title的值处,可以使用 …/ 进行目录回溯删除上级目录中的任意文件
![](https://raw.githubusercontent.com/DarkLord-W/CloudImage/main/Image/image-20201119091620187.png)
修改要删除的文件为OKLite的网站根目录下的test1文件
返回 ok 说明删除成功,可以看一下根目录下的文件
![](https://raw.githubusercontent.com/DarkLord-W/CloudImage/main/Image/image-20201119092026083.png)
漏洞复现成功
漏洞分析:
后台删除文件的代码如下图所示:
[
232 //删除文件(夹)
233 public function delfile_f()
234 {
235 $id = $this->get("id","int");
236 if(!$id) $this->json(P_Lang('未指定风格ID'));
237 $rs = $this->model('tpl')->get_one($id);
238 if(!$rs) $this->json(P_Lang('风格信息不存在'));
239 if(!$rs["folder"]) $this->json(P_Lang('未设置风格文件夹'));
240 $folder = $this->get(