RefPentester: A Knowledge-Informed Self-Reflective Penetration Testing Framework Based on Large Language Models

📄 arXiv: 2505.07089v3 📥 PDF

作者: Hanzheng Dai, Yuanliang Li, Jun Yan, Zhibo Zhang

分类: cs.AI

发布日期: 2025-05-11 (更新: 2025-06-25)


💡 一句话要点

提出RefPentester以解决自动渗透测试中的知识不足问题

🎯 匹配领域: 支柱四:生成式动作 (Generative Motion) 支柱九:具身大模型 (Embodied Foundation Models)

关键词: 自动渗透测试 大语言模型 知识驱动 自反机制 信息安全 渗透测试框架 机器学习

📋 核心要点

  1. 现有的LLM基础自动渗透测试框架在复杂任务中表现不佳,主要由于知识不平衡和缺乏学习机制。
  2. 本文提出RefPentester框架,通过知识驱动和自反机制来提升渗透测试的有效性和适应性。
  3. 实验结果显示,RefPentester在渗透测试阶段转换中表现优异,成功率显著高于基线模型。

📝 摘要(中文)

基于大语言模型(LLMs)的自动渗透测试(AutoPT)因其自动化伦理黑客过程和识别目标系统漏洞的能力而受到关注。然而,现有的LLM基础AutoPT框架在复杂任务中往往表现不佳,原因包括训练知识不平衡、规划过程短视以及命令生成中的幻觉。此外,现有框架缺乏从失败中学习的机制,限制了渗透测试策略的自适应改进。为了解决这些问题,本文提出了一种知识驱动的自反渗透测试框架RefPentester,旨在帮助人类操作员识别渗透测试过程的当前阶段,选择适当的战术和技术,提供逐步操作指导,并反思和学习之前失败的操作。评估结果表明,RefPentester在Hack The Box的Sau机器上成功揭示凭证,超越基线GPT-4o模型16.7%。

🔬 方法详解

问题定义:本文旨在解决现有自动渗透测试框架在复杂任务中的不足,包括知识不平衡、短视规划和缺乏自适应学习机制等痛点。

核心思路:RefPentester框架通过知识驱动和自反机制,帮助操作员在渗透测试过程中识别阶段、选择战术和技术,并从失败中学习,以提升渗透测试的有效性。

技术框架:该框架将渗透测试过程建模为七状态的阶段机,主要模块包括阶段识别、战术选择、操作指导和反思学习等。

关键创新:RefPentester的核心创新在于其自反机制,能够在渗透测试过程中实时学习和调整策略,显著提升了适应性和成功率。

关键设计:框架设计中考虑了多种参数设置和损失函数,确保模型在不同渗透测试阶段的有效性,具体细节包括阶段机的状态转移和知识整合机制。

📊 实验亮点

实验结果表明,RefPentester在Hack The Box的Sau机器上成功揭示凭证,超越基线GPT-4o模型16.7%。此外,在渗透测试阶段转换中,RefPentester的成功率也显著高于其他现有框架,展示了其优越的性能。

🎯 应用场景

RefPentester框架具有广泛的应用潜力,尤其在信息安全领域的渗透测试中,可以帮助安全专家更高效地识别和修复系统漏洞。未来,该框架还可扩展至其他领域,如网络安全培训和自动化安全评估,提升整体安全防护能力。

📄 摘要(原文)

Automated penetration testing (AutoPT) powered by large language models (LLMs) has gained attention for its ability to automate ethical hacking processes and identify vulnerabilities in target systems by leveraging the inherent knowledge of LLMs. However, existing LLM-based AutoPT frameworks often underperform compared to human experts in challenging tasks for several reasons: the imbalanced knowledge used in LLM training, short-sightedness in the planning process, and hallucinations during command generation. Moreover, the trial-and-error nature of the PT process is constrained by existing frameworks lacking mechanisms to learn from previous failures, restricting adaptive improvement of PT strategies. To address these limitations, we propose a knowledge-informed, self-reflective PT framework powered by LLMs, called RefPentester. This AutoPT framework is designed to assist human operators in identifying the current stage of the PT process, selecting appropriate tactics and techniques for each stage, choosing suggested actions, providing step-by-step operational guidance, and reflecting on and learning from previous failed operations. We also modeled the PT process as a seven-state Stage Machine to integrate the proposed framework effectively. The evaluation shows that RefPentester can successfully reveal credentials on Hack The Box's Sau machine, outperforming the baseline GPT-4o model by 16.7%. Across PT stages, RefPentester also demonstrates superior success rates on PT stage transitions.