PenTest2.0: Towards Autonomous Privilege Escalation Using GenAI
Haitham S. Al-Sinani, Chris J. Mitchell · 2025
Read PenTest2.0: Towards Autonomous Privilege Escalation Using GenAI by Haitham S. Al-Sinani, Chris J. Mitchell (2025) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2507-06742.txt.
Introduction
Ethical hackers earn their keep by chaining commands on a target system, slow work that resists scaling. Haitham Al-Sinani and Chris Mitchell upgrade their earlier AI assisted toolkit in 2025 into PenTest2.0, which hands the hardest step, privilege escalation, to a language model's reasoning across many turns. Retrieval help, chain of thought prompting, persistent task trees, and optional human hints round out the design.
On a controlled Linux target the system escalated privileges adaptively, turn by turn. Testing and cost figures accompany the prototype. The authors are frank about failure modes: prompt shape, context, and drifting meaning can all derail the agent. Autonomous testing, they conclude, is arriving unevenly, and the guardrails research must keep pace.
Catalog record
| CREATOR | Haitham S. Al-Sinani, Chris J. Mitchell |
|---|---|
| YEAR | 2025 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 82 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2507-06742
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
PenTest2.0: Towards Autonomous Privilege Escalation Using GenAI Haitham S. Al-Sinani, Chris J. Mitchell Abstract Ethical hacking today relies on highly skilled practitioners executing complex sequences of commands, which is inherently time-consuming, difficult to scale, and prone to human error. To help mitigate these limitations, we previously introduced PenTest++ , an AI-augmented system combining automation with generative AI supporting ethical hacking workflows. However, a key limitation of PenTest++ was its lack of support for privilege escalation , a crucial element of ethical hacking. In this paper we present PenTest2.0 , a substantial evolution of PenTest++ supporting automated privilege escalation driven entirely by Large Language Model reasoning. It also incorporates several significant enhancements: Retrieval-Augmented Generation , including both one-line and offline modes; Chain-of-Thought prompting for intermediate reasoning; persistent PenTest Task Trees to track goal progression across turns; and the optional integration of human-authored hints. We describe how it operates, present a proof-of-concept prototype, and discuss its benefits and limitations. We also describe application of the system to a controlled Linux target, showing it can carry out multi-turn, adaptive privilege escalation. We explain the rationale behind its core design choices, and provide comprehensive testing results and cost analysis. Our findings indicate that PenTest2.0 represents a meaningful step toward practical, scalable, AI-automated penetration testing, whilst highlighting the shortcomings of generative AI systems, particularly their sensitivity to prompt structure, execution context, and semantic drift — reinforcing the need for further research and refinement in this emerging space. 1 Introduction Penetration testing [ 16 ] (PenTesting) is a cornerstone of modern cybersecurity practice, enabling organisations to identify and remediate vulnerabilities before they are exploited by malicious actors. Yet, despite its critical importance, the process of ethical hacking remains heavily reliant on individual expertise. Professionals must craft and execute complex chains of commands, interpret system feedback, and iteratively adapt their tactics — all under time constraints and with potential for error. These challenges make PenTesting inherently labour-intensive, costly, and difficult to scale. To address some of these limitations, we previously introduced PenTest++ [ 3 ] , an AI-augmented tool that leverages GenAI to assist in automating core PenTesting activities such as reconnaissance, scanning, enumeration, exploitation, and documentation, while preserving user control and adaptability. By embedding generative AI (GenAI) into the ethical hacking workflow, PenTest++ successfully reduced cognitive load and enabled context-aware suggestions. However, it lacked support for one of the most technically demanding and critical phases in the PenTesting lifecycle: privilege escalation PrivEsc. This phase involves exploiting misconfigurations or software vulnerabilities to elevate a compromised user account’s privileges — typically from a low-privileged user to administrative or root-level access. PrivEsc is essential for expanding access, simulating realistic attack scenarios, and achieving full control over the target system. Without it, the scope and effectiveness of any automated PenTesting system remain inherently constrained. Furthermore, PenTest++ did not incorporate reasoning and tracking capabilities such as Retrieval-Augmented Generation (RAG), Chain-of-Thought (CoT) prompting, PenTest Task Trees (PTTs), or user-injected hints. To address these limitations, and in addition to enabling automated PrivEsc, we present PenTest2.0 — a significantly enhanced version of our earlier system. PenTest2.0 introduces several architectural and functional improvements aimed at deepening reasoning, improving traceability, and increasing autonomy. These include support for RAG in both online and offline modes; CoT prompting to facilitate intermediate reasoning steps; PTTs as a persistent task structure for managing goals and subtasks across reasoning turns 1 1 1 For the purposes of this paper a ‘turn’ is one automatically-executed prompt–response exchange between PenTest2.0 and the LLM. ; and the integration of optional human-authored hints to guide the Large Language Model (LLM) behaviour where necessary. The system also logs executed commands, token usage, cost estimates, reasoning outputs, and failure diagnostics to enable detailed post-run analysis and system introspection. We evaluated PenTest2.0 on a controlled Linux testbed using an assumed-breach scenario, a common and well-established setup in PenTesting research [ 10 ] . Our results show that PenTest2.0 marks a meaningful advancement toward scalable, realistic, and agentic AI-driven PenTesting. At the same time, the evaluation also surfaces key limitations — such as sensitivity to prompt formulation and command execution fragility — which highlight the need for continued research and refinement in this emerging domain. The remainder of this paper is structured as follows. Section 2 defines the research questions and outlines the key contributions of this work. Section 3 reviews recent advances, including CoT, RAG, and PTT, which inform our approach. Section 4 describes how PenTest2.0 operates, while Section 5 explains the rationale behind the core system design choices. Section 6 provides details of the prototype implementation. Sections 7 and 8 report the testing results and cost analysis, respectively. Section 9 discusses the broader implications, potential risks, and limitations of the study. Section 10 surveys related literature. Finally, Section 11 concludes the paper and outlines directions for future research. 2 Research Questions and Contributions In this work, we build upon our previously proposed system, PenTest++ , by addressing one of its most critical limitations: the lack of support for automated PrivEsc. In extending the system to handle this key PenTesting phase, several new technical and conceptual challenges arise — particularly around multi-turn LLM reasoning, execution reliability, and system autonomy. Accordingly, our research is guided by the following central questions: • RQ1: To what extent can GenAI systems autonomously perform PrivEsc in a post-exploitation scenario under human supervision? • RQ2: How can the integration of techniques such as RAG, CoT prompting, PTTs, and optional human hints improve the effectiveness, reasoning depth, and traceability of GenAI-driven PenTesting? • RQ3: What practical limitations arise when applying LLMs to live, command-executing PrivEsc tasks in real-world-like environments, and how do these limitations manifest during execution? To explore these questions, we present the design, implementation, and evaluation of PenTest2.0 , a significantly enhanced improvement to our earlier system. The key contributions of this paper are as follows. • C1: We demonstrate the feasibility of automating the PrivEsc phase of the ethical hacking process through an AI-augmented tool, while putting the user in control for safety and ethical reasons. • C2: We introduce a GenAI-powered, automated proof-of-concept prototype for PrivEsc, enabling the system to iteratively reason, generate, execute, and adapt commands in a live post-exploitation setting — with the full intention of making it open source on GitHub. • C3: We integrate a suite of optional, advanced features — including RAG, CoT, PTTs, and a lightweight hint mechanism — to support deeper reasoning, traceable execution, and adaptive task management across multiple LLM turns. • C4: We conduct a comprehensive experimental evaluation on a realistic Linux target machine, demonstrating the tool’s ability to autonomously perform PrivEsc with minimal human oversight, while systematically capturing failure modes and runtime behaviour. • C5: We offer a balanced and critical analysis of PenTest2.0 ’s capabilities and limitations, identifying open challenges and proposing concrete avenues for future research aimed at advancing agentic, ethical, and dependable GenAI-assisted PenTesting. 3 Background This section outlines the core prompting strategies and optional enhancements underpinning PenTest2.0 , divided into five components: the base prompt, CoT reasoning, Human Hint injection, RAG, and PTT-based task tracking. 3.1 Base Prompt: Setting the Rules of Engagement The base prompt defines the operating context, rules of engagement, and input/output structure for