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

PoC编写pocsuite3是否存在当全部扫描结束后回调的方法 #18

Closed
ViCrack opened this issue Mar 31, 2019 · 7 comments
Closed
Labels
enhancement New feature or request

Comments

@ViCrack
Copy link

ViCrack commented Mar 31, 2019

比如在初始化的时候打开文件/数据库进行记录

然后在扫描过程按下CTRL+C或者所有扫描结束时能够在回调方法中关闭数据库连接

也能即时将已经处理过的信息输出显示,做好一些关闭资源收尾工作

@hysia hysia added the enhancement New feature or request label Apr 1, 2019
boy-hack added a commit that referenced this issue Apr 2, 2019
boy-hack added a commit that referenced this issue Apr 2, 2019
@boy-hack
Copy link
Contributor

boy-hack commented Apr 2, 2019

尝试最新版本,在按下CTRL+C之后会显示已经扫描完成的信息

@boy-hack boy-hack closed this as completed Apr 2, 2019
@ViCrack
Copy link
Author

ViCrack commented Apr 2, 2019

有没有想在pocbase中增加回调结束的接口,在task_done时候通知注册过结束回调的poc

@boy-hack
Copy link
Contributor

boy-hack commented Apr 2, 2019

有的,你可以参考https://github.com/knownsec/pocsuite3/blob/master/pocsuite3/plugins/html_report.py 这个插件的实现。
具体文档https://github.com/knownsec/pocsuite3/blob/master/docs/CODING.md#plugin_results

@ViCrack
Copy link
Author

ViCrack commented Apr 2, 2019

#18 (comment)

这个是最终汇总处理的,跟我想的似乎不一样。在poc模块中可以自己及时决定写入一些中间值到数据库或者文件中进行记录,如果此时能有个结束关闭的回调就可能更好了。

@boy-hack boy-hack reopened this Apr 2, 2019
boy-hack added a commit that referenced this issue Apr 3, 2019
@boy-hack
Copy link
Contributor

boy-hack commented Apr 3, 2019

尝试 https://github.com/knownsec/pocsuite3/tree/new-feature-%2318 看看有什么问题吗,Demo -r redis_unauthorized_access --dork service:redis -v 2 --plugins=file_record

@ViCrack
Copy link
Author

ViCrack commented Apr 3, 2019

尝试 https://github.com/knownsec/pocsuite3/tree/new-feature-%2318 看看有什么问题吗,Demo -r redis_unauthorized_access --dork service:redis -v 2 --plugins=file_record

差不多是这功能了.

其实我之前想的本是 在POC文件中 执行类似register_poc的方法存入kb.registered_pocs来注册一个结束回调方法"end" ,同时像plugins.file_record.FileRecord.init一样的openfile,

然后handle就写在自己_verify方法中,这样节省了每一次的output传值封装

扫描结束的时候遍历pocmodule在end方法中像plugins.file_record.FileRecord.start一样再去关闭

@boy-hack
Copy link
Contributor

boy-hack commented Apr 4, 2019

封装到POC里我觉得不太”优雅“,作为插件可以通用于任何POC,你可以在自己的版本里做这些事情

@ViCrack ViCrack closed this as completed Apr 4, 2019
boy-hack added a commit that referenced this issue Apr 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants