xthiixe 2008-1-25 20:35
可以防范所有的SQL注入代码
可以防范所有的SQL注入代码
Function SafeRequest(ParaName)
Dim ParaValue
ParaValue=Request(ParaName)
if IsNumeric(ParaValue) = True then
SafeRequest=ParaValue
exit Function
elseIf Instr(LCase(ParaValue),"select ") > 0 or Instr(LCase(ParaValue),"insert ") > 0 or Instr(LCase(ParaValue),"delete from") > 0 or Instr(LCase(ParaValue),"count(") > 0 or Instr(LCase(ParaValue),"drop table") > 0 or Instr(LCase(ParaValue),"update ") > 0 or Instr(LCase(ParaValue),"truncate ") > 0 or Instr(LCase(ParaValue),"asc(") > 0 or Instr(LCase(ParaValue),"mid(") > 0 or Instr(LCase(ParaValue),"char(") > 0 or Instr(LCase(ParaValue),"xp_cmdshell") > 0 or Instr(LCase(ParaValue),"exec master") > 0 or Instr(LCase(ParaValue),"net localgroup administrators") > 0 or Instr(LCase(ParaValue)," and ") > 0 or Instr(LCase(ParaValue),"net user") > 0 or Instr(LCase(ParaValue)," or ") > 0 then
Response.Write "<script language='javascript'>"
[url=http://www.xiugoo.com/bbs][color=white]情缘XIUGOO站长之家 网赚联盟 源码技术 [/color][/url]
Response.Write "alert('非法的请求!');" '发现SQL注入攻击提示信息
Response.Write "location.href='http://www.xxxx.com/';" '发现SQL注入攻击转跳网址
Response.Write "<script>"
Response.end
else
SafeRequest=ParaValue
End If
End function
使用SafeRequest函数替换你的Request
[url=http://wpa.qq.com/msgrd?V=1&Uin=215453008&Site=源码在线论坛&Menu=yes][img]http://www.codeol.com/forum/images/Codeol/qq.gif[/img][/url]
UID1 帖子1187 精华[url=http://www.codeol.com/forum/digest.php?authorid=1]2[/url] 积分434 威望434 金币18707 阅读权限200 来自中国北京 注册时间2006-10-1 [url=http://www.codeol.com/]查看个人网站[/url]
[url=http://www.codeol.com/forum/space.php?action=viewpro&uid=1]查看详细资料[/url]TOP [url=http://www.codeol.com/forum/forum-10-1.html]WEB 2.0 大型精品整站程序高价出售[/url]
[url=http://www.codeol.com/forum/space-uid-13.html]gxren[/url] [img]http://www.codeol.com/forum/images/avatars/noavatar.gif[/img]
正式会员
[img]http://www.codeol.com/forum/images/Codeol/star_level1.gif[/img]
wometmw 2008-1-25 20:35
呵,试试看先啊,好用吗
UID13 帖子30 精华[url=http://www.codeol.com/forum/digest.php?authorid=13]0[/url] 积分0 威望0 金币11 阅读权限10 注册时间2006-10-1 [url=http://www.codeol.com/forum/space.php?action=viewpro&uid=13]查看详细资料[/url]TOP [url=http://www.codeol.com/forum/forum-10-1.html]WEB 2.0 大型精品整站程序高价出售[/url]
[url=http://www.codeol.com/forum/space-uid-4.html]misssky[/url] [img]http://www.codeol.com/forum/images/avatars/noavatar.gif[/img]
正式会员
[img]http://www.codeol.com/forum/images/Codeol/star_level1.gif[/img]
东莞均少 2008-1-25 20:35
不过测试的时候有些页面家了就会出现问题,大家最好先测试一下
qidu2000 2008-10-11 07:10
楼主强呀,这样贴子也能发表出来,对你佩服之心比长江的水还多哦
babyq 2008-10-11 21:10
楼主的帖子实在是写得太好了。可是我立刻想到,这么好的帖子,倘若别人看不到,那么不是浪费楼主的心血吗?经过痛苦的思想斗争,我终于下定决心,牺牲小我,奉献大我。我要拿出这帖子奉献给世人赏阅,我要把这个帖子一直往上顶,往上顶!顶到所有人都看到为止! 在遇到你之前,我对人世间是否有真正的圣人是怀疑的;而现在,我终于相信了!我曾经忘情于两汉的歌赋,我曾经惊讶于李杜的诗才,我曾经流连于宋元的词曲。但现在,我才知道我有多么浅薄!
guanchutao 2008-10-21 01:10
看完了这么强的文章,我想说点什么,但是又不知道说什么好,想来想去只想