用状态机提升大模型的自动化渗透测试能力,任务完成率翻倍。
AutoPT: How Far Are We from the End2End Automated Web Penetration Testing?
- 基于有限状态机设计代理,约束大模型行为
- 在真实环境中使任务完成率从22%提升至41%
- 适合安全研究者与自动化测试开发者
渗透测试对保障Web安全至关重要,可提前发现漏洞并防止数据泄露。大语言模型(LLMs)强大的推理能力为自动化渗透测试带来新可能。本文构建了一个基于真实环境的端到端渗透测试基准,评估基于LLM的智能体表现。结果表明,智能体虽熟悉测试流程,但在生成准确命令和执行完整过程方面仍受限,主要问题包括难以维持消息历史记录及易陷入僵局。为此,我们提出渗透测试状态机(PSM),结合有限状态机(FSM)方法解决上述挑战。进而设计了基于PSM的自动化渗透测试代理AutoPT,融合LLM推理能力与状态机约束机制。评估显示,AutoPT在GPT-4o mini模型上优于基线ReAct框架,任务完成率从22%提升至41%,同时显著降低时间和经济成本。该工作推动了自动化渗透测试发展,对学术界与产业界均有重要影响。
原文摘要 · Abstract (English)
Penetration testing is essential to ensure Web security, which can detect and fix vulnerabilities in advance, and prevent data leakage and serious consequences. The powerful inference capabilities of large language models (LLMs) have made significant progress in various fields, and the development potential of LLM-based agents can revolutionize the cybersecurity penetration testing industry. In this work, we establish a comprehensive end-to-end penetration testing benchmark using a real-world penetration testing environment to explore the capabilities of LLM-based agents in this domain. Our results reveal that the agents are familiar with the framework of penetration testing tasks, but they still face limitations in generating accurate commands and executing complete processes. Accordingly, we summarize the current challenges, including the difficulty of maintaining the entire message history and the tendency for the agent to become stuck. Based on the above insights, we propose a Penetration testing State Machine (PSM) that utilizes the Finite State Machine (FSM) methodology to address these limitations. Then, we introduce AutoPT, an automated penetration testing agent based on the principle of PSM driven by LLMs, which utilizes the inherent inference ability of LLM and the constraint framework of state machines. Our evaluation results show that AutoPT outperforms the baseline framework ReAct on the GPT-4o mini model and improves the task completion rate from 22% to 41% on the benchmark target. Compared with the baseline framework and manual work, AutoPT also reduces time and economic costs further. Hence, our AutoPT has facilitated the development of automated penetration testing and significantly impacted both academia and industry.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。