程序体(5)
fqys=request.servervariables("query_string")
dim nothis(18) 【相关文章:Cissp 考试和学习指南】 【扩展阅读:Catalyst5500交换机 VLAN】 nothis(0)="net user" 【扩展信息:http://www.myfaq.com】 nothis(1)="xp_cmdshell" nothis(2)="/add" nothis(3)="exec%20master.dbo.xp_cmdshell" nothis(4)="net localgroup administrators" nothis(5)="select" nothis(6)="count" nothis(7)="asc" nothis(8)="char" nothis(9)="mid" nothis(10)="" nothis(11)=":" nothis(12)="""" nothis(13)="insert" nothis(14)="delete" nothis(15)="drop" nothis(16)="truncate" nothis(17)="from" nothis(18)="%" errc=false for i= 0 to ubound(nothis) if instr(fqys,nothis(i))<>0 then errc=true end if next if errc then response.write "" response.end end if我要做点声明的是:以上的程序只是对get方式提交的数据进行的过滤,千万不要盲目套用。
像其他一些来自 asp request 对象 (reques、request.querystring、request.form、request.cookies与 request.servervariables) 的用户输入的攻击方法的方法,大致都集中在脚本期望的输入变量是数字变量 (id) 上,当然我们不能只看数字变量,比如:
http://127.0.0.1/systembbs/showtopic.html?tid=99&name=abc and left(userpasswor d,1)=a
http://127.0.0.1/systembbs/addtopic.html?tid=99&name=abc and userpasswor d=’or’’=’
另外,如何单一的防止类似这样的注入错误?
http://127.0.0.1/systembbs/addtopic.html?tid=99’ ;delete forum_forum;--&page=33 防范程序: 程序体(6)
... 下一页