最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

asp 判斷上傳文件中是否存在危險(xiǎn)代碼

 更新時(shí)間:2009年11月06日 00:18:09   作者:  
判斷上傳文件中是否存在危險(xiǎn)代碼
復(fù)制代碼 代碼如下:

<%
function CheckFileContent(FileName)
dim ClientFile,ClientText,ClientContent,DangerString,DSArray,AttackFlag,k
set ClientFile=Server.CreateObject("Scripting.FileSystemObject")
set ClientText=ClientFile.OpenTextFile(Server.MapPath(FileName),1)
ClientContent=LCase(ClientText.ReadAll)
set ClientText=nothing
set ClientFile=nothing
AttackFlag=false
DangerString=".getfolder|.createfolder|.deletefolder|.createdirectory|.deletedirectory|.saveas|wscript.shell|script.encode|server.|.createobject|execute|activexobject|language=|include|filesystemobject|shell.application"
DSArray=split(DangerString,"|")

for k=0 to UBound(DSArray)

if InStr(ClientContent,DSArray(k))>0 then '判斷文件內(nèi)容中是否包含有危險(xiǎn)的操作字符,如有,則必須刪除該文件。
AttackFlag=true
exit for
end if

next

CheckFileContent=AttackFlag
end function

If CheckFileContent("0.jpg")=true then
Response.Write "危險(xiǎn)"
else
Response.Write "安全"
end if
%>

相關(guān)文章

最新評(píng)論

上思县| 霍城县| 腾冲县| 静宁县| 巧家县| 星座| 中超| 翁源县| 清丰县| 六枝特区| 大庆市| 湖州市| 广宁县| 怀安县| 革吉县| 库车县| 安泽县| 桂东县| 湘潭市| 射阳县| 锡林郭勒盟| 剑川县| 晋宁县| 五寨县| 铜川市| 灌南县| 蕲春县| 永康市| 新兴县| 洪泽县| 团风县| 南江县| 临泽县| 滁州市| 石林| 当阳市| 武川县| 汉川市| 柞水县| 井陉县| 九龙城区|