# A Survey on Penetration Path Planning in Automated Penetration Testing
## 5 Planning Methods in Penetration Path Planning
### Large Language Models  
LLMs have marked a significant milestone in the AI domain, with the GPT family of large pre-trained models being particularly noteworthy. Through extensive data training, LLMs have achieved remarkable success across various dimensions of language understanding, generation, and inference planning [130].  
Recent studies have demonstrated that LLMs possess impressive proficiency in cybersecurity knowledge and tasks. [PERSON] et al. [131] evaluated the performance of three prominent LLMs--ChatGPT, [PERSON], and [PERSON]--by testing their ability to answer Cisco certification questions and solve CTF challenges. Their findings indicate that ChatGPT exhibited a high level of precision, correctly responding to 82% of the professional queries. Additionally, ChatGPT successfully resolved six out of seven CTF challenge scenarios, underscoring its robust capabilities and potential applications in cybersecurity. [PERSON] et al. [132] indicated that upon receiving CVE descriptions, GPT-4 was able to exploit 87% of the listed vulnerabilities. In contrast, all other models (including GPT-3.5 and open-source LLMs) and open-source vulnerability scanners (such as ZAP and Metasploit) had a 0% success rate.  
LLMs' extensive domain knowledge enables them to emulate penetration testers for planning penetration paths. [PERSON] [133] outlined a framework for penetration path planning using an LLM. The framework is divided into two layers, where the upper layer is responsible for method-level task planning and the lower layer gives specific attack operations based on the upper layer planning. [PERSON] et al. [134] further advanced this framework with PentestGPT, an LLM-based tool that integrates reasoning, generation, and parsing modules. PentestGPT effectively navigates the testing process and ethical constraints, achieving a task completion rate double that of GPT-3.5. The structure of this framework is detailed in Figure 5.  
Although LLMs can demonstrate reasoning abilities through targeted prompts, they may struggle with complex tasks that necessitate multi-step thinking and decision-making. Additionally, LLMs can sometimes generate outputs, referred to as \"hallucinations\", that do not align with or relate to the actual context. To bolster the planning capabilities of LLMs, several studies have introduced frameworks that employ multi-stage prompting, such as ReAct [135], Reflexion [136], and DEPS [137]. The essence of these frameworks is to facilitate guided reasoning and introspection in LLMs through a series of prompts. These prompts may encompass describing the situation, elucidating possible actions, strategizing action steps, and choosing the optimal course of action, thereby enhancing the LLMs' capacity to plan in intricate tasks. [PERSON] et al. [104] proposed a ReAct Agent for penetration planning that operates within a simulation environment and requires no additional training.  
Furthermore, several studies have delved into the integration of external planning methodologies with LLMs, exploring avenues to enhance planning capabilities. [PERSON] et al. [138] devised the LLM + P framework, ingeniously combining the prowess of traditional planning algorithms with LLMs. This framework entails transforming task narratives into PDDL, leveraging a planner to swiftly generate solutions, and subsequently reverting these solutions into natural language. [PERSON] et al. [139] introduced LLM Dynamic Planner, using LLMs to translate observations and states into PDDL for accurate planning problem representation, generating sequences with an external planner. These studies are expected to provide new ideas for penetration path planning.