一段asp防注入的通用腳本
更新時(shí)間:2008年06月04日 08:34:16 作者:
asp防注入效果代碼
放在conn.asp里就行了。
'屏蔽通過(guò)地址欄攻擊
url=Request.ServerVariables("QUERY_STRING")
if instr(url,";")>=1 then
url=Replace(url,";",";") : Response.Redirect("?" & url)
end if
'屏蔽通過(guò)表單攻擊
for each item in request.form
stritem=lcase(server.HTMLEncode(Request.form(item)))
if instr(stritem,"select ")>=1 or instr(stritem,"insert ")>=1 or instr(stritem,"update ")>=1 or instr(stritem,"delete ")>=1 or instr(stritem,"exec ")>=1 or instr(stritem,"declare ")>=1 then
response.write ("對(duì)不起,請(qǐng)不要輸入非法字符!")
response.end
end if
next
'屏蔽通過(guò)地址欄攻擊
url=Request.ServerVariables("QUERY_STRING")
if instr(url,";")>=1 then
url=Replace(url,";",";") : Response.Redirect("?" & url)
end if
'屏蔽通過(guò)表單攻擊
for each item in request.form
stritem=lcase(server.HTMLEncode(Request.form(item)))
if instr(stritem,"select ")>=1 or instr(stritem,"insert ")>=1 or instr(stritem,"update ")>=1 or instr(stritem,"delete ")>=1 or instr(stritem,"exec ")>=1 or instr(stritem,"declare ")>=1 then
response.write ("對(duì)不起,請(qǐng)不要輸入非法字符!")
response.end
end if
next
相關(guān)文章
eWebEditor:網(wǎng)站中的隱形問(wèn)題
這篇文章主要介紹了eWebEditor:網(wǎng)站中的隱形問(wèn)題,需要的朋友可以參考下2006-07-07網(wǎng)頁(yè)木馬代碼例子(里面的文件是漏洞掃描器,呵呵)
網(wǎng)頁(yè)木馬代碼例子(里面的文件是漏洞掃描器,呵呵)...2006-12-12