knownsec/pocsuite3

GitHub: knownsec/pocsuite3

这是一个基于 Python 开发的开源远程漏洞测试与 PoC 开发框架,旨在通过自动化手段简化漏洞验证与渗透测试流程。

Stars: 3831 | Forks: 780

# pocsuite3 [![Python 3.x](https://img.shields.io/badge/python-3.x-yellow.svg)](https://www.python.org/) [![License](https://img.shields.io/badge/license-GPLv2-red.svg)](https://raw.githubusercontent.com/knownsec/pocsuite3/master/COPYING) [![Twitter](https://img.shields.io/badge/twitter-@seebug-blue.svg)](https://twitter.com/seebug_team) ## 法律免责声明 未经事先双方同意,使用 pocsuite3 攻击目标是非法的。 pocsuite3 仅用于安全测试目的 ## 法律免责声明 未经事先双方同意,使用 pocsuite3 攻击目标是非法的。 pocsuite3 仅用于安全测试目的 ## 概览 pocsuite3 是由 [**Knownsec 404 Team**](http://www.knownsec.com/) 开发的开源远程漏洞测试和概念验证(PoC)开发框架。 它带有一个强大的概念验证引擎,为极致的渗透测试人员和安全研究人员提供了许多优秀的功能。 ## 功能特性 * PoC 脚本可以以不同方式运行在 `verify`、`attack`、`shell` 模式下 * 插件生态系统 * 从任何地方动态加载 PoC 脚本(本地文件、Redis、数据库、Seebug ...) * 从任何地方加载多目标(CIDR、本地文件、Redis、数据库、Zoomeye、Shodan ...) * 结果可以轻松导出 * 动态补丁和钩子(hook)请求 * 既可以作为命令行工具使用,也可以作为 Python 包导入使用 * 支持 IPv6 * 支持全局 HTTP/HTTPS/SOCKS 代理 * 为 PoC 脚本提供简单的爬虫 API * 支持 YAML PoC,兼容 [nuclei](https://github.com/projectdiscovery/nuclei) * 与 [Seebug](https://www.seebug.org) 集成(用于从 Seebug 网站加载 PoC) * 与 [ZoomEye](https://www.zoomeye.org)、[Shodan](https://www.shodan.io) 等集成(用于使用 `Dork` 加载目标) * 与 [Ceye](http://ceye.io/)、[Interactsh](https://github.com/projectdiscovery/interactsh) 集成(用于验证盲注 DNS 和 HTTP 请求) * 支持使用 IDE 友好地调试 PoC 脚本 * 更多... ## 截图 ### pocsuite3 控制台模式 [![asciicast](https://asciinema.org/a/219356.png)](https://asciinema.org/a/219356) ### pocsuite3 shell 模式 [![asciicast](https://asciinema.org/a/203101.png)](https://asciinema.org/a/203101) ### pocsuite3 从 Seebug 加载 PoC [![asciicast](https://asciinema.org/a/207350.png)](https://asciinema.org/a/207350) ### pocsuite3 从 ZoomEye 加载多目标 [![asciicast](https://asciinema.org/a/133344.png)](https://asciinema.org/a/133344) ### pocsuite3 从 Shodan 加载多目标 [![asciicast](https://asciinema.org/a/207349.png)](https://asciinema.org/a/207349) ### pocsuite3 加载 nuclei 模板 ![](https://static.pigsec.cn/wp-content/uploads/repos/2026/02/e3dfebd567233255.png) ### 构建 Docker 漏洞环境 **需要 Docker** 在 PoC 中编写 Dockerfile ``` class DemoPOC(POCBase): vulID = '' # ssvid version = '1.0' author = [''] vulDate = '2029-5-8' createDate = '2019-5-8' updateDate = '2019-5-8' references = [''] name = 'Struts2 045 RCE CVE-2017' appPowerLink = '' appName = 'struts2' appVersion = '' vulType = '' desc = '''S2-045:影响版本Struts 2.3.20-2.3.28(除了2.3.20.3和2.3.24.3)''' samples = [] category = POC_CATEGORY.EXPLOITS.WEBAPP dockerfile = '''FROM isxiangyang/struts2-all-vul-pocsuite:latest''' ``` #### 仅运行漏洞环境 ``` pocsuite -r pocs/Apache_Struts2/20170129_WEB_Apache_Struts2_045_RCE_CVE-2017-5638.py --docker-start --docker-port 127.0.0.1:8080:8080 --docker-env A=test --docker-port 8899:7890 ,------. ,--. ,--. ,----. {2.0.6-cc19ae5} | .--. ',---. ,---.,---.,--.,--`--,-' '-.,---.'.-. | | '--' | .-. | .--( .-'| || ,--'-. .-| .-. : .' < | | --'' '-' \ `--.-' `' '' | | | | \ --/'-' | `--' `---' `---`----' `----'`--' `--' `----`----' https://pocsuite.org [*] starting at 15:34:12 [15:34:12] [INFO] loading PoC script 'pocs/Apache_Struts2/20170129_WEB_Apache_Struts2_045_RCE_CVE-2017-5638.py' [15:34:12] [INFO] Image struts2_045_rce_cve-2017:pocsuite exists [15:34:12] [INFO] Run container fa5b3b7bb2ea successful! [15:34:12] [INFO] pocsusite got a total of 0 tasks [15:34:12] [INFO] Scan completed,ready to print ``` #### 运行漏洞环境并运行 PoC ``` pocsuite -r pocs/Apache_Struts2/20170129_WEB_Apache_Struts2_045_RCE_CVE-2017-5638.py -u http://127.0.0.1:8080/S2-032-showcase/fileupload/doUpload.action --docker-start --docker-port 127.0.0.1:8080:8080 ,------. ,--. ,--. ,----. {2.0.6-cc19ae5} | .--. ',---. ,---.,---.,--.,--`--,-' '-.,---.'.-. | | '--' | .-. | .--( .-'| || ,--'-. .-| .-. : .' < | | --'' '-' \ `--.-' `' '' | | | | \ --/'-' | `--' `---' `---`----' `----'`--' `--' `----`----' https://pocsuite.org [*] starting at 15:38:46 [15:38:46] [INFO] loading PoC script 'pocs/Apache_Struts2/20170129_WEB_Apache_Struts2_045_RCE_CVE-2017-5638.py' [15:38:46] [INFO] Image struts2_045_rce_cve-2017:pocsuite exists [15:38:47] [INFO] Run container 1a6eae1e8953 successful! [15:38:47] [INFO] pocsusite got a total of 1 tasks [15:38:47] [INFO] running poc:'Struts2 045 RCE CVE-2017' target 'http://127.0.0.1:8080/S2-032-showcase/fileupload/doUpload.action' [15:39:17] [+] URL : http://127.0.0.1:8080/S2-032-showcase/fileupload/doUpload.action [15:39:17] [+] Headers : {'Server': 'Apache-Coyote/1.1', 'nyvkx': '788544', 'Set-Cookie': 'JSESSIONID=0A9892431B32A541B51D4721FA0D2728; Path=/S2-032-showcase/; HttpOnly', 'Content-Type': 'text/html;charset=ISO-8859-1', 'Transfer-Encoding': 'chunked', 'Date': 'Mon, 25 Dec 2023 07:39:17 GMT'} [15:39:17] [INFO] Scan completed,ready to print +------------------------------------------------------------------+--------------------------+--------+-----------+---------+---------+ | target-url | poc-name | poc-id | component | version | status | +------------------------------------------------------------------+--------------------------+--------+-----------+---------+---------+ | http://127.0.0.1:8080/S2-032-showcase/fileupload/doUpload.action | Struts2 045 RCE CVE-2017 | | struts2 | | success | +------------------------------------------------------------------+--------------------------+--------+-----------+---------+---------+ success : 1 / 1 ``` #### 漏洞环境构建介绍 ``` Docker Environment: Docker Environment options --docker-start Run the docker for PoC --docker-port DOCKER_PORT Publish a container's port(s) to the host --docker-volume DOCKER_VOLUME Bind mount a volume --docker-env DOCKER_ENV Set environment variables --docker-only Only run docker environment ``` - `--docker-start` 启动环境参数。如果指定,将从 PoC 中获取 Docker 镜像。 - `--docker-port` 将容器端口发布到主机,例如:`--docker-port [主机端口]:[容器端口]`,可以指定多个 - `--docker-volume` 绑定挂载卷,例如 `--docker-volume /主机路径/:/容器路径/`,可以指定多个 - `--docker-env` 设置环境变量 `--docker-env 变量名=值`,可以指定多个 - `--docker-only` 仅启动 Docker 环境 用法与 Docker 的命令行参数大致相同。 ## 环境要求 - Python 3.8+ - 适用于 Linux, Windows, Mac OSX, BSD 等。 ## 安装 在终端提示符下粘贴: ### Python pip ``` pip3 install pocsuite3 # 使用其他 PyPI 镜像 pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple pocsuite3 ``` ### MacOS ``` brew update brew info pocsuite3 brew install pocsuite3 ``` ### [Debian](https://tracker.debian.org/pkg/pocsuite3), [Ubuntu](https://launchpad.net/ubuntu/+source/pocsuite3), [Kali](http://pkg.kali.org/pkg/pocsuite3) ``` sudo apt update sudo apt install pocsuite3 ``` ### Docker ``` docker run -it pocsuite3/pocsuite3 ``` ### ArchLinux ``` yay pocsuite3 ``` ### 或者点击 [here](https://github.com/knownsec/pocsuite3/archive/master.zip) 下载最新的源码 zip 包并解压 ``` wget https://github.com/knownsec/pocsuite3/archive/master.zip unzip master.zip cd pocsuite3-master pip3 install -r requirements.txt python3 setup.py install ``` 该软件的最新版本可在以下网址获取:https://pocsuite.org ## 文档 文档可在以下网址获取:https://pocsuite.org ## 使用方法 ``` cli mode # basic usage, use -v to set the log level pocsuite -u http://example.com -r example.py -v 2 # run poc with shell mode pocsuite -u http://example.com -r example.py -v 2 --shell # search for the target of redis service from ZoomEye and perform batch detection of vulnerabilities. The threads is set to 20 pocsuite -r redis.py --dork service:redis --threads 20 # load all poc in the poc directory and save the result as html pocsuite -u http://example.com --plugins poc_from_pocs,html_report # load the target from the file, and use the poc under the poc directory to scan pocsuite -f batch.txt --plugins poc_from_pocs,html_report # load CIDR target pocsuite -u 10.0.0.0/24 -r example.py # the custom parameters `command` is implemented in ecshop poc, which can be set from command line options pocsuite -u http://example.com -r ecshop_rce.py --attack --command "whoami" console mode poc-console ``` ## 如何贡献 1. 检查已有的 Issue 或开启一个新的 Issue,围绕功能想法或 Bug 展开讨论。 2. 在 GitHub 上 Fork [the repository](https://github.com/knownsec/pocsuite3) 开始进行更改。 3. 编写一个测试,证明 Bug 已修复或功能按预期工作。 4. 向维护者发送 Pull Request 或 Bug,直到其被合并或修复。请确保将自己添加到 [Contributors](./CONTRIBUTORS.md)。 ## 相关链接 * [Contributors](./CONTRIBUTORS.md) * [ChangeLog](./CHANGELOG.md) * [Bug tracking](https://github.com/knownsec/pocsuite3/issues) * [Copyright](./COPYING) * [Pocsuite](https://pocsuite.org) * [Seebug](https://www.seebug.org) * [ZoomEye](https://www.zoomeye.org) * [Knownsec](https://www.knownsec.com)
标签:404团队, Bug查找, CISA项目, Gradle, JDK 21, LGPL, Maven, meg, pocsuite3, PoC框架, Python, SonarCloud, Web安全, XXE攻击, 信息安全, 域名收集, 密码管理, 开源框架, 批量查询, 持续集成, 插件化设计, 搜索引擎查询, 无后门, 漏洞测试, 漏洞验证, 知道创宇, 编程工具, 网络安全, 蓝队分析, 请求拦截, 资产探测, 软件测试, 远程代码执行, 逆向工具, 隐私保护