您的位置:积木首页 >> 黑客技术频道 >> 病毒漏洞 >> 正文:
标题:BBSXP再暴惊天漏洞
时间:2005-5-8 来源:不详 浏览数:
_content>文章作者:光芒果
信息来源:(应该是黑防吧)

说起来我与BBSXP还算蛮有缘的,因为我第一次建网站用的就是BBSXP3.0,此后又一直用到了4.1,只不过因为种种原因后来不用了(绝非安全因素,那时我对网络安全还是一窍不通,呵呵)。近日看到了许多文章都是讲BBSXP的漏洞的,从最早的“编辑贴子”处的Cookies欺骗到最新的搜索页面的注入攻击,BBSXP可谓是千疮百孔。于是我又想起了我的老朋友--BBSXP。在yuzi的授权下我于大年三十夜在访网站对最新的BBSXP做了一次安全检测。
现在官方用的是BBSXP5.15,而公布出来的程序最新的似乎是5.13,估计是5.15还在测试中的版本吧。但既然是yuzi授权的,问一个5.15的程序自然也非难事。拿到5.15的程序后,我 就翻看了几个已知漏洞的文件代码,好像都补上了,我只好从其他地方入手了。翻到blog.asp这个文时,我发现了如下代码:

<!-- #include file="setup.asp" --><%

username=HTMLEncode(Request("username"))
id=HTMLEncode(Request("id"))

top

if id<>"" then
sql="select * from [calendar] where id="&id&" order by id Desc"
else
sql="select * from [calendar] where (hide=0 or username='"&Request.Cookies("username")&"') and username='"&username&"' order by id Desc"
end if

rs.Open sql,Conn,1

if rs.eof then error("<li>该用户暂时没有任何日志")

%>
<table class="a2" cellSpacing="1" cellPadding="4" width="97%" align="center" border="0">
    <tr class="a3">
        <td colSpan="2">
        <table cellSpacing="0" cellPadding="0" width="100%" border="0" id="table2">
              <tr>
                  <td height="18"> <img src="images/Forum_nav.gif"> <%ClubTree%> → <a href="calendar.asp">社区日志</a> → <span id=title><a href="blog.asp">网络日志</a></span></td>
                  <td align="right" height="18">
                  <img src="images/jt.gif"> <a href=calendar.asp?menu=newcalendar>发表日志</a></td>
              </tr>
        </table>
        </td>
    </tr>
</table>

<br>
<table border="0" width="97%" align="center">
    <tr>
        <td align="center">
        <table class="a2" style="WIDTH:100%" height="100%" cellspacing="1" cellpadding="3" border="0" id="table5">
              <tr>
                  <td class="a1" align="middle" height="25"><b>网络日志</b></td>
              </tr>
              <tr align="middle">
                  <td bgcolor="#ffffff" align="left" height="100">
<%




pagesetup=10 '设定每页的显示数量
rs.pagesize=pagesetup
TotalPage=rs.pagecount '总页数
PageCount = cint(Request.QueryString("ToPage"))
if PageCount <1 then PageCount = 1
if PageCount > TotalPage then PageCount = TotalPage
if TotalPage>0 then rs.absolutepage=PageCount '跳转到指定页数
i=0
Do While Not RS.EOF and i<pagesetup
i=i+1
username=rs("username")
content=rs("content")

if id="" then
content=ReplaceText(content,"<[^>]*>","")
if len(content)>200 then content=left(""&content&"",200)&"..."
end if


%>
                  <table border="0" width="100%" cellspacing="10">
                      <tr>
                            <td>
                            <b><font size="4"><%=rs("title")%></font></b><br>
                            <br><%=content%>
<%if rs("hide")=1 then%><br><br>注:<font color="#FF0000">本篇日志为隐藏状态</font><%end if%>
<hr>
<%if id="" then%>
<a href="?id=<%=rs("id")%>">阅读全文</a>
<%else%>
<font color="#C0C0C0">阅读全文</font>
<%end if%>
|
<%if Request.Cookies("username")=username then%>
<a href="calendar.asp?menu=newcalendar&id=<%=rs("id")%>">编辑</a>
<%else%>
<font color="#C0C0C0">编辑</font>
<%end if%>
|
<%if username= Request.Cookies("username") or membercode > 3 then%>
<a href="calendar.asp?menu=del&id=<%=rs("id")%>" onclick="checkclick('您确定要删除此条日志?')">删除</a>
<%else%>
<font color="#C0C0C0">删除</font>
<%end if%>
| <%=rs("addtime")%> by <a href="Profile.asp?username=<%=username%>"><%=username%></a></td>
                      </tr>
                  </table>
<%
RS.MoveNext
loop

RS.Close
%>
                  </td>
              </tr>
        </table>
        <p><b>[<script>ShowPage(<%=TotalPage%>,<%=PageCount%>,"username=<%=username%>")</script>]</b></p>
        </td>
        <td width="200" align="right" valign="top">
        <table class="a2" style="WIDTH:95%" cellspacing="1" cellpadding="3" border="0">
              <tr class="a1">
                  <td align="middle" height="25"><b>档案文件</b></td>
              </tr>
              <tr align="middle">
                  <td bgcolor="#ffffff">
<%
sql="select * from [user] where username='"&username&"'"
Set Rs=Conn.Execute(sql)

select case rs("sex")
case "male"
sex="男"
case "female"
sex="女"
end select

if rs("birthday")<>"" then birthyear=year(now)-split(rs("birthday"),"-")(0)

userphoto=rs("userphoto")
UserInfo=split(rs("UserInfo"),"\")
realname=UserInfo(0)
country=UserInfo(1)
province=UserInfo(2)
city=UserInfo(3)
postcode=UserInfo(4)
blood=UserInfo(5)
belief=UserInfo(6)
occupation=UserInfo(7)
marital=UserInfo(8)
education=UserInfo(9)
college=UserInfo(10)
address=UserInfo(11)
phone=UserInfo(12)
character=UserInfo(13)
personal=UserInfo(14)
rs.close
%>
<script>
if("<%=userphoto%>"!=""){
document.write("<a target=_blank href=<%=userphoto%>><img src=<%=userphoto%> border=0 width=150></a>")
}
</script>
                  <table cellspacing="2" cellpadding="2" width="100%" border="0">
                      <tr>
                            <td valign="top">姓名:</td>
                            <td width="120" ><%=username%></td>
                      </tr>
                      <tr>
                            <td valign="top">年龄:</td>
                            <td width="120"><%=birthyear%>
                            </td>
                      </tr>
                      <tr>
                            <td valign="top">性别:</td>
                            <td width="120"><%=sex%></td>
                      </tr>
                      <tr>
                            <td valign="top">职业:</td>
                            <td width="120"><%=occupation%></td>
                      </tr>
                      <tr>
                            <td valign="top"><font class="bold">位置:</font></td>
                            <td width="120"><%=country%><br>
                            <%=province%><br>
   

[1] [2] 下一页


(责任编辑:笑虎)
最近更新
今日推荐
热点文章