Towards Automated Penetration Testing: Introducing LLM Benchmark, Analysis, and Improvements
Isamu Isozaki, Manil Shrestha, Rick Console, Edward Kim
TL;DR
The paper tackles the escalating threat of cybercrime by proposing an open benchmark for evaluating LLM-based automated penetration testing. It assesses two leading LLMs (GPT-4o and Llama3.1-405B) within the PentestGPT framework on Vulnhub-based tasks, revealing end-to-end automation remains unattained but identifying concrete areas for improvement. Through three cumulative ablations—Inject Summary, Structured Generation, and Retrieval Augmented Generation—it demonstrates that augmenting context and task management can yield measurable gains, with RAG offering the strongest overall benefit. The work provides a standardized evaluation protocol and actionable insights for advancing AI-assisted cybersecurity, while also highlighting risks and limitations that motivate future reinforcement learning and self-play research.
Abstract
Hacking poses a significant threat to cybersecurity, inflicting billions of dollars in damages annually. To mitigate these risks, ethical hacking, or penetration testing, is employed to identify vulnerabilities in systems and networks. Recent advancements in large language models (LLMs) have shown potential across various domains, including cybersecurity. However, there is currently no comprehensive, open, automated, end-to-end penetration testing benchmark to drive progress and evaluate the capabilities of these models in security contexts. This paper introduces a novel open benchmark for LLM-based automated penetration testing, addressing this critical gap. We first evaluate the performance of LLMs, including GPT-4o and LLama 3.1-405B, using the state-of-the-art PentestGPT tool. Our findings reveal that while LLama 3.1 demonstrates an edge over GPT-4o, both models currently fall short of performing end-to-end penetration testing even with some minimal human assistance. Next, we advance the state-of-the-art and present ablation studies that provide insights into improving the PentestGPT tool. Our research illuminates the challenges LLMs face in each aspect of Pentesting, e.g. enumeration, exploitation, and privilege escalation. This work contributes to the growing body of knowledge on AI-assisted cybersecurity and lays the foundation for future research in automated penetration testing using large language models.
