打造轻量级渗透测试实验框架,方便对比不同智能体表现。
Cochise: A Reference Harness for Autonomous Penetration Testing

- 基于SSH连接靶机,采用规划-执行架构实现自主渗透。
- 在GOAD测试平台上成功完成多轮攻击,支持离线回放与分析。
- 提供可复现的实验环境和日志数据,适合安全研究者使用。
近期基于大模型的自主渗透测试取得进展,但现有系统常将架构、提示工程与工具集成混杂在一起,难以区分改进来自何处。本文提出Cochise,一个仅630行代码的Python参考实现,通过SSH连接Linux执行主机,支持对跳板机可达的受控靶场进行攻击。原型采用规划-执行架构:规划器维护长期状态,执行器以ReAct风格发送SSH命令并根据输出自修正。场景提示可适配不同目标环境。在第三方活体测试平台Game of Active Directory(GOAD)上评估了该框架。Cochise并非最先进的渗透测试智能体,而是用于比较模型、智能体架构与渗透轨迹的可复用实验基础设施。随附工具包括:(i) cochise-replay用于离线可视化运行过程,(ii) cochise-analyze-logs与cochise-analyze-graphs用于成本、令牌消耗、持续时间及攻陷情况分析,(iii) 一套来自GOAD运行的JSON轨迹日志语料库,使研究人员无需自行部署需48–64 GB内存/190 GB存储的测试环境即可研究智能体行为。演示视频见https://youtu.be/2mQimB1ufyI。
原文摘要 · Abstract (English)
Recent work on LLM-driven autonomous penetration testing reports promising results, but existing systems often bundle architectural, prompting, and tool-integration choices together. This makes it difficult to determine what is gained over a simple agent and harness. We present Cochise, a 630 LOC Python reference implementation for autonomous penetration-testing experiments. Cochise connects to a Linux execution host over SSH and supports attacking controlled target environments reachable from that jump host. The prototype implements a Planner--Executor architecture in which long-term state is maintained by the planner, while a ReAct-style executor issues commands over SSH and self-corrects based on command outputs. The scenario prompt can be adapted to different target environments. We evaluate the harness against a live third-party testbed, Game of Active Directory (GOAD). Cochise is intended not as a state-of-the-art penetration-testing agent, but as a reusable experimental infrastructure for comparing models, agent architectures, and penetration-testing traces. Alongside the prototype, we release replay and analysis tools: (i) cochise-replay for offline visualization of captured runs, (ii) cochise-analyze-logs and cochise-analyze-graphs for cost, token, duration, and compromise analysis, and (iii) a corpus of JSON trajectory logs from GOAD runs, so that researchers can study agent behavior without provisioning the 48--64 GB RAM / 190 GB storage testbed themselves. Tool demo video available at https://youtu.be/2mQimB1ufyI.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。