PureWaf 1.2.0__tar.gz → 2.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {purewaf-1.2.0 → purewaf-2.2.0}/PKG-INFO +35 -70
- purewaf-2.2.0/PureWaf/PureWaf.py +1401 -0
- purewaf-2.2.0/PureWaf/agent.py +2507 -0
- purewaf-2.2.0/PureWaf/auto.py +2448 -0
- purewaf-2.2.0/PureWaf/bypass.py +1698 -0
- {purewaf-1.2.0 → purewaf-2.2.0}/PureWaf/bypass_data.py +455 -275
- purewaf-2.2.0/PureWaf/php_oracle.py +1111 -0
- purewaf-2.2.0/PureWaf/planner.py +192 -0
- purewaf-2.2.0/PureWaf/recognition.py +380 -0
- purewaf-2.2.0/PureWaf/sast/__init__.py +4 -0
- purewaf-2.2.0/PureWaf/sast/cfg.py +338 -0
- purewaf-2.2.0/PureWaf/sast/filters.py +194 -0
- purewaf-2.2.0/PureWaf/sast/parser.py +196 -0
- purewaf-2.2.0/PureWaf/sast/sinks.py +271 -0
- purewaf-2.2.0/PureWaf/tamper.py +210 -0
- purewaf-2.2.0/PureWaf/utils.py +654 -0
- purewaf-2.2.0/PureWaf/webui.py +1720 -0
- {purewaf-1.2.0 → purewaf-2.2.0}/PureWaf.egg-info/PKG-INFO +35 -70
- purewaf-2.2.0/PureWaf.egg-info/SOURCES.txt +42 -0
- purewaf-2.2.0/PureWaf.egg-info/requires.txt +10 -0
- {purewaf-1.2.0 → purewaf-2.2.0}/README.md +30 -69
- {purewaf-1.2.0 → purewaf-2.2.0}/pyproject.toml +3 -2
- purewaf-2.2.0/tests/test_agent.py +756 -0
- purewaf-2.2.0/tests/test_auto.py +1000 -0
- purewaf-2.2.0/tests/test_filter_bypass_fixtures.py +135 -0
- {purewaf-1.2.0 → purewaf-2.2.0}/tests/test_link_payload_validation.py +46 -4
- purewaf-2.2.0/tests/test_php_oracle.py +149 -0
- purewaf-2.2.0/tests/test_php_oracle_more.py +121 -0
- purewaf-2.2.0/tests/test_php_versions.py +207 -0
- purewaf-2.2.0/tests/test_planner.py +148 -0
- purewaf-2.2.0/tests/test_recent_techniques.py +135 -0
- purewaf-2.2.0/tests/test_recognition.py +342 -0
- purewaf-2.2.0/tests/test_review_regressions.py +344 -0
- purewaf-2.2.0/tests/test_sandbox.py +159 -0
- purewaf-2.2.0/tests/test_stress.py +230 -0
- purewaf-2.2.0/tests/test_tamper_plugins.py +115 -0
- {purewaf-1.2.0 → purewaf-2.2.0}/tests/test_tricks.py +67 -0
- {purewaf-1.2.0 → purewaf-2.2.0}/tests/test_utils.py +5 -0
- purewaf-2.2.0/tests/test_webui.py +926 -0
- purewaf-1.2.0/PureWaf/PureWaf.py +0 -585
- purewaf-1.2.0/PureWaf/bypass.py +0 -612
- purewaf-1.2.0/PureWaf/utils.py +0 -380
- purewaf-1.2.0/PureWaf/webui.py +0 -784
- purewaf-1.2.0/PureWaf.egg-info/SOURCES.txt +0 -20
- purewaf-1.2.0/PureWaf.egg-info/requires.txt +0 -5
- purewaf-1.2.0/tests/test_examples.py +0 -148
- purewaf-1.2.0/tests/test_php_versions.py +0 -89
- purewaf-1.2.0/tests/test_webui.py +0 -352
- {purewaf-1.2.0 → purewaf-2.2.0}/LICENSE +0 -0
- {purewaf-1.2.0 → purewaf-2.2.0}/PureWaf/__init__.py +0 -0
- {purewaf-1.2.0 → purewaf-2.2.0}/PureWaf.egg-info/dependency_links.txt +0 -0
- {purewaf-1.2.0 → purewaf-2.2.0}/PureWaf.egg-info/top_level.txt +0 -0
- {purewaf-1.2.0 → purewaf-2.2.0}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: PureWaf
|
|
3
|
-
Version:
|
|
3
|
+
Version: 2.2.0
|
|
4
4
|
Summary: WAF Bypass Payload Generator
|
|
5
5
|
Author: Pure Stream
|
|
6
6
|
License: Apache License
|
|
@@ -210,8 +210,12 @@ Project-URL: Repository, https://github.com/PureStream108/PureWaf
|
|
|
210
210
|
Requires-Python: >=3.8
|
|
211
211
|
Description-Content-Type: text/markdown
|
|
212
212
|
License-File: LICENSE
|
|
213
|
+
Requires-Dist: python-dotenv<2,>=1.0
|
|
213
214
|
Provides-Extra: webui
|
|
214
215
|
Requires-Dist: flask<4,>=3.1; python_version >= "3.9" and extra == "webui"
|
|
216
|
+
Provides-Extra: sast
|
|
217
|
+
Requires-Dist: tree-sitter>=0.25; extra == "sast"
|
|
218
|
+
Requires-Dist: tree-sitter-php>=0.24; extra == "sast"
|
|
215
219
|
Dynamic: license-file
|
|
216
220
|
|
|
217
221
|
# PureWaf
|
|
@@ -220,10 +224,24 @@ Dynamic: license-file
|
|
|
220
224
|
|
|
221
225
|

|
|
222
226
|
|
|
227
|
+

|
|
228
|
+
|
|
223
229
|
该项目仅用于教育和学习环节(比如说CTF),不得应用于其他任何恶意目的。
|
|
224
230
|
|
|
225
231
|
如果该项目出现任何错误或您有任何建议,欢迎在 `issues` 中提出。
|
|
226
232
|
|
|
233
|
+
一些参数的使用看这里:[Parameters](docs/parameters.md)
|
|
234
|
+
|
|
235
|
+
关于 Agent 看这里:[Use With LLM](docs/LLM.md)
|
|
236
|
+
|
|
237
|
+
使用 Agent 示例看这里:[Example](docs/Example.md)
|
|
238
|
+
|
|
239
|
+
关于版本更新看这里:[CHANGELOG](./docs/AboutChange.md)
|
|
240
|
+
|
|
241
|
+
## SKILL
|
|
242
|
+
|
|
243
|
+
关于SKILL,如果你本地已经有了此工具,可以下载此 SKILL.md 让 LLM 调用 PureWaf,不需要单独开启 PureWaf 的 Agent 功能
|
|
244
|
+
|
|
227
245
|
## Foreword
|
|
228
246
|
|
|
229
247
|
CTF中,你是否会因为被像这样:
|
|
@@ -274,68 +292,10 @@ system($cmd);
|
|
|
274
292
|
pip install PureWaf
|
|
275
293
|
|
|
276
294
|
from PureWaf import purewaf
|
|
277
|
-
```
|
|
278
|
-
|
|
279
|
-
如果你要启动前端界面,需要使用 Python 3.9 及以上,并额外安装 Flask:
|
|
280
295
|
|
|
281
|
-
|
|
282
|
-
pip install "flask>=3.1,<4"
|
|
296
|
+
#purewaf(webui=True)
|
|
283
297
|
```
|
|
284
298
|
|
|
285
|
-
## Parameters
|
|
286
|
-
|
|
287
|
-
**waf_words**
|
|
288
|
-
|
|
289
|
-
接收被过滤的字符串,格式为: `waf|star|system`,以 `|` 作为分割。
|
|
290
|
-
|
|
291
|
-
**waf_chars**
|
|
292
|
-
|
|
293
|
-
接收被过滤的字符,格式为:`#$%!`,不用分割。
|
|
294
|
-
|
|
295
|
-
**waf_regex**
|
|
296
|
-
|
|
297
|
-
接收正则表达式,格式为: `/flag|waf|system|\\|(|)/`,适用于字符串和字符混合的 waf,用 `/../` 包裹。
|
|
298
|
-
|
|
299
|
-
**limit_length**
|
|
300
|
-
|
|
301
|
-
默认为 999999 ,题目没有限制的情况下不用填写。
|
|
302
|
-
|
|
303
|
-
**flagfile**
|
|
304
|
-
|
|
305
|
-
题目Flag的文件命,默认为 `/flag`,正常情况下不用更改。
|
|
306
|
-
|
|
307
|
-
**read_env**
|
|
308
|
-
|
|
309
|
-
默认为 False(关闭),开启后就会输出读取环境变量的 payload,以应对 FLAG 放在环境变量的情况。
|
|
310
|
-
|
|
311
|
-
**reflect_shell & port & ip**
|
|
312
|
-
|
|
313
|
-
反弹shell功能开关,默认为 False(关闭),开启后输入 port 和 ip 两个参数就会自动输出反弹shell的 payload。
|
|
314
|
-
|
|
315
|
-
**phpinfo**
|
|
316
|
-
|
|
317
|
-
默认为 False(关闭),开启后会输出能读取 phpinfo 相关的 payload,建议配合 phpv 使用。
|
|
318
|
-
|
|
319
|
-
**log_level**
|
|
320
|
-
|
|
321
|
-
日志查看功能,默认为 "INFO",也可以设置为 “DEBUG” 和 “QUIET”,对应不同等级的提示。
|
|
322
|
-
|
|
323
|
-
**total_payload**
|
|
324
|
-
|
|
325
|
-
默认为 False(关闭),开启后会输出全部 pass 的 payload(默认只输出)。
|
|
326
|
-
|
|
327
|
-
**phpv**
|
|
328
|
-
|
|
329
|
-
php版本,默认为7.0,针对不同php版本的题目环境,你可以自行设置 phpv,以便 PureWaf 将已经不适用的 payload 给剔除。
|
|
330
|
-
|
|
331
|
-
**upload**
|
|
332
|
-
|
|
333
|
-
默认为 False(关闭),开启后会生成由 `<?php` 等包裹后的 payload,适用于部分上传文件场景,可结合 phpv 使用
|
|
334
|
-
|
|
335
|
-
**webui**
|
|
336
|
-
|
|
337
|
-
默认为 False(关闭),`webui` 暂仅支持 Python 3.9 及以上
|
|
338
|
-
|
|
339
299
|
## Examples
|
|
340
300
|
|
|
341
301
|
**第十届”楚慧杯“**
|
|
@@ -577,20 +537,13 @@ print(res.text)
|
|
|
577
537
|
N/A
|
|
578
538
|
```
|
|
579
539
|
|
|
580
|
-
## Limitations
|
|
581
|
-
|
|
582
|
-
- 暂时无法实现自定义命令
|
|
583
|
-
- 暂时没有内部检查payload是否可行机制
|
|
584
|
-
- 暂时没有白名单选项
|
|
585
|
-
- 暂时只适配 eval($a) 情形
|
|
586
|
-
|
|
587
|
-
(我们将在未来计划消除这些限制,并同步更新至README)
|
|
588
|
-
|
|
589
540
|
## Contributing
|
|
590
541
|
|
|
591
542
|
欢迎在 issues 中提供 PureWaf 无法解出的题目并附带对应的wp!
|
|
592
543
|
|
|
593
|
-
|
|
544
|
+
欢迎在 issues 中提供 PureWaf 运行中出现的错误!
|
|
545
|
+
|
|
546
|
+
作为回报,你们的 ID 将会出现在下一版本的 release 中!
|
|
594
547
|
|
|
595
548
|
## Thanks & References
|
|
596
549
|
|
|
@@ -602,6 +555,18 @@ N/A
|
|
|
602
555
|
|
|
603
556
|
[CTF中的RCE绕过-腾讯云开发者社区-腾讯云](https://cloud.tencent.com/developer/article/2393421)
|
|
604
557
|
|
|
558
|
+
[CTFshow-RCE极限大挑战 | 晴川's Blog🌈](https://blog.q1ngchuan.top/2023/10/01/CTFshow-RCE极限大挑战/index.html)
|
|
559
|
+
|
|
560
|
+
[CTF中WEB题——RCE - tomyyyyy - 博客园](https://www.cnblogs.com/tomyyyyy/p/13905357.html)
|
|
561
|
+
|
|
562
|
+
[exploit-bypass-php-escapeshellarg-escapeshellcmd](https://github.com/kacperszurek/exploits/blob/master/GitList/exploit-bypass-php-escapeshellarg-escapeshellcmd.md)
|
|
563
|
+
|
|
564
|
+
[PHP escapeshellcmd/escapeshellarg security advisory](https://gist.github.com/Zenexer/40d02da5e07f151adeaeeaa11af9ab36)
|
|
565
|
+
|
|
566
|
+
[Exploit PHP Remotely - WAF Rule & Filter Bypass](https://www.secjuice.com/php-rce-bypass-filters-sanitization-waf/)
|
|
567
|
+
|
|
568
|
+
[异或、取反、或绕过 - SCU-CTF](https://wiki.scuctf.com/ctfwiki/web/3.rce/异或取反或绕过/)
|
|
569
|
+
|
|
605
570
|
## Star History
|
|
606
571
|
|
|
607
572
|
[](https://www.star-history.com/#PureStream108/PureWaf&type=date&legend=top-left)
|