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

Adapt to goby templates #374

Open
randolphcyg opened this issue Jul 25, 2023 · 4 comments
Open

Adapt to goby templates #374

randolphcyg opened this issue Jul 25, 2023 · 4 comments

Comments

@randolphcyg
Copy link

Is anybody working with add goby parser into pocsuite3?

I am working on it now.

After reading papers by knownsec and debug pocsuite3 program, this work has become smoother.

@13ph03nix
Copy link
Contributor

I think no one else is working on this at the moment. If you're interested, your contributions would be very welcome!

@randolphcyg
Copy link
Author

I think no one else is working on this at the moment. If you're interested, your contributions would be very welcome!

If the poc_code generated by the Nuclei YAML template is saved as Python code, is it appropriate to use Pocsuite3 -R to apply this Python code?

When I adapt the Goby JSON format template, I plan to convert json template to python template first, and then go to verify it separately, I don't know if this is appropriate?

So far, when I read the goby JSON template directly, I have successfully verified several vulnerabilities.

After fixing the obvious errors and optimizing the code, I try not to submit a merge request. The currently modified code is here: pocsuite3

@13ph03nix
Copy link
Contributor

感谢贡献。

If the poc_code generated by the Nuclei YAML template is saved as Python code, is it appropriate to use Pocsuite3 -R to apply this Python code?

poc_code 直接存为 .py 然后用 -r 加载是可以的。

When I adapt the Goby JSON format template, I plan to convert json template to python template first, and then go to verify it separately, I don't know if this is appropriate?

我想这没有区别,可以使用 -r 加载 nuclei 模版,也可以将转换后的存为 Python 文件然后使用 -r 加载。如果检测到是 yaml,会自动转换为 Python 插件,这部分代码位于:

if filename.endswith('.yaml') and re.search(r'matchers:\s+-', poc_code):
from pocsuite3.lib.yaml.nuclei import Nuclei
poc_code = str(Nuclei(poc_code))
self.check_requires(poc_code)

粗略看了下代码,还有很多细节需要完善,建议对照 https://gobysec.net/exp#GoEXP%E6%BC%8F%E6%B4%9E%E6%89%8B%E5%86%8C 完善。 几点建议:

  1. 很多无用的代码可删除,而且 nuclei 和 goby 有很多差异,一个好的 goby parser 需要对 goby 本身有好的理解;
  2. 细节完善,比如 ResponseTest 中的 variable 部分: $status_code -> $code,$header -> $head;
  3. SetVariable 未实现;
  4. ...

Anyway,尽可能理解自己写的每一行代码~

最后,我目前是独立安全研究员,会在空闲时间关注这个项目。

@randolphcyg
Copy link
Author

感谢宝贵的建议!

  1. 目前还没根据规范做过review,对适配模块的功能不够熟悉,因此很多无用代码还没删;
  2. 由于验证工作还没怎么完善,所以请求结果的处理逻辑还没有通用地处理;
  3. 当前仅仅根据goby官方文档映射了数据结构,还没完全符合要求,会继续修正和测试;
  4. 主要想先确认nuclei适配模块的设计逻辑,当前json.py后通过命令使用时没有通过,我会先解决这个问题;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants