eWebEditor oday的特点和修补方法
>首页 -> 社会专题 -> 硬件网络 2010-07-08 来源: 作者: 【】 浏览:1158

分下列步骤进行:

第一步:下载eWebEditor2.8 修正版

下载地址http://ewebeditor.webasp.net/download.asp

解压放到项目文件目录下. 为了方便使用我把文件改名为ewebeditor

第二步:修改相关调用到编辑器的ASP文件

<****** ID="Editor" src="ewebeditor/ewebeditor.asp?Id=NewsContent&style=s_newssystem" frameborder="0" scrolling="no" width="100%" HEIGHT="100%"></******>

第三步:修改eWebEditor编辑器

1,使之支持插入分页符

打开eWebEditor/db/ewebeditor.mdb =>

打开eWebEditor_Button表=>

在倒数的21行

B_Title 字段的值为”显示或隐藏指导方针”修改为”插入系统分页符”

B_Event 字段的值为” showBorders()”修改为” insert('SplitPage')”

打开 WebEditor/Include/Editor.js

在777行之前插入

case "SplitPage":    // 插入分页符

insertHTML("<HR sysPageSplitFlag>");

break;

2,修改编辑器上传文件的保存路径

打开eWebEditor_Style表

找到你使用的样式所在的行,我用的是s_newssystem 修改 S_UploadDir 字段的值

我是改成/UpLoadFiles/

这样我用编辑器上传的图片等都会在根目录的UpLoadFiles文件夹下.

第四步:编辑器的安全性

1、应及时修改该编辑器的默认数据库路径(db)和数据库名称(ewebeditor.mdb),并在Include/Startup.asp中更改连接语句,防止数据库被黑客非法下载,更改EWebEditor文件夹名称为不容易猜测到的!

2、删除目录下所有以Admin开头的.asp文件,防止黑客进入后台管理界面

3、修改样式表中的文件上传路径,保护编辑器路径不被直接看到,或者打开数据库中的表eWebEditor_Style,修改S_UploadDir内容.比如"/UploadFile/"表示所有文件上传到网站根目录下的UploadFile目录内,这样让一些人通过查看图片地址不能直接看到编辑器的地址!

4、对Upload.asp语句进行修改,防止黑客利用其上传ASP木马从而获得WEB权限

在Upload.asp文件里面,找到这句话sAllowExt = Replace(UCase(sAllowExt), "ASP", "")

把这句话替换为

 Do While InStr(sAllowExt, "ASP") or InStr(sAllowExt, "CER") or InStr(sAllowExt, "ASA") or InStr(sAllowExt, "CDX") or InStr(sAllowExt, "HTR")

sAllowExt = Replace(sAllowExt, "ASP", "")

sAllowExt = Replace(sAllowExt, "CER", "")

sAllowExt = Replace(sAllowExt, "ASA", "")

sAllowExt = Replace(sAllowExt, "CDX", "")

sAllowExt = Replace(sAllowExt, "HTR", "")

sAllowExt = Replace(sAllowExt, "CGI", "")

sAllowExt = Replace(sAllowExt, "ASPX", "")'

sAllowExt = Replace(sAllowExt, "ASP .JPG", "")

sAllowExt = Replace(sAllowExt, "CER .JPG", "")

sAllowExt = Replace(sAllowExt, "ASA .JPG", "")

sAllowExt = Replace(sAllowExt, "CDX .JPG", "")

sAllowExt = Replace(sAllowExt, "HTR .JPG", "")

sAllowExt = Replace(sAllowExt, "CGI .JPG", "")

sAllowExt = Replace(sAllowExt, "ASPX .JPG", "")  

Loop

5、及时对网站服务器IIS配置中的应用程序扩展名映射进行整理,确保其它类型的文件不能在服务器网站上运行

EWebEditor漏洞改进方法:

1.在EWebEditor中加入IP控制

<%

''建立连接

dim conn,connstr

connstr="driver={sql server};server=.;uid=yst06;pwd=yst06;database=yst06"

set conn=Server.Createobject("ADODB.Connection")

conn.open connstr

''***************************************************

''功能:实现字符长度的控制

''参数:cutstr

''***************************************************

function cutstr(tempstr,tempwid)

if len(tempstr)>tempwid then

cutstr=left(tempstr,tempwid)&"..."

else

cutstr=tempstr

end if

end function

userip = Request.ServerVariables("HTTP_X_FORWARDED_FOR")

If userip = "" Then

userip = Request.ServerVariables("REMOTE_ADDR")

end if

userip=cstr(userip)

''Response.write userip&"<br>"

''Response.write Instr(userip,"*")-2

''Response.End()

''ip="210.29.168.123"

''Response.write Instr(ip,"*")

''Response.end()

set rs=server.createobject("adodb.recordset")

sql="select * from IP where state=1"

rs.open sql,conn,1,1

do while not rs.eof

TrustIp = Trim(Rs("IP"))

if Instr(TrustIp,"*")=0 then

if TrustIp = userip then

UserIpTrusted = True

exit do

else

rs.movenext

end if

else

Position=Instr(TrustIp,"*")-2

if left(TrustIp,Position) = left(userip,Position) then

UserIpTrusted = True

exit do

else

rs.movenext

end if

end if

loop

if UserIpTrusted = False then

Response.write "<script language=''javascript''>alert(''非法的IP登录,请与管理员联系!'');location.href=''../index.asp'';</script>"

end if

%>

2.更改EWebEditor文件夹名称

3.修改EWebEditor管理后台(用户名/密码/允许文件上传类型)

4.修改EWebEditor中文件过滤类型asp,cer,cdx,htr,stm,asa(Upload.asp)'' 任何情况下都不允许上传asp,CER,ASA,CDX,HTR,stm脚本文件sAllowExt = Replace(Replace(Replace(Replace(Replace(Replace(UCase(sAllowExt), "ASP", "**"), "CER", "**"), "ASA", "**"), "CDX", "**"), "HTR", "**"),"stm","**")(这个不建议,还是用上面其它人写的过滤代码吧)

5.修改EWebEditor的数据库路径,并在Include/Startup.asp中更改连接语句.

您看到此篇文章时的感受是:
Tags: 责任编辑:佚名
免责申明: 除原创及很少部分因网文图片遗失而补存外,本站不存储任何有版权的内容。你看到的文章和信息及网址索引均由机器采集自互联网,由于时间不同,内容可能完全不同,请勿拿本网内容及网址索引用于交易及作为事实依据,仅限参考,不会自行判断者请勿接受本站信息,本网转载,并不意味着赞同其观点或证实其内容的真实性.如涉及版权等问题,请立即联系管理员,我们会予以更改或删除,保证您的权利.对使用本网站信息和服务所引起的后果,本网站不作任何承诺.
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论:0条】 【关闭】 【返回顶部
更多
上一篇怎样保证高敏感度的Web目录的安全 下一篇详述几种常用的漏洞检测方法
密码: (新用户注册)

最新文章

图片主题

热门文章

推荐文章

相关文章

便民服务

手机扫描

空间赞助

快速互动

论坛互动
讨论留言

有事联系

有哪个那个什么的,赶紧点这里给DOVE发消息

统计联系

MAIL:gnlt@Dovechina.com
正在线上:

版权与建议

任何你想说的