pokemon 1.0 taro Posted on Jan 30 2023 最近又花了小半个月的功夫,对 pokemon 进行了了一下升级改造。之前所构想的一个雏形,大致有了些眉目,在基本功能开发差不多的情况下,感觉可以作为一个里程碑,打一个tag:**pokemon 1.0** 本文着力于对其功能描述,具体开发过程的研发细节在其他文章中单独讨论。 ## 基础概念 ### Workspace 工作空间,一般一个目标为一个工作空间 ### Website 站点信息,用于 workflow 生成 task ### Url 这里的 Url 并非是扫描到的全量 Url, 而是经过 `Recorder` 插件过滤后的数据,如下我的 `Recorder` 配置了 `Swagger UI` 规则(此插件详细描述见下),那么就会命中此规则的 Url 请求和响应记录并返回。这在大规模的信息收集中能够帮助我们迅速定位到可能存在脆弱点的未知。(类似于 Burp 中的 BurpBounty 插件) ### Task 每次向 worker 发布任务的最小单位,例如: ```json {"plugins":{"Rad":{"target":"http://1.1.1.1/"},"Nuclei":{"target":"http://1.1.1.1/"}}} ``` 启动此 task 后,会向 worker 推送一个一个扫描任务,一个扫描任务重可能包含多个插件,如上任务,即包含`Rad(Xray)插件扫描 http://1.1.1.1/` 和 `Nuclei 插件扫描 http://1.1.1.1/` 两部分 一般来说,task 并不需要我们手动创建,会由 `workflow` 自动创建 ### Workflow 和 Workflow模板 `workflow` 即使按照用户所设计的流程,逐步生成 `task` 的配置,例如一个workflow模板如下: ```json [ { "input": { "OneForAll": { "api_py": "xxxxxxxx", "command_args": "--alive true --target {{.}}" }, "Fofa": { "type": "query", "query": "cert=\"{{.}}\"" } } }, { "website": { "Rad": { "target": "{{.Url}}" }, "Nuclei": { "target": "{{.Url}}" } } } ] ``` 此 workflow 模板即包含了两个部分 `input` `website` 基于此 workflow 模板创建的 workflow 还需要提供一个输入,作为 input 阶段的变量 如提供输入为 "baidu.com" 那么首先会创建一个`input`阶段任务 ```json {"plugins":{"OneForAll":{"api_py":"xxxxxx,"command_args":"--alive true --target baidu.com"},"Fofa":{"type":"query","query":"cert=\"baidu.com\""}}} ``` 如上文 task 部分描述,会在worker上顺序启动 `OneForALl` 和 `Fofa` 插件,worker 在工作完成后,会将扫描到的 `website`,`host`,`domain`信息上报给 server 在 server 发现此 workflow `input` 阶段的所有任务(对于`input`阶段事实上只可能同时只存在一个任务)都完成的时候,会启动下一阶段`website`的扫描 此时会将获取此工作空间所有website数据,对每个website数据 创建一个 `website` 阶段的 Task并启动 , 如上面扫描出一个站点 `{"Url":"http://1.1.2.3:443/"}`,其对应的任务即为 ```json { "plugins": { "website": { "Rad": { "target": "http://1.1.2.3:443/" }, "Nuclei": { "target": "http://1.1.2.3:443/" } } } } ``` 而后会启动一个对于此站点的 `Rad(Xray)` 和 `Nuclei` 扫描,并将 漏洞/Url 信息上报给 Server ## Quick Start > 在日常的红队、src工作中,我们的目标是对某个公司、某个域名进行渗透,外围的打点突破在我们没有 0 day的情况下显得十分棘手,我们只能不断的扩大信息收集的范围,增强自己的扫描器。pokemon 的出现就是为了能够解决这个问题。 让我们以一个真实的 case 来看看,pokemon的**一站式渗透能力** 我们获得的目标: **taropowder.cn** ### 手动渗透 整个站点如同你所看到的一样,功能点较少,所以我们需要进行信息收集。 此中我最常用的还是 `OneforAll` , 其封装了大量的信息收集接口,在合理的配置下,能够发挥不错的能力 但是其中的 Fofa 搜索语法不够令人满意,我还会在Fofa中额外搜索 在获取到其他站点后,我观察到可能某个旁站更容易下手,所以我会挂上我的被动扫描器和Burp,来看看这个站点中是否存在漏洞 ### pokemon #### 配置 **workflow模板** 首先确认我们所需要的插件 `OneForAll`,`Fofa`, `Rad`, `Nuclei` 随后,在 workflow 模板中 `增加Workflow模板` 我的WorkFlow模板大致如下 ```json [ { "input": { "OneForAll": { "api_py": "xxxxxxxxx", "command_args": "--alive true --target {{.}}" }, "Fofa": { "type": "query", "query": "cert=\"{{.}}\"" } } }, { "input-2": { "Fofa": { "type": "query", "query": "domain=\"{{.}}\"" } } }, { "website": { "Rad": { "target": "{{.Url}}" }, "Nuclei": { "target": "{{.Url}}" } } } ] ``` ![](/api/file/getImage?fileId=63d7d775f2f446000d000012) #### 添加`workflow` 而后添加 `workflow` , 并启动 ![](/api/file/getImage?fileId=63d7d775f2f446000d000013) 等待自动生成并启动 Task ![](/api/file/getImage?fileId=63d7d775f2f446000d000014) #### 等待漏洞 / 敏感信息确认 剩下的就是等待漏洞的上报 ![](/api/file/getImage?fileId=63d7d775f2f446000d000011) 或是在获取到的一些敏感URL中,找寻是否有攻击的可能, 如图所示,我写了一个从 js 中寻找Url 的规则,我从此规则中发现了未被爬虫发现的路由,对其进行测试,可能会有意想不到的收货 ![](/api/file/getImage?fileId=63d7d775f2f446000d000010) ## Q&A - 在配置好了 workflow 模板后,新增扫描还需要哪些操作? 只需增加一个 workflow ,增加一个输入并启动 Oauth2.0 授权码详解 pokemen