搜索

JoeKoeV6.5Post_Poll.asp漏洞。

[复制链接]
查看: 3419|回复: 4
发表于 2006-12-30 01:59:33 | 显示全部楼层 来自

JoeKoeV6.5Post_Poll.asp漏洞。

晚上检查了一下JoeKoe V6.5系统是否存在SQL注入漏洞,发现一处SQL注入威胁:

  1. <!-- #include file="include/config_forum.asp" -->
  2. <!-- #include file="include/config_poll.asp" -->
  3. <% if not(isnumeric(forumid)) then call cookies_type("forum_id") %>
  4. <!-- #include file="include/config_frm.asp" -->
  5. <!-- #include file="include/conn.asp" -->
  6. <%
  7. call forum_first()
  8. dim reid,founderr
  9. call web_head(2,0,2,0,0)

  10. strRqPollType        = Request.Form("Vote_Type")
  11. strRqPollID        = Request.Form("VoTE_ID")
  12. strRqTopicID        = Request.Form("ToPIC_ID")
  13. &#39;strRqCatID        = Request.Form("CAT_ID")
  14. strRqForumID        = Request.Form("FoRUM_ID")
  15. strRqMyChoice        = Request.Form("myChoice")
  16. reid=strRqTopicID
  17. forumid=strRqForumID

  18. &#39;if int(popedom_format(login_popedom,41)) then call close_conn():call cookies_type("locked")
  19. &#39;-----------------------------------center---------------------------------
  20. response.write reply_chk()
  21. &#39;---------------------------------center end-------------------------------
  22. call web_end(0)

  23. function reply_chk()
  24. founderr = ""
  25. if GetPollUsers(strPollUser) = "yes" then
  26.         founderr =  "<LI>请不要重复投票!<br>"
  27. end if

  28. if strRqMyChoice = "" then
  29.         founderr =founderr&"<LI>你未选投票,请重投!<br>"
  30. end if


  31. strSql = "SELECT V_ID, ToPIC_ID, V_NUM, V_USER, V_DETAIL, V_TYPE, V_HIDE FRoM BBS_VoTE "
  32. strSql = strSql & " WHERE V_ID = "& strRqPollID
  33. set vrs = Conn.Execute (strSql)
  34. if vrs.eof and vrs.bof then
  35.    founderr=founderr&"<li>请您选择投票的主题进行投票。<br>"
  36. end if
  37. if founderr="" then
  38.    strTopicID        = vrs("ToPIC_ID")
  39.    strPollNum        = vrs("V_NUM")
  40.    strPollUser        = vrs("V_USER")
  41.    strPollDetail= vrs("V_DETAIL")
  42.    strPollType        = vrs("V_TYPE")
  43.    strPollHide        = vrs("V_HIDE")
  44.    strRqMyChoice= Replace(Request.Form("myChoice"), ", ", ",")
  45.    strPollChoiceArr        = Split(strRqMyChoice, ",")
  46.    For J = 0 To UBound(strPollChoiceArr)
  47.           strPollNumArr = Split(strPollNum, ",")
  48.           strPollNumArr(strPollChoiceArr(j)) = cInt(strPollNumArr(strPollChoiceArr(J))) + 1
  49.           
  50.           &#39;-----------------V_NUM
  51.        
  52.           strPollNum_New= ""
  53.           For P = 0 To UBound(strPollNumArr)
  54.              strPollNum_New = strPollNum_New & strPollNumArr(P) & ","
  55.           Next
  56.           strPollNum = Left(strPollNum_New, Len(strPollNum_New)-1)
  57.           Set strPollNumArr = Nothing       
  58.           
  59.           &#39;-----------------V_DETAIL
  60.           strPollDetailArr= Split(strPollDetail, ",")
  61.           strPollDetailNew= Replace(Replace(strPollDetailArr(strPollChoiceArr(j)), "{", ""), "}", "")
  62.           If strPollDetailNew = "" Then
  63.                   strPollDetailNew        = "{" & login_username & "}"
  64.           Else
  65.                   strPollDetailNew        = strPollDetailNew & "|" & login_username
  66.                   strPollDetailNew        = "{" & strPollDetailNew & "}"
  67.           End If
  68.           strPollDetailArr(strPollChoiceArr(j))        = strPollDetailNew
  69.                   &#39;----------------V-DETAIL
  70.           strPollDetail = ""
  71.           For Q = 0 To UBound(strPollDetailArr)
  72.              strPollDetail = strPollDetail & strPollDetailArr(Q) & ","
  73.           Next
  74.           strPollDetail = Left(strPollDetail, Len(strPollDetail)-1)

  75.         Next


  76.         &#39;---------V_USER
  77.         if ""&strPollUser&"" = "" then
  78.                 strPollUser = login_username
  79.         else
  80.                 strPollUser = strPollUser & "," & login_username
  81.         End if
  82.        
  83.         strSql = "UPDATE bbs_vote SET "
  84.         strSql = strSql & "V_NUM = &#39;" & strPollNum & "&#39;"
  85.         strSql = strSql & ", V_USER = &#39;" & strPollUser & "&#39;"
  86.         strSql = strSql & ", V_DETAIL = &#39;" & strPollDetail & "&#39;"
  87.         strSql = strSql & " WHERE V_ID = " & strRqPollID
  88.         Conn.Execute (strSql)

  89.     response.write forum_top("进行投票") & kong       
  90.         response.write VbCrLf & "<table border=0><tr><td align=center height=200>" & _
  91.            VbCrLf & "<table border=0 width=300>" & _
  92.            VbCrLf & "<tr><td align=center height=30><font class=red>成功进行了投票!谢谢您的投票。</font></td></tr>" & _
  93.            VbCrLf & "<tr><td height=30>您现在可以选择以下操作:</td></tr>" & _
  94.            VbCrLf & "<tr><td>  1、<a href=&#39;forum_view.asp?forum_id=" & forumid & "&view_id=" & reid & "&#39;>您所投票的帖子</a>" & _
  95.            VbCrLf & "<tr><td>  2、<a href=&#39;forum_list.asp?forum_id=" & forumid & "&#39;>返回 <b>" & forumname & "</b></a></td></tr>" & _
  96.            VbCrLf & "<tr><td>  3、<a href=&#39;forum.asp&#39;>返回论坛首页</a></td></tr>" & _
  97.            VbCrLf & "<tr><td height=30>系统将在 " & web_var(web_num,5) & " 秒钟后自动返回 <b>您所投票的帖子</b> 。</td></tr>" & _
  98.                    VbCrLf & "</table>" & _
  99.            VbCrLf & "</td></tr></table>" & _
  100.            VbCrLf & "<meta http-equiv=&#39;refresh&#39; content=&#39;" & web_var(web_num,5) & "; url=forum_view.asp?forum_id=" & forumid & "&view_id=" & reid & "&#39;>"
  101.   else
  102.     response.write found_error(founderr,"350")
  103.   end if
  104. end function
  105. %>
复制代码


原版本没有对 Request.Form 的数据进行检验,容易发生SQL注入的攻击。
但由于是 Request.Form 数据,威胁发生的可能性较小(需要借助工具)。。

请Steven检查一下这个文件有没有修正过。

发表于 2006-12-30 10:23:41 | 显示全部楼层 来自
谢谢楼主!

让大S查查看!
发表于 2006-12-30 10:59:46 | 显示全部楼层 来自
本版本不带论坛投票功能。谢谢。[emb6]
 楼主| 发表于 2006-12-30 19:57:30 | 显示全部楼层 来自

回复:JoeKoeV6.5Post_Poll.asp漏洞。

以下是引用管理员在2006-12-30 10:59:46的发言:[br]本版本不带论坛投票功能。谢谢。[emb6]

有先见之明啊,呵呵。
不过这套系统也够老的了,趁现在帖子还不多,有机会还是换套系统吧 :-)
首推Discuz!
发表于 2007-1-4 09:33:01 | 显示全部楼层 来自
曾试过转换论坛程序,难度较大,也失败过几次。
且现在服务器空间不足,暂不考虑了。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

精华帖子
热门图文
快速回复 返回顶部 返回列表