WAF Bypass Tool 是一个开源工具,用于使用预定义和可自定义的载荷分析任何 WAF 的误报和漏报安全性。在攻击者之前检查您的 WAF。WAF Bypass Tool 由 Nemesida WAF 团队在社区参与下开发。

禁止用于非法和不道德的目的。不要违法。我们对使用本软件可能产生的风险不承担任何责任。
最新版本的 waf-bypass 始终可通过 Docker Hub 获取。可通过以下命令轻松拉取:
# docker pull nemesida/waf-bypass # docker run nemesida/waf-bypass --host='example.com'
# pipx install git+https://github.com/nemesida-waf/waf-bypass.git # <pipx bin dir>/waf-bypass
# git clone https://github.com/nemesida-waf/waf_bypass.git /opt/waf-bypass/ # python3 -m pip install -r /opt/waf-bypass/requirements.txt # python3 /opt/waf-bypass/main.py --host='example.com'
'--proxy' (--proxy='http://proxy.example.com:3128') - 该选项允许指定连接到何处而非目标主机。
'--header' (--header 'Authorization: Basic YWRtaW46YWRtaW4=' --header 'X-TOKEN: ABCDEF') - 该选项允许指定随所有请求发送的 HTTP 头(例如用于身份验证)。允许多次使用。
'--user-agent' (--user-agent 'MyUserAgent 1/1') - 该选项允许指定随所有请求发送的 HTTP User-Agent,除非 User-Agent 已由载荷设置("USER-AGENT")。
'--block-code' (--block-code='403' --block-code='222') - 该选项允许指定当 WAF 拦截时应期望的 HTTP 状态码(默认值为 403)。允许多次使用。
'--threads' (--threads=15) - 该选项允许指定并行扫描线程数(默认值为 10)。
'--timeout' (--timeout=10) - 该选项允许指定请求处理超时时间(秒)(默认值为 30)。
'--exclude-dir' - 排除载荷目录(--exclude-dir='SQLi,XSS'))。
'--json-format' - 该选项允许以 JSON 格式显示工作结果(便于将工具与安全平台集成)。若未指定该选项,则输出为表格格式(默认格式)。
'--details' - 显示误报和漏报载荷。与 --json-format 选项不兼容。
'--no-progress' - 不显示进度条。
'--curl-replay' - 显示用于重现误报、漏报或失败请求的 cURL 命令。与 --json-format 选项不兼容。
JSON 输出规范示例:
{
"TARGET": "https://example.com", // defined by --host option
"PROXY": {}, // defined by --proxy option
"HEADERS": { // defined by --header option
"User-Agent": ""
},
"BLOCK-CODE": [ // defined by --block-code option
...
],
"THREADS": 50, // defined by --threads option
"TIMEOUT": 30, // defined by --timeout option
"EXCLUDE-DIR": [ // defined by --exclude-dir option
...
],
"FAILED": { // requests with failed processing status
"MFD/7.json": {
"BODY": "WBHTTPSConnectionPool(host='example.com', port=443): Read timed out. (read timeout=1)"
},
...
},
"PASSED": { // passed requests
"UWA/3.json": {
"URL": "403 RESPONSE CODE"
},
...
},
"FALSED": { // requests with false positive processing status
...
},
"BYPASSED": { // requests with false negative processing status
"UWA/26.json": {
"URL": "200 RESPONSE CODE"
},
...
},
"TestRequest": { // test requests with processing status, exclude passed
"FAILED": {},
"FALSED": {
"UWA/3.json": {
"URL": "403 RESPONSE CODE"
},
...
}
},
"CURL": { // cURL command to reproduce false positive and false negative requests
"FALSED": {},
"BYPASSED": {
"UWA/26.json": {
"URL": "curl -X GET -H 'Accept: */*' -H 'Accept-Encoding: gzip, deflate' -H 'Connection: keep-alive' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36' 'https://example.com/do.php#.png'"
},
...
}
}
}
根据用途,载荷位于相应文件夹中:
编写载荷时,使用以下区域、方法和选项:
Base64、HTML-ENTITY、UTF-16),除载荷自身编码外。多个值用空格分隔(例如 Base64 UTF-16)。仅适用于 ARGS、BODY、COOKIE 和 HEADER 区域。不适用于 API 和 MFD 目录中的载荷。与 JSON 选项不兼容。除下面描述的某些情况外,各区域相互独立并分别测试(即如果指定了 2 个区域,脚本将发送 2 个请求,交替检查第一个和第二个区域)。
对于区域,可以使用 %RND% 后缀,它允许生成一个由 6 个字母和数字组成的任意字符串。(例如:param%RND=my_payload 或 param=%RND% 或 A%RND%B)
您可以创建自己的载荷,为此请在 '/payload/' 文件夹中创建您自己的文件夹,或将载荷放置到现有文件夹中(例如:'/payload/XSS')。允许的数据格式为 JSON。
此目录中的 API 测试载荷会自动附加 'Content-Type: application/json' 头。
对于此目录中的 MFD(multipart/form-data)载荷,必须指定 BODY(必需)和 BOUNDARY(可选)。如果未设置 BOUNDARY,则会自动生成(在这种情况下,只需为 BODY 指定载荷,无需附加其他数据('... Content-Disposition: form-data; ...')。
如果指定了 BOUNDARY,则 BODY 的内容必须按照 RFC 格式化,但这允许在 BODY 中使用多个由 BOUNDARY 分隔的载荷。
此目录中允许使用其他区域(例如:URL、ARGS 等)。无论区域如何,头 'Content-Type: multipart/form-data; boundary=...' 都会添加到所有请求中。