Skip to main content
QUICK REVIEW

[论文解读] PentestGPT: An LLM-empowered Automatic Penetration Testing Tool

Gelei Deng, Yi Liu|arXiv (Cornell University)|Aug 13, 2023
Software Engineering ResearchComputer Science被引用 30
一句话总结

该论文在现实世界的渗透测试任务上评估了大模型(LLMs),并引入了一个新的基准和 PentestGPT——一个由大模型驱动的自动化渗透测试系统,采用三方架构以提高任务完成率并减少上下文丢失。

ABSTRACT

Penetration testing, a crucial industrial practice for ensuring system security, has traditionally resisted automation due to the extensive expertise required by human professionals. Large Language Models (LLMs) have shown significant advancements in various domains, and their emergent abilities suggest their potential to revolutionize industries. In this research, we evaluate the performance of LLMs on real-world penetration testing tasks using a robust benchmark created from test machines with platforms. Our findings reveal that while LLMs demonstrate proficiency in specific sub-tasks within the penetration testing process, such as using testing tools, interpreting outputs, and proposing subsequent actions, they also encounter difficulties maintaining an integrated understanding of the overall testing scenario. In response to these insights, we introduce PentestGPT, an LLM-empowered automatic penetration testing tool that leverages the abundant domain knowledge inherent in LLMs. PentestGPT is meticulously designed with three self-interacting modules, each addressing individual sub-tasks of penetration testing, to mitigate the challenges related to context loss. Our evaluation shows that PentestGPT not only outperforms LLMs with a task-completion increase of 228.6\% compared to the \gptthree model among the benchmark targets but also proves effective in tackling real-world penetration testing challenges. Having been open-sourced on GitHub, PentestGPT has garnered over 4,700 stars and fostered active community engagement, attesting to its value and impact in both the academic and industrial spheres.

研究动机与目标

  • 通过大模型提升自动化渗透测试,减少对领域专门知识的依赖。
  • 创建一个稳健、真实世界的基准,用于评估对不同目标的渗透测试能力。
  • 开发一个整合系统(PentestGPT),引导大模型通过离散的测试状态和任务。

提出的方法

  • 从 HackTheBox 与 VulnHub 构建共计 182 个子任务的 13 个目标,研究梳理与 OWASP Top 10 漏洞相关。
  • 评估 GPT-3.5、GPT-4 与 Bard 在基准上的端到端与子任务表现。
  • 分析大模型行为,识别诸如上下文丢失、倾向于某些任务模式等局限性。
  • 提出带有三个自我交互模块的 PentestGPT,以维持上下文并引导任务执行。
  • 在 Kali Linux 环境中应用一个文本输出的对话循环,桥接 UI/命令驱动的操作与大模型输出。
Figure 2 : Overview of strategy to use LLMs for penetration testing.
Figure 2 : Overview of strategy to use LLMs for penetration testing.

实验结果

研究问题

  • RQ1RQ1: 在所提出的基准上,大模型在渗透测试任务中的表现到什么程度?
  • RQ2RQ2: 人类测试者的解决问题策略与大模型在渗透测试中的策略有何差异?
  • RQ3RQ3: 哪些因素限制大模型在自动化渗透测试中的有效性(如上下文保留、记忆与命令准确性)?

主要发现

  • LLMs 能完成端到端的渗透测试任务,在评估的模型中,GPT-4表现最佳。
  • GPT-4 在简单目标中完成 4 个、在中等目标中完成 1 个端到端任务;Bard 与 GPT-3.5 在相同条件下完成的目标较少。
  • 在子任务方面,GPT-4 在简单目标中完成 77 项中的 52 项,在中等目标中完成 71 项中的 27 项,显示出在工具使用与代码相关任务上的强大能力。
  • LLMs 在维持长期上下文方面存在困难,常常遗忘先前的发现,偏向关注最近的任务(深度优先偏见)。
  • 常见失败原因包括会话上下文丢失、错误命令生成和死锁操作,导致结果不理想。
  • PentestGPT 的三分架构(Reasoning、Generation、Parsing)与渗透测试任务树(PTT)有助于减少上下文丢失并引导连贯的行动规划。
Figure 3 : Overview of PentestGPT .
Figure 3 : Overview of PentestGPT .

阅读本论文

在 Nubint 阅读器中打开原文,边读边就任意段落提问。

在 Nubint 中阅读本论文

本解读由 AI 根据论文原文生成,引用前请核对原文。