PentestAgent: Incorporating LLM Agents to Automated Penetration Testing
About
Penetration testing is a critical technique for identifying security vulnerabilities, traditionally performed manually by skilled security specialists. This complex process involves gathering information about the target system, identifying entry points, exploiting the system, and reporting findings. Despite its effectiveness, manual penetration testing is time-consuming and expensive, often requiring significant expertise and resources that many organizations cannot afford. While automated penetration testing methods have been proposed, they often fall short in real-world applications due to limitations in flexibility, adaptability, and implementation. Recent advancements in large language models (LLMs) offer new opportunities for enhancing penetration testing through increased intelligence and automation. However, current LLM-based approaches still face significant challenges, including limited penetration testing knowledge and a lack of comprehensive automation capabilities. To address these gaps, we propose PentestAgent, a novel LLM-based automated penetration testing framework that leverages the power of LLMs and various LLM-based techniques like Retrieval Augmented Generation (RAG) to enhance penetration testing knowledge and automate various tasks. Our framework leverages multi-agent collaboration to automate intelligence gathering, vulnerability analysis, and exploitation stages, reducing manual intervention. We evaluate PentestAgent using a comprehensive benchmark, demonstrating superior performance in task completion and overall efficiency. This work significantly advances the practical applicability of automated penetration testing systems.
Related benchmarks
| Task | Dataset | Result | Rank | |
|---|---|---|---|---|
| Web security task completion | XBOW 104 tasks | Task Completion Rate61 | 32 | |
| End-to-end penetration testing | PentestGPT Ben 13 machines | Machines Rooted9 | 30 | |
| Active Directory domain escalation | GOAD 5 hosts | Domain Escalation Success Rate40 | 30 | |
| Automated Exploit Generation | Penetration Testing Benchmark (test) | ASR (SI)46 | 28 | |
| Exploit Generation | Automated Exploit Generation Benchmark | SI Score2 | 9 | |
| Automated Penetration Testing | Vulhub | Success Rate50 | 6 | |
| Automated Penetration Testing | XBOW Level 2 (Medium) | Solved Count9 | 4 | |
| Automated Penetration Testing | XBOW Level 3 (Hard) | Solved Count1 | 4 | |
| Automated Penetration Testing | XBOW (Overall) | Solved Count25 | 4 | |
| Automated Penetration Testing | XBOW Level 1 (Easy) | Solved Count15 | 4 |