From 2deb07dda4258197f345e3aabe78ae0f7cd3a64b Mon Sep 17 00:00:00 2001 From: Marven11 <110723864+Marven11@users.noreply.github.com> Date: Sun, 25 Aug 2024 18:43:44 +0800 Subject: [PATCH] Fix random failure for WafFuncGen --- fenjing/waf_func_gen.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fenjing/waf_func_gen.py b/fenjing/waf_func_gen.py index 5090d0e..50bcdf8 100644 --- a/fenjing/waf_func_gen.py +++ b/fenjing/waf_func_gen.py @@ -363,6 +363,8 @@ def generate(self) -> WafFunc: "".join(random.choices(string.ascii_lowercase, k=4)), False, ) + while any(w in extra_content for w in replaced_keyword): + extra_content = "".join(random.choices(string.ascii_lowercase, k=4)) # WAF函数,只有在payload一定可以通过WAF时才返回True @lru_cache(10000)