Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] 报错:Exception: Invalid expression [a1], only a very simple subset of Python is allowed. #333

Closed
ghost opened this issue Nov 8, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@ghost
Copy link

ghost commented Nov 8, 2022

MacOS brew方式安装 最新版本v2.0

使用命令:
pocsuite --dork-quake '(app:"用友 NC") AND country: "China"' -r ~/weapon/myown-nuclei-poc/yongyou/yongyou-nc-beanshell-rce.yaml

使用的poc地址:https://github.com/soapffz/myown-nuclei-poc/blob/main/yongyou/yongyou-nc-beanshell-rce.yaml

报错内容如下:

Traceback (most recent call last):
File "/opt/homebrew/Cellar/pocsuite3/2.0.0/libexec/lib/python3.10/site-packages/pocsuite3/lib/yaml/nuclei/protocols/common/expressions/init.py", line 842, in evaluate
result = safe_eval(potential_match, variables)
File "/opt/homebrew/Cellar/pocsuite3/2.0.0/libexec/lib/python3.10/site-packages/pocsuite3/lib/yaml/nuclei/protocols/common/expressions/safe_eval.py", line 216, in safe_eval
raise Exception(f"Invalid expression [{expression}], only a very simple subset of Python is allowed.")
Exception: Invalid expression [a1], only a very simple subset of Python is allowed.
Traceback (most recent call last):
File "/opt/homebrew/Cellar/pocsuite3/2.0.0/libexec/lib/python3.10/site-packages/pocsuite3/lib/yaml/nuclei/protocols/common/expressions/init.py", line 842, in evaluate
result = safe_eval(potential_match, variables)
File "/opt/homebrew/Cellar/pocsuite3/2.0.0/libexec/lib/python3.10/site-packages/pocsuite3/lib/yaml/nuclei/protocols/common/expressions/safe_eval.py", line 216, in safe_eval
raise Exception(f"Invalid expression [{expression}], only a very simple subset of Python is allowed.")
Exception: Invalid expression [a1], only a very simple subset of Python is allowed.
Traceback (most recent call last):
File "/opt/homebrew/Cellar/pocsuite3/2.0.0/libexec/lib/python3.10/site-packages/pocsuite3/lib/yaml/nuclei/protocols/common/expressions/init.py", line 842, in evaluate
result = safe_eval(potential_match, variables)
File "/opt/homebrew/Cellar/pocsuite3/2.0.0/libexec/lib/python3.10/site-packages/pocsuite3/lib/yaml/nuclei/protocols/common/expressions/safe_eval.py", line 216, in safe_eval
raise Exception(f"Invalid expression [{expression}], only a very simple subset of Python is allowed.")
Exception: Invalid expression [a1], only a very simple subset of Python is allowed.
Traceback (most recent call last):
File "/opt/homebrew/Cellar/pocsuite3/2.0.0/libexec/lib/python3.10/site-packages/pocsuite3/lib/yaml/nuclei/protocols/common/expressions/init.py", line 842, in evaluate
result = safe_eval(potential_match, variables)
File "/opt/homebrew/Cellar/pocsuite3/2.0.0/libexec/lib/python3.10/site-packages/pocsuite3/lib/yaml/nuclei/protocols/common/expressions/safe_eval.py", line 216, in safe_eval
raise Exception(f"Invalid expression [{expression}], only a very simple subset of Python is allowed.")
Exception: Invalid expression [a1], only a very simple subset of Python is allowed.
Traceback (most recent call last):
File "/opt/homebrew/Cellar/pocsuite3/2.0.0/libexec/lib/python3.10/site-packages/pocsuite3/lib/yaml/nuclei/protocols/common/expressions/init.py", line 842, in evaluate
result = safe_eval(potential_match, variables)
File "/opt/homebrew/Cellar/pocsuite3/2.0.0/libexec/lib/python3.10/site-packages/pocsuite3/lib/yaml/nuclei/protocols/common/expressions/safe_eval.py", line 216, in safe_eval
raise Exception(f"Invalid expression [{expression}], only a very simple subset of Python is allowed.")
Exception: Invalid expression [a1], only a very simple subset of Python is allowed.
Traceback (most recent call last):
File "/opt/homebrew/Cellar/pocsuite3/2.0.0/libexec/lib/python3.10/site-packages/pocsuite3/lib/yaml/nuclei/protocols/common/expressions/init.py", line 842, in evaluate
result = safe_eval(potential_match, variables)
File "/opt/homebrew/Cellar/pocsuite3/2.0.0/libexec/lib/python3.10/site-packages/pocsuite3/lib/yaml/nuclei/protocols/common/expressions/safe_eval.py", line 216, in safe_eval
raise Exception(f"Invalid expression [{expression}], only a very simple subset of Python is allowed.")
Exception: Invalid expression [a1], only a very simple subset of Python is allowed.
Traceback (most recent call last):
File "/opt/homebrew/Cellar/pocsuite3/2.0.0/libexec/lib/python3.10/site-packages/pocsuite3/lib/yaml/nuclei/protocols/common/expressions/init.py", line 842, in evaluate
result = safe_eval(potential_match, variables)
File "/opt/homebrew/Cellar/pocsuite3/2.0.0/libexec/lib/python3.10/site-packages/pocsuite3/lib/yaml/nuclei/protocols/common/expressions/safe_eval.py", line 216, in safe_eval
raise Exception(f"Invalid expression [{expression}], only a very simple subset of Python is allowed.")
Exception: Invalid expression [a1], only a very simple subset of Python is allowed.
Traceback (most recent call last):
File "/opt/homebrew/Cellar/pocsuite3/2.0.0/libexec/lib/python3.10/site-packages/pocsuite3/lib/yaml/nuclei/protocols/common/expressions/init.py", line 842, in evaluate
result = safe_eval(potential_match, variables)
File "/opt/homebrew/Cellar/pocsuite3/2.0.0/libexec/lib/python3.10/site-packages/pocsuite3/lib/yaml/nuclei/protocols/common/expressions/safe_eval.py", line 216, in safe_eval
raise Exception(f"Invalid expression [{expression}], only a very simple subset of Python is allowed.")
Exception: Invalid expression [a1], only a very simple subset of Python is allowed.
Traceback (most recent call last):
File "/opt/homebrew/Cellar/pocsuite3/2.0.0/libexec/lib/python3.10/site-packages/pocsuite3/lib/yaml/nuclei/protocols/common/expressions/init.py", line 842, in evaluate
result = safe_eval(potential_match, variables)
File "/opt/homebrew/Cellar/pocsuite3/2.0.0/libexec/lib/python3.10/site-packages/pocsuite3/lib/yaml/nuclei/protocols/common/expressions/safe_eval.py", line 216, in safe_eval
raise Exception(f"Invalid expression [{expression}], only a very simple subset of Python is allowed.")
Exception: Invalid expression [a1], only a very simple subset of Python is allowed.
Traceback (most recent call last):
File "/opt/homebrew/Cellar/pocsuite3/2.0.0/libexec/lib/python3.10/site-packages/pocsuite3/lib/yaml/nuclei/protocols/common/expressions/init.py", line 842, in evaluate
result = safe_eval(potential_match, variables)
File "/opt/homebrew/Cellar/pocsuite3/2.0.0/libexec/lib/python3.10/site-packages/pocsuite3/lib/yaml/nuclei/protocols/common/expressions/safe_eval.py", line 216, in safe_eval
raise Exception(f"Invalid expression [{expression}], only a very simple subset of Python is allowed.")
Exception: Invalid expression [a1], only a very simple subset of Python is allowed.
[16:03:58] [INFO] Scan completed,ready to print

@ghost
Copy link
Author

ghost commented Nov 8, 2022

看起来似乎是因为不支持nuclei yaml中的表达式造成的

@13ph03nix
Copy link
Contributor

matcher_res = match_size(matcher, len(item))
logger.debug(f'[+] {matcher} -> {matcher_res}')
elif matcher.type == MatcherType.WordsMatcher:
matcher_res, _ = match_words(matcher, item, {})
logger.debug(f'[+] {matcher} -> {matcher_res}')
elif matcher.type == MatcherType.RegexMatcher:

L189 这里有个 bug,忘记传参了,可以临时 patch一下,将 {} 改为 resp_data。感谢指出 👍

@13ph03nix 13ph03nix added the bug Something isn't working label Nov 8, 2022
@13ph03nix
Copy link
Contributor

v2.0.1 版本已修复 :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant