W78CMS v2.7.6 搜索型注入漏洞

作者:hack1990 时间:11-03-24 阅读数:511人阅读

 发布作者:路人甲

影响版本:W78CMS V2.8.6
官方网站:http://www.w78cms.com/

漏洞类型:SQL注射

漏洞描述:W78CMS企业网站管理系统 v2.7.6 UTF-8 存在搜索型注入问题

漏洞分析:

文件so.asp
22行起

  1. <%
  2.  
  3. t=request.QueryString("t")
  4.  
  5. key=request.QueryString("key")
  6.  
  7. if t="" then
  8.  
  9. Response.Write("<script>alert('请选择要搜索的栏目!');history.back();</script>")
  10.  
  11. Response.End()
  12.  
  13. end if
  14.  
  15. if key="" then
  16.  
  17. Response.Write("<script>alert('请输入关键词!');history.back();</script>")
  18.  
  19. Response.End()
  20.  
  21. end if
  22.  
  23. set rs=server.createobject("adodb.recordset")
  24.  
  25. if t=1 then
  26.  
  27. exec="select * from [news] where title like '%"&key&"%' order by id desc "
  28.  
  29. elseif t=2 then
  30.  
  31. exec="select * from [Products] where title like '%"&key&"%' order by id desc "
  32.  
  33. else
  34.  
  35. exec="select * from [download] where title like '%"&key&"%' order by id desc "
  36.  
  37. end if
  38.  
  39. if t=4 then
  40.  
  41. exec="select * from [anli] where title like '%"&key&"%' order by id desc "
  42.  
  43. end if
  44.  
  45. rs.open exec,conn,1,1
  46.  
  47. if rs.eof then
  48.  
  49. response.Write "&nbsp;没有搜索到相关内容!"
  50.  
  51. else
  52.  

明显针对key无过滤,直接代入数据库查询,导致注入问题。
漏洞证明:/so.asp?t=1&key=[sql]
修复方案:作者在很多文件中都包含了防注入文件sql.asp 以及w78_sql.asp文件 但很多地方却没有使用其中的防注入函数,另w78_sql.asp防注入文件缺少对cookis提交的过滤

评论列表

  •  
    发布于 2011-03-24 17:18:01  回复
  • 源码没看懂多少,但是我还是喜欢注入

发表评论