regaan/PoCSmith

GitHub: regaan/PoCSmith

基于CodeLlama-7B微调的AI助手,专门辅助安全研究员将CVE数据和漏洞描述自动转化为概念验证代码及多平台Shellcode。

Stars: 1 | Forks: 0

# PoCSmith — AI 驱动的对抗性工件生成器 [![Version: 1.0.0](https://img.shields.io/badge/version-1.0.0-red?style=for-the-badge)](https://github.com/regaan/PoCSmith) [![License: MIT](https://img.shields.io/badge/license-MIT-blue?style=for-the-badge)](https://github.com/regaan/PoCSmith) [![Status: Research](https://img.shields.io/badge/status-research-orange?style=for-the-badge)](https://github.com/regaan/PoCSmith) **PoCSmith** 是一个专门的 AI 模型,经过微调用于自动生成概念验证漏洞利用程序和多平台 shellcode。它作为 **ROT Independent Security Research Lab** 安全工程师和红队的研究助手,利用经过微调的 CodeLlama-7B 主干网络,将漏洞描述和 CVE 数据转化为功能性、高质量的攻击性工件。 ## **首席研究员:** Regaan (ROT Lab) ## 仅供道德使用 此工具专为防御性安全研究和授权测试而设计: - 对您拥有或经授权测试的系统进行渗透测试 - 安全研究与漏洞分析 - 在受控环境中用于教育目的 - 严禁用于恶意攻击或未经授权的访问 请负责任地使用。遵守所有适用法律法规。 ## 功能 - **AI 驱动生成** - 基于微调的 CodeLlama-7B,使用 1,472 个漏洞利用样本训练 - **CVE 集成** - 从 NVD API 获取漏洞数据 - **多平台 Shellcode** - 支持 x86、x64、ARM - **简易 CLI** - 易用的命令行界面 - **高质量** - 78.4% token 准确率 ## 快速开始 ### 安装 ``` git clone https://github.com/regaan/PoCSmith.git cd PoCSmith python3 -m venv venv source venv/bin/activate pip install -e . ``` ### 使用示例 ``` # 从 CVE 生成 exploit python src/cli/main.py cve CVE-2024-1234 # 生成 shellcode python src/cli/main.py shellcode --platform linux_x64 --type reverse_shell --lhost 10.10.14.5 --lport 4444 # 从 vulnerability description 生成 python src/cli/main.py generate --vuln "buffer overflow" --target "Apache 2.4" # 列出可用选项 python src/cli/main.py list-platforms python src/cli/main.py list-payloads ``` ## 模型详情 - **基础模型:** CodeLlama-7B - **训练方式:** QLoRA 4-bit 量化 - **数据集:** 1,472 个样本(CVE-Exploit 对 + shellcode) - **性能:** 78.4% token 准确率,30% 损失降低 - **训练时间:** 在 RTX 4050 (6GB VRAM) 上耗时 3 小时 17 分 ## 项目结构 ``` PoCSmith/ ├── src/ │ ├── parsers/ # CVE parsing │ ├── generators/ # Exploit & shellcode generation │ ├── formatters/ # Output formatting │ ├── cli/ # Command-line interface │ └── core/ # Configuration ├── models/ │ └── pocsmith-v1/ # Fine-tuned AI model (LoRA adapters) ├── data/ # Training data ├── docs/ # Documentation └── tests/ # Unit tests ``` ## 文档 - [使用指南](docs/USAGE.md) - [设置说明](docs/implementation/SETUP.md) - [微调详情](docs/implementation/FINE_TUNING.md) - [系统架构](docs/architecture/SYSTEM_ARCHITECTURE.md) ## 需求 - Python 3.11+ - 支持 CUDA 的 GPU(建议 6GB+ VRAM) - 20GB 磁盘空间 ### 依赖项 ``` torch>=2.0.0 transformers>=4.35.0 peft>=0.7.0 bitsandbytes>=0.41.0 click>=8.1.0 ``` ## 示例输出 ### Shellcode 生成 ``` $ python src/cli/main.py shellcode --platform linux_x86 --type reverse_shell --lhost 10.10.14.5 --lport 4444 PoCSmith v1.0 [*] Generating reverse_shell for linux_x86... Loading PoCSmith model... Model ready! /* * Shellcode for Linux/x86 * - Calls socket() -> connect() -> dup2() -> execve() * - Tested on Ubuntu, Debian * - Length: 160 bytes */ ``` ## 贡献 欢迎贡献。请 fork 本仓库,创建功能分支,并提交 pull request。 ## 许可证 MIT 许可证 - 详见 LICENSE 文件 ## 免责声明 仅供教育和防御性安全研究使用 我不对滥用此工具的行为负责。用户必须在测试前获得适当授权,遵循负责任的披露做法,并遵守所有适用法律。 ## 致谢 - CodeLlama (Meta AI) - NVD (NIST) - Exploit-DB - Metasploit Framework - Hugging Face ## 作者 **Regaan** | **[ROT Independent Security Research Lab](https://rothackers.com)** 首席研究员 *由 ROT Independent Security Research Lab 为全球安全研究社区构建。*
标签:CodeLlama, CVE分析, CVE数据, DNS 反向解析, JSON 请求, LLM, NVD API, PoC生成, Python, Shellcode生成, TGT, Unmanaged PE, 云资产清单, 人工智能, 代码安全, 凭据扫描, 域名收集, 多平台支持, 安全大模型, 微调, 攻防演练, 文档安全, 无后门, 漏洞利用生成, 漏洞枚举, 用户模式Hook绕过, 系统调用监控, 网络安全, 自动化攻击, 误配置预防, 逆向工具, 逆向工程, 防御性安全, 隐私保护