PentestChain: A Cost-Aware, MCP-Orchestrated Framework for Automated Penetration Testing with Free-Tier LLMs
作者: Rushabh Vipulkumar Patel, Dipo Dunsin, Mohammed Almaiah, Mohamed Chahine Ghanem
分类: cs.CR, cs.AI, cs.NI
发布日期: 2026-09-16
备注: 12
💡 一句话要点
提出PentestChain框架以降低自动渗透测试成本
🎯 匹配领域: 支柱四:生成式动作 (Generative Motion)
关键词: 渗透测试 自动化测试 成本控制 AI模型 网络安全 漏洞检测 评估协议
📋 核心要点
- 现有的AI渗透测试方法如GPT-4因高昂的API费用,限制了小型组织的使用,无法实现持续的自动化测试。
- PentestChain框架通过结合本地模型和免费层模型,设计了一个十阶段的自动化渗透测试流程,降低了成本并提高了效率。
- 在实验中,该框架检测到26个服务,丰富了34个CVE,展示了其在实际应用中的有效性和可行性。
📝 摘要(中文)
AI驱动的渗透测试在使用高端模型如GPT-4时表现出色,但高昂的每次交互费用使得小型组织难以承受。本文提出PentestChain,一个十阶段的自动化渗透测试框架,结合了经过精心策划的确定性漏洞映射和成本意识的AI级联,首先使用本地Ollama模型(qwen2.5-7b),然后是免费层的OpenRouter和Cerebras,最后通过规则基础的回退机制确保输出。我们提出三项贡献:将美元成本作为评估指标,展示了7B参数的本地模型在零费用下的端到端操作;分析了MCP暴露的攻击面并提出四项缓解措施;制定了可重复的容器化评估协议,与顶级场所期望的标准化测试平台对齐。
🔬 方法详解
问题定义:本文旨在解决小型组织在使用AI进行渗透测试时面临的高成本问题。现有方法如GPT-4的高昂费用使得持续测试变得不可行。
核心思路:PentestChain框架通过结合本地模型和免费API,设计了一种成本意识的AI级联机制,确保在降低成本的同时保持渗透测试的有效性。
技术框架:该框架分为十个阶段,首先使用本地Ollama模型进行初步测试,然后通过OpenRouter和Cerebras等免费层模型进行扩展,最后通过规则基础的回退机制确保输出的可靠性。
关键创新:最重要的创新在于将美元成本作为评估标准,并展示了7B参数的本地模型在零费用下的有效操作,这在现有方法中尚属首次。
关键设计:框架中采用了确定性漏洞映射和多种AI模型的级联设计,确保了测试的全面性和准确性,同时在评估协议中引入了多次试验统计,以提高结果的可靠性。
🖼️ 关键图片
📊 实验亮点
在实验中,PentestChain框架成功检测到26个服务,并丰富了34个CVE,展示了其在实际应用中的有效性。与现有基线相比,该框架在成本控制和测试覆盖率方面显著提升,尤其是在使用本地模型时实现了零费用的操作。
🎯 应用场景
PentestChain框架在网络安全领域具有广泛的应用潜力,尤其适用于资源有限的小型组织。通过降低渗透测试的成本,该框架能够帮助这些组织更好地识别和修复安全漏洞,从而提升整体安全性。未来,该框架的设计理念也可扩展至其他领域的自动化测试和评估。
📄 摘要(原文)
AI-driven penetration testing has been demonstrated with premium frontier models such as GPT-4, but the per-engagement token cost makes continuous, automated testing unaffordable for the smaller organisations that need it most. This paper presents PentestChain, a ten-phase automated penetration testing framework that couples a curated, deterministic exploit map with a cost-aware AI cascade-a local Ollama model (qwen2.5-7b) first, then free-tier OpenRouter and Cerebras, with a rule-based fallback that always produces output-and exposes the full pipeline through a Model Context Protocol (MCP) server with eleven tools. We make three contributions. First, we treat US-dollar cost per engagement as a measured, first-class evaluation metric and show that a 7B-parameter local model, kept off the critical path by a deterministic backbone, sustains end-to-end operation at zero measured paid-API cost. Second, we analyse the attack surface that an MCP-exposed offensive engine introduces, grounding a four-position threat model in the 2025 MCP incident record (the CVE-2025-6514 remote-code-execution flaw in mcp-remote, the postmark-mcp supply-chain backdoor, and the tool-poisoning-rug-pull-line-jumping class), and contribute four mitigations. Third, we specify a reproducible, containerised evalua-tion protocol aligned with the standardised testbeds now expected at top-tier venues-AutoPenBench, a Cybench subset, and the PentestGPT 182-sub-task benchmark-with multi-trial statistics (more than 10 trials per configuration, pass-at-k, non-parametric significance tests and effect sizes) and direct, same testbed reproduction of the PentestGPT and PentestAgent baselines rather than citation of their published numbers. On the legacy targets measured to date, the framework detected 26 services, enriched 34 CVEs, produced