asp防止上傳圖片木馬原理
當(dāng)前位置:點(diǎn)晴教程→知識(shí)管理交流
→『 技術(shù)文檔交流 』
asp防止上傳木馬原理:[br][br]首先判斷文件大小:[br]if file.filesize<10 then[br] response.write("")[br] response.write("")[br] response.end()[br]end if[br][br]將文件上傳到服務(wù)器后,判斷用戶文件中的危險(xiǎn)操作字符:[br][br]set myfile = server.createobject("scripting.filesystemobject")[br]set mytext = myfile.opentextfile(filepath, 1) '讀取文本文件[br]stextall = lcase(mytext.readall)[br]mytext.close[br]set myfile = nothing[br]sstr=".getfolder|.createfolder|.deletefolder|.createdirectory|.deletedirectory|.saveas[br]|wscript.shell|script.encode|server.|.createobject|execute|activexobject|language="[br]snostring = split(sstr,"|") [br]for i=0 to ubound(snostring)[br] if instr(stextall,snostring(i)) then[br] set filedel = server.createobject("scripting.filesystemobject")[br] filedel.deletefile filepath[br] set filedel = nothing[br] response.write("")[br] response.end()[br] end if[br]next
該文章在 2010/7/3 15:05:31 編輯過(guò) |
關(guān)鍵字查詢
相關(guān)文章
正在查詢... |