您现在的位置是:网站首页> 编程资料编程资料
一段asp防注入的通用脚本_木马相关_
2023-05-25
250人已围观
简介 一段asp防注入的通用脚本_木马相关_
放在conn.asp里就行了。
'屏蔽通过地址栏攻击
url=Request.ServerVariables("QUERY_STRING")
if instr(url,";")>=1 then
url=Replace(url,";",";") : Response.Redirect("?" & url)
end if
'屏蔽通过表单攻击
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 ("对不起,请不要输入非法字符!")
response.end
end if
next
'屏蔽通过地址栏攻击
url=Request.ServerVariables("QUERY_STRING")
if instr(url,";")>=1 then
url=Replace(url,";",";") : Response.Redirect("?" & url)
end if
'屏蔽通过表单攻击
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 ("对不起,请不要输入非法字符!")
response.end
end if
next
相关内容
- 隐藏ASP木马后门的两种方法_木马相关_
- 海阳2006+功能中的潜水王_木马相关_
- ASP javascript Application对象的Contents和StaticObjects做Cache的一些经验_应用技巧_
- 在JScript中使用缓存技术的实际代码_应用技巧_
- 在ASP里面创建GUID_应用技巧_
- 解决 JScript 中使用日期类型数据时出现类型错误的问题_应用技巧_
- 分享一个好东东,动态Include文件 (Dynamic File Includes)_应用技巧_
- ASP中使用FileSystemObject时提高性能的方法_应用技巧_
- ASP注册登陆实例代码_应用技巧_
- asp采集抓取网上房产信息的代码_小偷/采集_
