和添加上传达小限制相同,主要是对fckeditor\editor\filemanager\connectors\asp文件下的config.asp和commands.asp的修改。
1.config.asp的修改
在config.asp 文嘉最后面添加下面的函数,对于木马的检测主要是通过这个函数实现的
Function CheckFileSafe(sFilePath)
'使用文本方式打开文件,检测文本中有无危险代码
Dim CheckFso,ObjReadFile,sFileTextAll,IsFileSafe,sNotSafe,NotSafeList,ListLoop
'危险字符串
sNotSafe=".getfolder|.createfolder|.deletefolder|.createdirectory|.deletedirectory|.saveas|wscript.shell|script.encode|server.|.createobject|execute|activexobject|language="
NotSafeList=Split(sNotSafe,"|")
IsFileSafe=True
Set CheckFso=Server.CreateObject( "Scripting.FileSystemObject" )
'判断文件是否存在
If CheckFso.FileExists(sFilePath) then
'以文本方式读取文件,并转换为小写
Set ObjReadFile = CheckFso.OpenTextFile(sFilePath, 1)
sFileTextAll=Lcase(ObjReadFile.ReadAll