[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"similar-GH05TCREW--pentestagent":3,"tool-GH05TCREW--pentestagent":61},[4,18,26,36,44,53],{"id":5,"name":6,"github_repo":7,"description_zh":8,"stars":9,"difficulty_score":10,"last_commit_at":11,"category_tags":12,"status":17},4358,"openclaw","openclaw\u002Fopenclaw","OpenClaw 是一款专为个人打造的本地化 AI 助手，旨在让你在自己的设备上拥有完全可控的智能伙伴。它打破了传统 AI 助手局限于特定网页或应用的束缚，能够直接接入你日常使用的各类通讯渠道，包括微信、WhatsApp、Telegram、Discord、iMessage 等数十种平台。无论你在哪个聊天软件中发送消息，OpenClaw 都能即时响应，甚至支持在 macOS、iOS 和 Android 设备上进行语音交互，并提供实时的画布渲染功能供你操控。\n\n这款工具主要解决了用户对数据隐私、响应速度以及“始终在线”体验的需求。通过将 AI 部署在本地，用户无需依赖云端服务即可享受快速、私密的智能辅助，真正实现了“你的数据，你做主”。其独特的技术亮点在于强大的网关架构，将控制平面与核心助手分离，确保跨平台通信的流畅性与扩展性。\n\nOpenClaw 非常适合希望构建个性化工作流的技术爱好者、开发者，以及注重隐私保护且不愿被单一生态绑定的普通用户。只要具备基础的终端操作能力（支持 macOS、Linux 及 Windows WSL2），即可通过简单的命令行引导完成部署。如果你渴望拥有一个懂你",349277,3,"2026-04-06T06:32:30",[13,14,15,16],"Agent","开发框架","图像","数据工具","ready",{"id":19,"name":20,"github_repo":21,"description_zh":22,"stars":23,"difficulty_score":10,"last_commit_at":24,"category_tags":25,"status":17},3808,"stable-diffusion-webui","AUTOMATIC1111\u002Fstable-diffusion-webui","stable-diffusion-webui 是一个基于 Gradio 构建的网页版操作界面，旨在让用户能够轻松地在本地运行和使用强大的 Stable Diffusion 图像生成模型。它解决了原始模型依赖命令行、操作门槛高且功能分散的痛点，将复杂的 AI 绘图流程整合进一个直观易用的图形化平台。\n\n无论是希望快速上手的普通创作者、需要精细控制画面细节的设计师，还是想要深入探索模型潜力的开发者与研究人员，都能从中获益。其核心亮点在于极高的功能丰富度：不仅支持文生图、图生图、局部重绘（Inpainting）和外绘（Outpainting）等基础模式，还独创了注意力机制调整、提示词矩阵、负向提示词以及“高清修复”等高级功能。此外，它内置了 GFPGAN 和 CodeFormer 等人脸修复工具，支持多种神经网络放大算法，并允许用户通过插件系统无限扩展能力。即使是显存有限的设备，stable-diffusion-webui 也提供了相应的优化选项，让高质量的 AI 艺术创作变得触手可及。",162132,"2026-04-05T11:01:52",[14,15,13],{"id":27,"name":28,"github_repo":29,"description_zh":30,"stars":31,"difficulty_score":32,"last_commit_at":33,"category_tags":34,"status":17},1381,"everything-claude-code","affaan-m\u002Feverything-claude-code","everything-claude-code 是一套专为 AI 编程助手（如 Claude Code、Codex、Cursor 等）打造的高性能优化系统。它不仅仅是一组配置文件，而是一个经过长期实战打磨的完整框架，旨在解决 AI 代理在实际开发中面临的效率低下、记忆丢失、安全隐患及缺乏持续学习能力等核心痛点。\n\n通过引入技能模块化、直觉增强、记忆持久化机制以及内置的安全扫描功能，everything-claude-code 能显著提升 AI 在复杂任务中的表现，帮助开发者构建更稳定、更智能的生产级 AI 代理。其独特的“研究优先”开发理念和针对 Token 消耗的优化策略，使得模型响应更快、成本更低，同时有效防御潜在的攻击向量。\n\n这套工具特别适合软件开发者、AI 研究人员以及希望深度定制 AI 工作流的技术团队使用。无论您是在构建大型代码库，还是需要 AI 协助进行安全审计与自动化测试，everything-claude-code 都能提供强大的底层支持。作为一个曾荣获 Anthropic 黑客大奖的开源项目，它融合了多语言支持与丰富的实战钩子（hooks），让 AI 真正成长为懂上",144730,2,"2026-04-07T23:26:32",[14,13,35],"语言模型",{"id":37,"name":38,"github_repo":39,"description_zh":40,"stars":41,"difficulty_score":32,"last_commit_at":42,"category_tags":43,"status":17},2271,"ComfyUI","Comfy-Org\u002FComfyUI","ComfyUI 是一款功能强大且高度模块化的视觉 AI 引擎，专为设计和执行复杂的 Stable Diffusion 图像生成流程而打造。它摒弃了传统的代码编写模式，采用直观的节点式流程图界面，让用户通过连接不同的功能模块即可构建个性化的生成管线。\n\n这一设计巧妙解决了高级 AI 绘图工作流配置复杂、灵活性不足的痛点。用户无需具备编程背景，也能自由组合模型、调整参数并实时预览效果，轻松实现从基础文生图到多步骤高清修复等各类复杂任务。ComfyUI 拥有极佳的兼容性，不仅支持 Windows、macOS 和 Linux 全平台，还广泛适配 NVIDIA、AMD、Intel 及苹果 Silicon 等多种硬件架构，并率先支持 SDXL、Flux、SD3 等前沿模型。\n\n无论是希望深入探索算法潜力的研究人员和开发者，还是追求极致创作自由度的设计师与资深 AI 绘画爱好者，ComfyUI 都能提供强大的支持。其独特的模块化架构允许社区不断扩展新功能，使其成为当前最灵活、生态最丰富的开源扩散模型工具之一，帮助用户将创意高效转化为现实。",107888,"2026-04-06T11:32:50",[14,15,13],{"id":45,"name":46,"github_repo":47,"description_zh":48,"stars":49,"difficulty_score":32,"last_commit_at":50,"category_tags":51,"status":17},4721,"markitdown","microsoft\u002Fmarkitdown","MarkItDown 是一款由微软 AutoGen 团队打造的轻量级 Python 工具，专为将各类文件高效转换为 Markdown 格式而设计。它支持 PDF、Word、Excel、PPT、图片（含 OCR）、音频（含语音转录）、HTML 乃至 YouTube 链接等多种格式的解析，能够精准提取文档中的标题、列表、表格和链接等关键结构信息。\n\n在人工智能应用日益普及的今天，大语言模型（LLM）虽擅长处理文本，却难以直接读取复杂的二进制办公文档。MarkItDown 恰好解决了这一痛点，它将非结构化或半结构化的文件转化为模型“原生理解”且 Token 效率极高的 Markdown 格式，成为连接本地文件与 AI 分析 pipeline 的理想桥梁。此外，它还提供了 MCP（模型上下文协议）服务器，可无缝集成到 Claude Desktop 等 LLM 应用中。\n\n这款工具特别适合开发者、数据科学家及 AI 研究人员使用，尤其是那些需要构建文档检索增强生成（RAG）系统、进行批量文本分析或希望让 AI 助手直接“阅读”本地文件的用户。虽然生成的内容也具备一定可读性，但其核心优势在于为机器",93400,"2026-04-06T19:52:38",[52,14],"插件",{"id":54,"name":55,"github_repo":56,"description_zh":57,"stars":58,"difficulty_score":10,"last_commit_at":59,"category_tags":60,"status":17},4487,"LLMs-from-scratch","rasbt\u002FLLMs-from-scratch","LLMs-from-scratch 是一个基于 PyTorch 的开源教育项目，旨在引导用户从零开始一步步构建一个类似 ChatGPT 的大型语言模型（LLM）。它不仅是同名技术著作的官方代码库，更提供了一套完整的实践方案，涵盖模型开发、预训练及微调的全过程。\n\n该项目主要解决了大模型领域“黑盒化”的学习痛点。许多开发者虽能调用现成模型，却难以深入理解其内部架构与训练机制。通过亲手编写每一行核心代码，用户能够透彻掌握 Transformer 架构、注意力机制等关键原理，从而真正理解大模型是如何“思考”的。此外，项目还包含了加载大型预训练权重进行微调的代码，帮助用户将理论知识延伸至实际应用。\n\nLLMs-from-scratch 特别适合希望深入底层原理的 AI 开发者、研究人员以及计算机专业的学生。对于不满足于仅使用 API，而是渴望探究模型构建细节的技术人员而言，这是极佳的学习资源。其独特的技术亮点在于“循序渐进”的教学设计：将复杂的系统工程拆解为清晰的步骤，配合详细的图表与示例，让构建一个虽小但功能完备的大模型变得触手可及。无论你是想夯实理论基础，还是为未来研发更大规模的模型做准备",90106,"2026-04-06T11:19:32",[35,15,13,14],{"id":62,"github_repo":63,"name":64,"description_en":65,"description_zh":66,"ai_summary_zh":66,"readme_en":67,"readme_zh":68,"quickstart_zh":69,"use_case_zh":70,"hero_image_url":71,"owner_login":72,"owner_name":73,"owner_avatar_url":74,"owner_bio":75,"owner_company":75,"owner_location":75,"owner_email":75,"owner_twitter":75,"owner_website":75,"owner_url":76,"languages":77,"stars":98,"forks":99,"last_commit_at":100,"license":101,"difficulty_score":32,"env_os":102,"env_gpu":103,"env_ram":103,"env_deps":104,"category_tags":110,"github_topics":111,"view_count":32,"oss_zip_url":75,"oss_zip_packed_at":75,"status":17,"created_at":127,"updated_at":128,"faqs":129,"releases":160},5309,"GH05TCREW\u002Fpentestagent","pentestagent","PentestAgent is an AI agent framework for black-box security testing, supporting bug bounty, red-team, and penetration testing workflows.","PentestAgent 是一款专为黑盒安全测试打造的 AI 智能体框架，旨在辅助漏洞赏金猎人、红队成员及渗透测试人员高效完成工作流程。它通过引入人工智能，解决了传统手动测试中信息搜集繁琐、工具调用复杂以及多步骤攻击难以自动编排的痛点，让安全评估更加智能化和自动化。\n\n该工具特别适合具备一定网络安全基础的专业人士使用，如安全研究员、渗透测试工程师以及希望探索 AI 在安全领域应用的开发者。普通用户若无相关安全知识，可能难以充分发挥其价值。\n\nPentestAgent 的技术亮点在于其灵活的多模式协作机制：既支持单指令快速执行的“协助模式”，也能启动完全自主的“智能体模式”，更拥有独特的“团队模式”，可协调多个专用智能体分工合作，模拟真实攻击团队的组织架构。此外，它原生兼容 Docker 环境，能够直接调用 Nmap、Metasploit、SQLMap 等经典渗透工具，并支持通过 LiteLLM 接入各类主流大模型。内置的预设攻击剧本（Playbooks）进一步降低了复杂测试场景的门槛，帮助用户系统化地执行黑盒测试任务。","\u003Cdiv align=\"center\">\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FGH05TCREW_pentestagent_readme_6f83c1db4019.png\" alt=\"PentestAgent Logo\" width=\"220\" style=\"margin-bottom: 20px;\"\u002F>\n\n# PentestAgent\n### AI Penetration Testing\n\n[![Python](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPython-3.10%2B-blue.svg)](https:\u002F\u002Fwww.python.org\u002F) [![License](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-MIT-green.svg)](LICENSE.txt) [![Version](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FVersion-0.2.0-orange.svg)](https:\u002F\u002Fgithub.com\u002FGH05TCREW\u002Fpentestagent\u002Freleases) [![Security](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FSecurity-Penetration%20Testing-red.svg)](https:\u002F\u002Fgithub.com\u002FGH05TCREW\u002Fpentestagent) [![MCP](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FMCP-Compatible-purple.svg)](https:\u002F\u002Fgithub.com\u002FGH05TCREW\u002Fpentestagent)\n\n\u003C\u002Fdiv>\n\nhttps:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002Fa67db2b5-672a-43df-b709-149c8eaee975\n\n## Requirements\n\n- Python 3.10+\n- API key for OpenAI, Anthropic, or other LiteLLM-supported provider\n\n## Install\n\n```bash\n# Clone\ngit clone https:\u002F\u002Fgithub.com\u002FGH05TCREW\u002Fpentestagent.git\ncd pentestagent\n\n# Setup (creates venv, installs deps)\n.\\scripts\\setup.ps1   # Windows\n.\u002Fscripts\u002Fsetup.sh    # Linux\u002FmacOS\n\n# Or manual\npython -m venv venv\n.\\venv\\Scripts\\Activate.ps1  # Windows\nsource venv\u002Fbin\u002Factivate     # Linux\u002FmacOS\npip install -e \".[all]\"\nplaywright install chromium  # Required for browser tool\n```\n\n## Configure\n\nCreate `.env` in the project root:\n\n```\nANTHROPIC_API_KEY=sk-ant-...\nPENTESTAGENT_MODEL=claude-sonnet-4-20250514\n```\n\nOr for OpenAI:\n\n```\nOPENAI_API_KEY=sk-...\nPENTESTAGENT_MODEL=gpt-5\n```\n\nAny [LiteLLM-supported model](https:\u002F\u002Fdocs.litellm.ai\u002Fdocs\u002Fproviders) works.\n\n## Run\n\n```bash\npentestagent                    # Launch TUI\npentestagent -t 192.168.1.1     # Launch with target\npentestagent --docker           # Run tools in Docker container\n```\n\n## Docker\n\nRun tools inside a Docker container for isolation and pre-installed pentesting tools.\n\n### Option 1: Pull pre-built image (fastest)\n\n```bash\n# Base image with nmap, netcat, curl\ndocker run -it --rm \\\n  -e ANTHROPIC_API_KEY=your-key \\\n  -e PENTESTAGENT_MODEL=claude-sonnet-4-20250514 \\\n  ghcr.io\u002Fgh05tcrew\u002Fpentestagent:latest\n\n# Kali image with metasploit, sqlmap, hydra, etc.\ndocker run -it --rm \\\n  -e ANTHROPIC_API_KEY=your-key \\\n  ghcr.io\u002Fgh05tcrew\u002Fpentestagent:kali\n```\n\n### Option 2: Build locally\n\n```bash\n# Build\ndocker compose build\n\n# Run\ndocker compose run --rm pentestagent\n\n# Or with Kali\ndocker compose --profile kali build\ndocker compose --profile kali run --rm pentestagent-kali\n```\n\nThe container runs PentestAgent with access to Linux pentesting tools. The agent can use `nmap`, `msfconsole`, `sqlmap`, etc. directly via the terminal tool.\n\nRequires Docker to be installed and running.\n\n## Modes\n\nPentestAgent has three modes, accessible via commands in the TUI:\n\n| Mode | Command | Description |\n|------|---------|-------------|\n| Assist | `\u002Fassist \u003Ctask>` | One single-shot instruction, with tool execution |\n| Agent | `\u002Fagent \u003Ctask>` | Autonomous execution of a single task. |\n| Crew | `\u002Fcrew \u003Ctask>` | Multi-agent mode. Orchestrator spawns specialized workers. |\n| Interact | `\u002Finteract \u003Ctask>` | Interactive mode. Chat with the agent, it will help you and guide during the pentesting procedure |\n\n### TUI Commands\n\n```\n\u002Fassist \u003Ctask>    One single-shot instruction.\n\u002Fagent \u003Ctask>     Run autonomous agent on task\n\u002Fcrew \u003Ctask>      Run multi-agent crew on task\n\u002Finteract \u003Ctask> Chat with the agent in guided mode\n\u002Ftarget \u003Chost>    Set target\n\u002Ftools            List available tools\n\u002Fnotes            Show saved notes\n\u002Freport           Generate report from session\n\u002Fmemory           Show token\u002Fmemory usage\n\u002Fprompt           Show system prompt\n\u002Fmcp \u003Clist\u002Fadd>   Visualizes or adds a new MCP server.\n\u002Fclear            Clear chat and history\n\u002Fquit             Exit (also \u002Fexit, \u002Fq)\n\u002Fhelp             Show help (also \u002Fh, \u002F?)\n```\n\nPress `Esc` to stop a running agent. `Ctrl+Q` to quit.\n\n## Playbooks\n\nPentestAgent includes prebuilt **attack playbooks** for black-box security testing. Playbooks define a structured approach to specific security assessments.\n\n**Run a playbook:**\n\n```bash\npentestagent run -t example.com --playbook thp3_web\n```\n\n![Playbook Demo](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FGH05TCREW_pentestagent_readme_d1fa52d0753a.gif)\n\n## Tools\n\nPentestAgent includes built-in tools and supports MCP (Model Context Protocol) for extensibility.\n\n**Built-in tools:** `terminal`, `browser`, `notes`, `web_search` (requires `TAVILY_API_KEY`), `spawn_mcp_agent`\n\n### Agent Self-Spawning (`spawn_mcp_agent`)\n\n`spawn_mcp_agent` is a built-in tool that allows a running agent to spawn a child copy of itself as a subordinate MCP server connected over stdio. The child process is fully isolated — its own runtime, LLM client, conversation history, and notes store — and its complete tool set is injected back into the parent agent's available tools after spawning.\n\nThis enables hierarchical, multi-agent workflows without any external orchestration: the agent self-organises by delegating scoped subtasks to children it spawns on demand.\n\n| Argument | Type | Default | Description |\n|----------|------|---------|-------------|\n| `target` | string | — | Pentest target to pass to the child |\n| `scope` | string[] | — | In-scope targets\u002FCIDRs for the child |\n| `model` | string | env var | Model identifier, overrides `PENTESTAGENT_MODEL` on the child |\n| `no_rag` | boolean | `false` | Skip RAG engine initialisation on the child |\n| `no_mcp` | boolean | `true` | Skip external MCP server connections on the child (recommended) |\n\nAfter `spawn_mcp_agent` returns, the child's tools (`run_task`, `run_task_async`, `await_tasks`, etc.) are available on the **next** tool call. The child's server name is assigned automatically (e.g. `child_agent_1`) and returned in the result.\n\n**Example — orchestrator delegating parallel recon to two children:**\n\n```\n# Turn 1: spawn two isolated child agents\nspawn_mcp_agent  target=\"10.0.1.0\u002F24\"  scope=[\"10.0.1.0\u002F24\"]\nspawn_mcp_agent  target=\"10.0.2.0\u002F24\"  scope=[\"10.0.2.0\u002F24\"]\n\n# Turn 2: children's tools are now available — delegate work asynchronously\nchild_agent_1__run_task_async  task=\"Full port scan and service enumeration\"\nchild_agent_2__run_task_async  task=\"Full port scan and service enumeration\"\n\n# Turn 3: wait and collect\nchild_agent_1__await_tasks  task_ids=[\"\u003Cid1>\"]  timeout_seconds=600\nchild_agent_2__await_tasks  task_ids=[\"\u003Cid2>\"]  timeout_seconds=600\nchild_agent_1__get_task_result  task_id=\"\u003Cid1>\"\nchild_agent_2__get_task_result  task_id=\"\u003Cid2>\"\n```\n\n### MCP RAG Tool Optimizer\n\nWhen an MCP server exposes more than 128 tools, PentestAgent automatically replaces the full catalogue with a single `mcp_\u003Cserver>_rag_optimizer` tool. This meta-tool uses embedding similarity (via LiteLLM, default `text-embedding-3-small`) to retrieve the most relevant tools for the task at hand and injects them into the agent's next turn — keeping the context window manageable without losing access to the full tool set.\n\nThe optimizer is transparent to the agent: it calls the RAG tool with focused natural-language queries describing what it needs, and the matching tools become available on the next turn to call directly.\n\n**Usage guidance for the agent:**\n\n| Argument | Type | Default | Description |\n|----------|------|---------|-------------|\n| `queries` | string[] | *(required)* | One focused query per capability needed. More specific = higher accuracy |\n| `top_k` | integer | `20` | Tools to retrieve per query (max 128). Results are merged and deduplicated |\n\nEmbeddings are computed once at startup and cached, so repeated queries are fast. The optimizer is built per-server, so each MCP server with a large catalogue gets its own independent index.\n\n> **Tip:** Pass one query per distinct capability rather than combining everything into one query. `[\"list open ports on a host\", \"get process memory usage\"]` retrieves better results than `[\"list ports and memory and CPU\"]`.\n\n### MCP Integration\n\nPentestAgent supports MCP (Model Context Protocol) in two directions: **consuming** external MCP servers as tool sources, and **exposing itself** as an MCP server so external clients (Claude Desktop, Cursor, etc.) can drive PentestAgent programmatically.\n\n---\n\n#### Consuming External MCP Servers (Client Mode)\n\nConfigure `mcp_servers.json` to connect PentestAgent to any external MCP servers. Example config:\n\n```json\n{\n  \"mcpServers\": {\n    \"nmap\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"gc-nmap-mcp\"],\n      \"env\": {\n        \"NMAP_PATH\": \"\u002Fusr\u002Fbin\u002Fnmap\"\n      }\n    }\n  }\n}\n```\n\n---\n\n#### Exposing PentestAgent as an MCP Server (Server Mode)\n\nPentestAgent can run as an MCP server, allowing any MCP-compatible client to submit tasks, inspect results, and control the agent remotely. Two transports are supported:\n\n**STDIO** — for local clients (e.g. Claude Desktop, Cursor):\n\n```bash\npentestagent mcp_server --type stdio\npentestagent mcp_server --type stdio --target 192.168.1.1 --scope 192.168.1.0\u002F24\npentestagent mcp_server --type stdio --model claude-sonnet-4-20250514 --docker\n```\n\n**SSE (HTTP)** — for remote or networked clients:\n\n```bash\npentestagent mcp_server --type sse\npentestagent mcp_server --type sse --host 0.0.0.0 --port 8080\npentestagent mcp_server --type sse --target 10.0.0.1 --scope 10.0.0.0\u002F24 --docker\n```\n\nThe SSE transport exposes a single `\u002Fmcp` endpoint supporting `POST` (requests), `GET` (persistent SSE stream for server-initiated push), and `DELETE` (session teardown). Sessions are tracked via the `Mcp-Session-Id` header.\n\n**All `mcp_server` flags:**\n\n| Flag | Default | Description |\n|------|---------|-------------|\n| `--type` | *(required)* | Transport: `stdio` or `sse` |\n| `--host` | `0.0.0.0` | SSE bind host |\n| `--port` | `8080` | SSE bind port |\n| `--target` | none | Primary pentest target (IP \u002F hostname) |\n| `--scope` | `[]` | In-scope targets\u002FCIDRs (space-separated) |\n| `--model` | env var | Model identifier, overrides `PENTESTAGENT_MODEL` |\n| `--docker` | false | Use DockerRuntime instead of LocalRuntime |\n| `--no-rag` | false | Skip RAG engine initialisation |\n| `--no-mcp` | false | Skip external MCP server connections |\n\n##### Example: Claude Desktop config (`claude_desktop_config.json`)\n\n```json\n{\n  \"mcpServers\": {\n    \"pentestagent\": {\n      \"command\": \"pentestagent\",\n      \"args\": [\"mcp_server\", \"--type\", \"stdio\"]\n    }\n  }\n}\n```\n\n---\n\n#### MCP Server Tools Reference\n\nWhen acting as an MCP server, PentestAgent exposes the following tools:\n\n**Server Status & Config**\n\n| Tool | Description |\n|------|-------------|\n| `get_server_status` | Live server status: readiness, task counts by state, primary target\u002Fscope, memory store size |\n| `get_config` | Primary agent configuration: target, scope, max iterations, tool list |\n| `update_config` | Update target, scope, or max iterations for all subsequent tasks |\n\n**Task Execution**\n\n| Tool | Description |\n|------|-------------|\n| `run_task` | Submit a task and **block** until it completes. Returns full result, tools used, and notes snapshot |\n| `run_task_async` | Submit a task and **return immediately** with a `task_id`. Poll with `get_task_status` |\n\n**Task Inspection**\n\n| Tool | Description |\n|------|-------------|\n| `list_tasks` | List all tasks with status, target, and summary. Filterable by status |\n| `get_task_status` | Poll the current status and result preview of a task |\n| `get_task_result` | Full task result: final output, thinking steps, all tool calls and results, notes snapshot |\n| `await_tasks` | Block until a set of async task IDs have all finished (polls every 500 ms, configurable timeout) |\n\n**Task Control**\n\n| Tool | Description |\n|------|-------------|\n| `cancel_task` | Cancel a running or pending task by ID |\n\n**Tool Management**\n\n| Tool | Description |\n|------|-------------|\n| `list_tools` | List all tools available to the agent |\n| `enable_tool` | Enable a named tool on the primary agent |\n| `disable_tool` | Disable a named tool on the primary agent |\n\n\n\n**Conversation History**\n\n| Tool | Description |\n|------|-------------|\n| `get_conversation_history` | Return message history for a task or the primary agent. Supports a `limit` parameter |\n| `reset_conversation` | Clear conversation history for a task or the primary agent |\n\n**Memory**\n\n| Tool | Description |\n|------|-------------|\n| `store_memory` | Persist a key-value pair to the in-process memory store |\n| `retrieve_memory` | Retrieve by exact key, search by substring, or list all keys |\n| `clear_memory` | Delete a specific key or wipe all memory with `scope='all'` |\n\n**Observability**\n\n| Tool | Description |\n|------|-------------|\n| `get_logs` | Return recent execution logs, optionally filtered by level (`info` \u002F `warning` \u002F `error`) |\n| `get_metrics` | Runtime metrics: task counts, success rate, total tool calls, memory and log sizes |\n\n---\n\n#### Async Task Workflow Example\n\nFor long-running recon tasks, use the async pattern:\n\n```\n# 1. Submit tasks without blocking\nrun_task_async  task=\"Enumerate subdomains of example.com\"  target=\"example.com\"\nrun_task_async  task=\"Run nmap SYN scan on example.com\"     target=\"example.com\"\n\n# 2. Block until both finish (up to 5 minutes)\nawait_tasks  task_ids=[\"\u003Cid1>\", \"\u003Cid2>\"]  timeout_seconds=300\n\n# 3. Retrieve full results\nget_task_result  task_id=\"\u003Cid1>\"\nget_task_result  task_id=\"\u003Cid2>\"\n```\n\n---\n\n### CLI Tool Management\n\n```bash\npentestagent tools list         # List all tools\npentestagent tools info \u003Cname>  # Show tool details\npentestagent mcp list           # List MCP servers\npentestagent mcp add \u003Cname> \u003Ccommand> [args...]  # Add MCP server\npentestagent mcp test \u003Cname>    # Test MCP connection\n```\n\n## Knowledge\n\n- **RAG:** Place methodologies, CVEs, or wordlists in `pentestagent\u002Fknowledge\u002Fsources\u002F` for automatic context injection.\n- **Notes:** Agents save findings to `loot\u002Fnotes.json` with categories (`credential`, `vulnerability`, `finding`, `artifact`). Notes persist across sessions and are injected into agent context.\n- **Shadow Graph:** In Crew mode, the orchestrator builds a knowledge graph from notes to derive strategic insights (e.g., \"We have credentials for host X\").\n\n## Project Structure\n\n```\npentestagent\u002F\n  agents\u002F         # Agent implementations\n  config\u002F         # Settings and constants\n  interface\u002F      # TUI and CLI\n  knowledge\u002F      # RAG system and shadow graph\n  llm\u002F            # LiteLLM wrapper\n  mcp\u002F            # MCP client and server configs\n  playbooks\u002F      # Attack playbooks\n  runtime\u002F        # Execution environment\n  tools\u002F          # Built-in tools\n```\n\n## Development\n\n```bash\npip install -e \".[dev]\"\npytest                       # Run tests\npytest --cov=pentestagent    # With coverage\nblack pentestagent           # Format\nruff check pentestagent      # Lint\n```\n\n## Legal\n\nOnly use against systems you have explicit authorization to test. Unauthorized access is illegal.\n\n## License\n\nMIT","\u003Cdiv align=\"center\">\n\n\u003Cimg src=\"https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FGH05TCREW_pentestagent_readme_6f83c1db4019.png\" alt=\"PentestAgent Logo\" width=\"220\" style=\"margin-bottom: 20px;\"\u002F>\n\n# PentestAgent\n### 人工智能渗透测试\n\n[![Python](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FPython-3.10%2B-blue.svg)](https:\u002F\u002Fwww.python.org\u002F) [![License](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-MIT-green.svg)](LICENSE.txt) [![Version](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FVersion-0.2.0-orange.svg)](https:\u002F\u002Fgithub.com\u002FGH05TCREW\u002Fpentestagent\u002Freleases) [![Security](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FSecurity-Penetration%20Testing-red.svg)](https:\u002F\u002Fgithub.com\u002FGH05TCREW\u002Fpentestagent) [![MCP](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FMCP-Compatible-purple.svg)](https:\u002F\u002Fgithub.com\u002FGH05TCREW\u002Fpentestagent)\n\n\u003C\u002Fdiv>\n\nhttps:\u002F\u002Fgithub.com\u002Fuser-attachments\u002Fassets\u002Fa67db2b5-672a-43df-b709-149c8eaee975\n\n## 系统要求\n\n- Python 3.10+\n- OpenAI、Anthropic 或其他 LiteLLM 支持的提供商的 API 密钥\n\n## 安装\n\n```bash\n# 克隆\ngit clone https:\u002F\u002Fgithub.com\u002FGH05TCREW\u002Fpentestagent.git\ncd pentestagent\n\n# 设置（创建虚拟环境，安装依赖）\n.\\scripts\\setup.ps1   # Windows\n.\u002Fscripts\u002Fsetup.sh    # Linux\u002FmacOS\n\n# 或手动\npython -m venv venv\n.\\venv\\Scripts\\Activate.ps1  # Windows\nsource venv\u002Fbin\u002Factivate     # Linux\u002FmacOS\npip install -e \".[all]\"\nplaywright install chromium  # 浏览器工具所需\n```\n\n## 配置\n\n在项目根目录下创建 `.env` 文件：\n\n```\nANTHROPIC_API_KEY=sk-ant-...\nPENTESTAGENT_MODEL=claude-sonnet-4-20250514\n```\n\n或对于 OpenAI：\n\n```\nOPENAI_API_KEY=sk-...\nPENTESTAGENT_MODEL=gpt-5\n```\n\n任何 [LiteLLM 支持的模型](https:\u002F\u002Fdocs.litellm.ai\u002Fdocs\u002Fproviders) 均可使用。\n\n## 运行\n\n```bash\npentestagent                    # 启动 TUI\npentestagent -t 192.168.1.1     # 指定目标后启动\npentestagent --docker           # 在 Docker 容器中运行工具\n```\n\n## Docker\n\n通过 Docker 容器运行工具，以实现隔离并预装渗透测试工具。\n\n### 方法一：拉取预构建镜像（最快）\n\n```bash\n# 基础镜像，包含 nmap、netcat、curl\ndocker run -it --rm \\\n  -e ANTHROPIC_API_KEY=your-key \\\n  -e PENTESTAGENT_MODEL=claude-sonnet-4-20250514 \\\n  ghcr.io\u002Fgh05tcrew\u002Fpentestagent:latest\n\n# Kali 镜像，包含 metasploit、sqlmap、hydra 等\ndocker run -it --rm \\\n  -e ANTHROPIC_API_KEY=your-key \\\n  ghcr.io\u002Fgh05tcrew\u002Fpentestagent:kali\n```\n\n### 方法二：本地构建\n\n```bash\n# 构建\ndocker compose build\n\n# 运行\ndocker compose run --rm pentestagent\n\n# 或使用 Kali\ndocker compose --profile kali build\ndocker compose --profile kali run --rm pentestagent-kali\n```\n\n容器内运行 PentestAgent，并可访问 Linux 渗透测试工具。代理可通过终端工具直接使用 `nmap`、`msfconsole`、`sqlmap` 等。\n\n需已安装并运行 Docker。\n\n## 模式\n\nPentestAgent 提供三种模式，可通过 TUI 中的命令访问：\n\n| 模式 | 命令 | 描述 |\n|------|---------|-------------|\n| 辅助 | `\u002Fassist \u003Ctask>` | 单次执行指令，包含工具调用 |\n| 代理 | `\u002Fagent \u003Ctask>` | 自主执行单个任务。 |\n| 团队 | `\u002Fcrew \u003Ctask>` | 多代理模式。协调者会派生出专门的工作者。 |\n| 交互 | `\u002Finteract \u003Ctask>` | 交互模式。与代理聊天，它会在渗透测试过程中提供帮助和指导 |\n\n### TUI 命令\n\n```\n\u002Fassist \u003Ctask>    单次执行指令。\n\u002Fagent \u003Ctask>     自主代理执行任务\n\u002Fcrew \u003Ctask>      多代理团队执行任务\n\u002Finteract \u003Ctask>  引导模式下与代理聊天\n\u002Ftarget \u003Chost>    设置目标\n\u002Ftools            列出可用工具\n\u002Fnotes            显示保存的笔记\n\u002Freport           生成会话报告\n\u002Fmemory           显示令牌\u002F内存使用情况\n\u002Fprompt           显示系统提示词\n\u002Fmcp \u003Clist\u002Fadd>   可视化或添加新的 MCP 服务器。\n\u002Fclear            清除聊天记录和历史\n\u002Fquit             退出（也可使用 \u002Fexit、\u002Fq）\n\u002Fhelp             显示帮助（也可使用 \u002Fh、\u002F?）\n```\n\n按 `Esc` 键可停止正在运行的代理。`Ctrl+Q` 键可退出。\n\n## 演练剧本\n\nPentestAgent 包含用于黑盒安全测试的预构建 **攻击演练剧本**。这些剧本定义了针对特定安全评估的结构化方法。\n\n**运行演练剧本：**\n\n```bash\npentestagent run -t example.com --playbook thp3_web\n```\n\n![演练剧本演示](https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FGH05TCREW_pentestagent_readme_d1fa52d0753a.gif)\n\n## 工具\n\nPentestAgent 内置多种工具，并支持 MCP（模型上下文协议）以实现扩展性。\n\n**内置工具：** `terminal`、`browser`、`notes`、`web_search`（需设置 `TAVILY_API_KEY`）、`spawn_mcp_agent`\n\n### 代理自衍生（`spawn_mcp_agent`）\n\n`spawn_mcp_agent` 是一个内置工具，允许正在运行的代理通过 stdio 连接创建一个子代理作为下属 MCP 服务器。子进程完全隔离——拥有独立的运行时、LLM 客户端、对话历史和笔记存储——并在衍生完成后将其完整的工具集注入到父代理的可用工具中。\n\n这使得无需任何外部编排即可实现分层的多代理工作流：代理可以根据需要自行派生子代理来委派特定范围的任务。\n\n| 参数 | 类型 | 默认值 | 描述 |\n|----------|------|---------|-------------|\n| `target` | string | — | 传递给子代理的渗透测试目标 |\n| `scope` | string[] | — | 子代理的范围内目标\u002FCIDR |\n| `model` | string | 环境变量 | 模型标识符，覆盖子代理上的 `PENTESTAGENT_MODEL` |\n| `no_rag` | boolean | `false` | 跳过子代理的 RAG 引擎初始化 |\n| `no_mcp` | boolean | `true` | 跳过子代理的外部 MCP 服务器连接（推荐） |\n\n`spawn_mcp_agent` 返回后，子代理的工具（`run_task`、`run_task_async`、`await_tasks` 等）将在下一次调用工具时可用。子代理的名称会自动分配（例如 `child_agent_1`），并在结果中返回。\n\n**示例——协调者将并行侦察任务委派给两个子代理：**\n\n```\n# 第一轮：派生两个隔离的子代理\nspawn_mcp_agent  target=\"10.0.1.0\u002F24\"  scope=[\"10.0.1.0\u002F24\"]\nspawn_mcp_agent  target=\"10.0.2.0\u002F24\"  scope=[\"10.0.2.0\u002F24\"]\n\n# 第二轮：子代理的工具现已可用——异步委派工作\nchild_agent_1__run_task_async  task=\"全面端口扫描及服务枚举\"\nchild_agent_2__run_task_async  task=\"全面端口扫描及服务枚举\"\n\n# 第三轮：等待并收集结果\nchild_agent_1__await_tasks  task_ids=[\"\u003Cid1>\"]  timeout_seconds=600\nchild_agent_2__await_tasks  task_ids=[\"\u003Cid2>\"]  timeout_seconds=600\nchild_agent_1__get_task_result  task_id=\"\u003Cid1>\"\nchild_agent_2__get_task_result  task_id=\"\u003Cid2>\"\n```\n\n### MCP RAG 工具优化器\n\n当 MCP 服务器暴露超过 128 个工具时，PentestAgent 会自动将完整目录替换为单个 `mcp_\u003Cserver>_rag_optimizer` 工具。这个元工具利用嵌入相似度（通过 LiteLLM，默认使用 `text-embedding-3-small`）来检索与当前任务最相关的工具，并将其注入到智能体的下一轮对话中——从而在不丢失对完整工具集访问的情况下，保持上下文窗口的可控性。\n\n优化器对智能体是透明的：它会用聚焦的自然语言查询来调用 RAG 工具，描述所需的内容，匹配的工具将在下一轮直接可供调用。\n\n**智能体使用指南：**\n\n| 参数 | 类型 | 默认值 | 描述 |\n|------|------|--------|------|\n| `queries` | 字符串数组 | *(必填)* | 每个所需能力对应一个聚焦查询。越具体，准确性越高 |\n| `top_k` | 整数 | `20` | 每个查询要检索的工具数量（最多 128 个）。结果会被合并并去重 |\n\n嵌入向量在启动时计算一次并缓存，因此重复查询速度很快。优化器是按服务器构建的，因此每个拥有大型工具目录的 MCP 服务器都会有自己的独立索引。\n\n> **提示：** 每个独立的能力传递一个查询，而不是将所有内容合并成一个查询。例如，`[\"列出主机上的开放端口\", \"获取进程内存占用\"]` 比 `[\"列出端口、内存和 CPU 使用情况\"]` 能得到更好的结果。\n\n### MCP 集成\n\nPentestAgent 支持 MCP（模型上下文协议），可以从两个方向进行集成：**消费**外部 MCP 服务器作为工具源，以及**暴露自身**作为 MCP 服务器，以便外部客户端（Claude Desktop、Cursor 等）能够以编程方式驱动 PentestAgent。\n\n---\n\n#### 消费外部 MCP 服务器（客户端模式）\n\n通过配置 `mcp_servers.json` 文件，可以将 PentestAgent 连接到任何外部 MCP 服务器。示例配置如下：\n\n```json\n{\n  \"mcpServers\": {\n    \"nmap\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"gc-nmap-mcp\"],\n      \"env\": {\n        \"NMAP_PATH\": \"\u002Fusr\u002Fbin\u002Fnmap\"\n      }\n    }\n  }\n}\n```\n\n---\n\n#### 将 PentestAgent 暴露为 MCP 服务器（服务器模式）\n\nPentestAgent 可以作为 MCP 服务器运行，允许任何兼容 MCP 的客户端提交任务、检查结果并远程控制智能体。支持两种传输方式：\n\n**STDIO** — 适用于本地客户端（如 Claude Desktop、Cursor）：\n\n```bash\npentestagent mcp_server --type stdio\npentestagent mcp_server --type stdio --target 192.168.1.1 --scope 192.168.1.0\u002F24\npentestagent mcp_server --type stdio --model claude-sonnet-4-20250514 --docker\n```\n\n**SSE（HTTP）** — 适用于远程或网络客户端：\n\n```bash\npentestagent mcp_server --type sse\npentestagent mcp_server --type sse --host 0.0.0.0 --port 8080\npentestagent mcp_server --type sse --target 10.0.0.1 --scope 10.0.0.0\u002F24 --docker\n```\n\nSSE 传输方式会暴露一个 `\u002Fmcp` 端点，支持 `POST`（请求）、`GET`（用于服务器发起推送的持久化 SSE 流）和 `DELETE`（会话终止）。会话通过 `Mcp-Session-Id` 头部进行跟踪。\n\n**所有 `mcp_server` 标志：**\n\n| 标志 | 默认值 | 描述 |\n|------|--------|------|\n| `--type` | *(必填)* | 传输方式：`stdio` 或 `sse` |\n| `--host` | `0.0.0.0` | SSE 绑定主机 |\n| `--port` | `8080` | SSE 绑定端口 |\n| `--target` | 无 | 主要渗透测试目标（IP 地址或主机名） |\n| `--scope` | `[]` | 在范围内的目标\u002FCIDR（用空格分隔） |\n| `--model` | 环境变量 | 模型标识符，覆盖 `PENTESTAGENT_MODEL` |\n| `--docker` | false | 使用 DockerRuntime 而不是 LocalRuntime |\n| `--no-rag` | false | 跳过 RAG 引擎的初始化 |\n| `--no-mcp` | false | 跳过与外部 MCP 服务器的连接 |\n\n##### 示例：Claude Desktop 配置（`claude_desktop_config.json`）\n\n```json\n{\n  \"mcpServers\": {\n    \"pentestagent\": {\n      \"command\": \"pentestagent\",\n      \"args\": [\"mcp_server\", \"--type\", \"stdio\"]\n    }\n  }\n}\n```\n\n---\n\n#### MCP 服务器工具参考\n\n当作为 MCP 服务器运行时，PentestAgent 会暴露以下工具：\n\n**服务器状态与配置**\n\n| 工具 | 描述 |\n|------|------|\n| `get_server_status` | 实时服务器状态：就绪情况、按状态划分的任务数量、主要目标\u002F范围、内存存储大小 |\n| `get_config` | 主要智能体配置：目标、范围、最大迭代次数、工具列表 |\n| `update_config` | 更新目标、范围或最大迭代次数，应用于后续所有任务 |\n\n**任务执行**\n\n| 工具 | 描述 |\n|------|------|\n| `run_task` | 提交任务并**阻塞**直至完成。返回完整结果、使用的工具及笔记快照 |\n| `run_task_async` | 提交任务并**立即返回**一个 `task_id`。可通过 `get_task_status` 轮询 |\n\n**任务检查**\n\n| 工具 | 描述 |\n|------|------|\n| `list_tasks` | 列出所有任务及其状态、目标和摘要。可按状态筛选 |\n| `get_task_status` | 轮询任务的当前状态和结果预览 |\n| `get_task_result` | 完整任务结果：最终输出、思考步骤、所有工具调用及结果、笔记快照 |\n| `await_tasks` | 阻塞直至一组异步任务 ID 全部完成（每 500 毫秒轮询，可配置超时时间） |\n\n**任务控制**\n\n| 工具 | 描述 |\n|------|------|\n| `cancel_task` | 根据任务 ID 取消正在运行或待处理的任务 |\n\n**工具管理**\n\n| 工具 | 描述 |\n|------|------|\n| `list_tools` | 列出智能体可用的所有工具 |\n| `enable_tool` | 在主智能体上启用指定工具 |\n| `disable_tool` | 在主智能体上禁用指定工具 |\n\n\n\n**对话历史**\n\n| 工具 | 描述 |\n|------|------|\n| `get_conversation_history` | 返回某个任务或主智能体的消息历史。支持 `limit` 参数 |\n| `reset_conversation` | 清除某个任务或主智能体的对话历史 |\n\n**内存**\n\n| 工具 | 描述 |\n|------|------|\n| `store_memory` | 将键值对持久化到进程内内存存储中 |\n| `retrieve_memory` | 可按精确键检索、按子字符串搜索，或列出所有键 |\n| `clear_memory` | 删除特定键，或使用 `scope='all'` 清空全部内存 |\n\n**可观测性**\n\n| 工具 | 描述 |\n|------|------|\n| `get_logs` | 返回最近的执行日志，可选择按级别过滤（`info` \u002F `warning` \u002F `error`） |\n| `get_metrics` | 运行时指标：任务数量、成功率、工具总调用次数、内存和日志大小 |\n\n---\n\n#### 异步任务工作流示例\n\n对于长时间运行的侦察任务，可以使用异步模式：\n\n```\n# 1. 提交任务而不阻塞\nrun_task_async  任务=\"枚举 example.com 的子域名\"  目标=\"example.com\"\nrun_task_async  任务=\"对 example.com 执行 nmap SYN 扫描\"     目标=\"example.com\"\n\n# 2. 阻塞直至两者完成（最长 5 分钟）\nawait_tasks  任务 IDs=[\"\u003Cid1>\", \"\u003Cid2>\"]  超时时间=300 秒\n\n# 3. 获取完整结果\nget_task_result  任务 ID=\"\u003Cid1>\"\nget_task_result  任务 ID=\"\u003Cid2>\"\n```\n\n---\n\n### CLI 工具管理\n\n```bash\npentestagent tools list         # 列出所有工具\npentestagent tools info \u003Cname>  # 显示工具详情\npentestagent mcp list           # 列出 MCP 服务器\npentestagent mcp add \u003Cname> \u003Ccommand> [args...]  # 添加 MCP 服务器\npentestagent mcp test \u003Cname>    # 测试 MCP 连接\n```\n\n## 知识库\n\n- **RAG：** 将方法论、CVE 漏洞或字典文件放置在 `pentestagent\u002Fknowledge\u002Fsources\u002F` 目录下，以实现上下文的自动注入。\n- **笔记：** 代理会将发现结果保存到 `loot\u002Fnotes.json` 文件中，并按类别（`credential`、`vulnerability`、`finding`、`artifact`）进行分类。这些笔记会在会话之间持久化，并被注入到代理的上下文中。\n- **影子图谱：** 在 Crew 模式下，编排器会根据笔记构建知识图谱，从而得出战略性的洞察（例如：“我们已获取主机 X 的凭据”）。\n\n## 项目结构\n\n```\npentestagent\u002F\n  agents\u002F         # 代理实现\n  config\u002F         # 配置和常量\n  interface\u002F      # TUI 和 CLI 界面\n  knowledge\u002F      # RAG 系统和影子图谱\n  llm\u002F            # LiteLLM 封装\n  mcp\u002F            # MCP 客户端和服务器配置\n  playbooks\u002F      # 攻击剧本\n  runtime\u002F        # 执行环境\n  tools\u002F          # 内置工具\n```\n\n## 开发\n\n```bash\npip install -e \".[dev]\"\npytest                       # 运行测试\npytest --cov=pentestagent    # 带覆盖率\nblack pentestagent           # 格式化代码\nruff check pentestagent      # 代码检查\n```\n\n## 法律声明\n\n仅可在获得明确授权的情况下对目标系统进行测试。未经授权的访问属违法行为。\n\n## 许可证\n\nMIT","# PentestAgent 快速上手指南\n\nPentestAgent 是一款基于 AI 的自动化渗透测试工具，支持自主执行任务、多智能体协作及与各类渗透测试工具集成。\n\n## 环境准备\n\n在开始之前，请确保您的系统满足以下要求：\n\n*   **操作系统**：Linux, macOS 或 Windows\n*   **Python 版本**：3.10 或更高版本\n*   **API 密钥**：需拥有 OpenAI、Anthropic 或其他 LiteLLM 支持的服务商 API Key\n*   **可选依赖**：若需使用浏览器工具，需安装 Chromium（安装脚本会自动处理）；若需使用 Docker 模式，请确保已安装并运行 Docker。\n\n## 安装步骤\n\n### 1. 克隆项目\n```bash\ngit clone https:\u002F\u002Fgithub.com\u002FGH05TCREW\u002Fpentestagent.git\ncd pentestagent\n```\n\n### 2. 设置环境\n推荐使用官方提供的脚本自动创建虚拟环境并安装依赖：\n\n**Windows:**\n```powershell\n.\\scripts\\setup.ps1\n```\n\n**Linux \u002F macOS:**\n```bash\n.\u002Fscripts\u002Fsetup.sh\n```\n\n> **手动安装方式**（如果脚本执行失败）：\n> ```bash\n> python -m venv venv\n> # Windows 激活\n> .\\venv\\Scripts\\Activate.ps1\n> # Linux\u002FmacOS 激活\n> source venv\u002Fbin\u002Factivate\n> pip install -e \".[all]\"\n> playwright install chromium\n> ```\n\n## 基本使用\n\n### 1. 配置 API 密钥\n在项目根目录创建 `.env` 文件，填入您的模型提供商密钥和模型名称。\n\n**使用 Anthropic (推荐):**\n```env\nANTHROPIC_API_KEY=sk-ant-...\nPENTESTAGENT_MODEL=claude-sonnet-4-20250514\n```\n\n**使用 OpenAI:**\n```env\nOPENAI_API_KEY=sk-...\nPENTESTAGENT_MODEL=gpt-5\n```\n*注：支持任何 [LiteLLM 兼容的模型](https:\u002F\u002Fdocs.litellm.ai\u002Fdocs\u002Fproviders)。*\n\n### 2. 启动工具\n安装完成后，您可以通过以下命令启动交互式终端界面 (TUI)：\n\n**直接启动：**\n```bash\npentestagent\n```\n\n**指定目标启动：**\n```bash\npentestagent -t 192.168.1.1\n```\n\n**在 Docker 容器中运行（隔离环境，预装 nmap, metasploit 等工具）：**\n```bash\npentestagent --docker\n```\n\n### 3. 执行任务\n进入 TUI 界面后，您可以使用斜杠命令与 AI 交互。以下是常用模式：\n\n*   **辅助模式** (`\u002Fassist`)：单次指令执行，适合简单任务。\n    ```text\n    \u002Fassist 对目标进行端口扫描\n    ```\n*   **代理模式** (`\u002Fagent`)：自主执行单个复杂任务。\n    ```text\n    \u002Fagent 查找目标系统的 SQL 注入漏洞\n    ```\n*   **团队模式** (`\u002Fcrew`)：多智能体协作，由协调者分配任务给专业子代理。\n    ```text\n    \u002Fcrew 对目标进行全面的安全评估\n    ```\n*   **交互模式** (`\u002Finteract`)：引导式聊天，AI 逐步指导您进行操作。\n    ```text\n    \u002Finteract 帮我分析当前的网络服务\n    ```\n\n**其他实用命令：**\n*   `\u002Ftarget \u003Chost>`：设置或更改测试目标\n*   `\u002Freport`：生成当前会话的报告\n*   `\u002Fquit` 或 `Ctrl+Q`：退出程序\n*   `Esc`：停止正在运行的代理\n\n### 4. 运行预设剧本 (Playbooks)\nPentestAgent 内置了针对黑盒测试的攻击剧本。例如，运行 Web 测试剧本：\n\n```bash\npentestagent run -t example.com --playbook thp3_web\n```","某安全团队正在对一家金融客户的新上线 Web 系统进行黑盒渗透测试，需在有限时间内全面评估其外部攻击面。\n\n### 没有 pentestagent 时\n- 测试人员需手动编写并执行大量重复脚本（如 nmap 扫描、SQL 注入探测），耗时且容易遗漏边缘案例。\n- 面对复杂的业务逻辑漏洞，单人思维受限，难以系统性覆盖所有攻击路径，依赖个人经验导致测试深度不均。\n- 发现漏洞后，需人工整理截图、命令输出和复现步骤来编写报告，占用大量原本可用于深入测试的时间。\n- 团队协作时，信息同步依靠口头或分散的文档，缺乏统一的上下文记忆，导致多人测试时出现重复劳动或盲区。\n\n### 使用 pentestagent 后\n- 通过 `\u002Fagent` 模式下达“全面扫描目标端口并识别潜在注入点”指令，pentestagent 自动调用 Docker 内的 nmap、sqlmap 等工具链完成全流程探测，效率提升数倍。\n- 启用 `\u002Fcrew` 多智能体模式，pentestagent 自动协调“侦察员”、“攻击手”和“审计员”角色，系统性地模拟红队攻击，覆盖了人工容易忽略的逻辑漏洞。\n- 测试结束后，只需输入 `\u002Freport`，pentestagent 即刻基于会话记忆生成包含漏洞详情、复现步骤及修复建议的专业报告。\n- 利用内置的记忆机制和交互式 `\u002Finteract` 模式，团队成员可随时与 pentestagent 对话，回顾之前的测试路径和发现，确保协作无缝衔接。\n\npentestagent 将安全专家从繁琐的工具操作中解放出来，使其能专注于高阶策略分析，实现了自动化与智能化的完美融合。","https:\u002F\u002Foss.gittoolsai.com\u002Fimages\u002FGH05TCREW_pentestagent_01bc9f00.png","GH05TCREW","Masic","https:\u002F\u002Foss.gittoolsai.com\u002Favatars\u002FGH05TCREW_149c0cae.jpg",null,"https:\u002F\u002Fgithub.com\u002FGH05TCREW",[78,82,86,90,94],{"name":79,"color":80,"percentage":81},"Python","#3572A5",95.3,{"name":83,"color":84,"percentage":85},"Jinja","#a52a22",2.6,{"name":87,"color":88,"percentage":89},"Shell","#89e051",1.1,{"name":91,"color":92,"percentage":93},"PowerShell","#012456",0.7,{"name":95,"color":96,"percentage":97},"Dockerfile","#384d54",0.3,1870,383,"2026-04-07T19:59:59","MIT","Linux, macOS, Windows","未说明",{"notes":105,"python":106,"dependencies":107},"需要配置 OpenAI、Anthropic 或其他 LiteLLM 支持的提供商的 API 密钥。若使用浏览器工具需安装 Chromium (playwright install chromium)。支持 Docker 运行以隔离环境并使用预装的渗透测试工具（如 nmap, metasploit 等）。可通过 MCP 协议集成外部工具或作为服务器被其他客户端调用。","3.10+",[108,109],"litellm","playwright",[14,13,35,15,16],[112,113,114,115,116,117,118,119,120,121,122,123,124,125,126],"security-automation","ai-agents","ai","ai-cybersecurity","ai-hacking","ai-security-tool","ctf-tools","mcp-tools","pentesting-tools","red-teaming","ai-assistant","knowledge-graph","blackbox-testing","llm","penetration-testing","2026-03-27T02:49:30.150509","2026-04-08T10:07:02.467660",[130,135,140,145,150,155],{"id":131,"question_zh":132,"answer_zh":133,"source_url":134},24082,"运行脚本时提示 'API key not set' 错误，即使已在 app_config.py 中配置了密钥？","不要直接编辑 app_config.py 文件。请将 API 密钥、模型和 URL 设置在项目根目录下的 .env 文件中，并确保该文件保存为 UTF-8 编码以便正确读取。","https:\u002F\u002Fgithub.com\u002FGH05TCREW\u002Fpentestagent\u002Fissues\u002F4",{"id":136,"question_zh":137,"answer_zh":138,"source_url":139},24083,"运行 Agent 时遇到 'Invalid schema for function notes' 错误怎么办？","这是一个已知的 OpenAI schema 验证问题，已在 Pull Request #5 中修复。请拉取最新代码或合并该修复补丁即可解决。如果错误信息不同，可能需要进一步排查 LiteLLM 的详细报错。","https:\u002F\u002Fgithub.com\u002FGH05TCREW\u002Fpentestagent\u002Fissues\u002F6",{"id":141,"question_zh":142,"answer_zh":143,"source_url":144},24084,"使用 Gemini 模型运行 Agent 时报错，如何排查？","请检查环境变量设置是否正确，例如设置 PENTESTAGENT_MODEL=gemini\u002Fgemini-2.5-flash。如果仍然报错，建议开启 LiteLLM 调试模式（使用 litellm._turn_on_debug()）以获取完整的 API 请求和响应日志，从而定位具体是参数错误还是 API 限制问题。","https:\u002F\u002Fgithub.com\u002FGH05TCREW\u002Fpentestagent\u002Fissues\u002F8",{"id":146,"question_zh":147,"answer_zh":148,"source_url":149},24085,"调用 Nuclei 工具时提示 'Invalid url' 验证错误，但 Nuclei 命令行正常？","该错误通常是因为传递给 MCP 工具的 URL 参数格式不符合验证规则。请确保在 map.json 配置或命令调用中传入的是完整且合法的 URL 字符串（包含 http\u002Fhttps 前缀）。有用户反馈在 Agent 模式下直接使用目标 URL 运行是正常的，请检查输入参数的构造方式。","https:\u002F\u002Fgithub.com\u002FGH05TCREW\u002Fpentestagent\u002Fissues\u002F3",{"id":151,"question_zh":152,"answer_zh":153,"source_url":154},24086,"首次安装运行 'pentestagent scan' 命令后立即报错且无其他输出？","这通常是由于 OpenAI 工具定义中的 schema 无效导致的（特别是 notes 工具）。该问题已在之前的更新中修复，请确保你使用的是包含 PR #5 修复内容的最新版本。同时确认环境变量中已正确配置 OPENAI_API_KEY 和模型名称。","https:\u002F\u002Fgithub.com\u002FGH05TCREW\u002Fpentestagent\u002Fissues\u002F7",{"id":156,"question_zh":157,"answer_zh":158,"source_url":159},24087,"是否支持 LM Studio 作为本地 LLM 提供商，而不仅仅是 Ollama？","目前官方文档主要提及 Ollama，但该项目基于 LiteLLM 构建。理论上，只要 LM Studio 兼容 OpenAI API 格式，你可以通过配置 base_url 指向 LM Studio 的服务地址来尝试使用。如果社区有成功配置的先例，通常会在此类 Issue 中更新，目前建议查阅 LiteLLM 文档确认对 LM Studio 的具体支持情况。","https:\u002F\u002Fgithub.com\u002FGH05TCREW\u002Fpentestagent\u002Fissues\u002F10",[]]