Abstract
Automated web vulnerability scanning often lacks the nuanced reasoning required for complex, multi-step exploits. This paper introduces the Agent Web Model (AWM), a formal framework that decomposes web hacking into seven hierarchical layers of abstraction. By framing ethical hacking as a reinforcement learning (RL) problem within a standardized Markov Decision Process (MDP), the AWM provides a structured environment for training autonomous agents. Initial experiments using an Actor-Critic agent demonstrate the feasibility of this approach for lower-level navigation and parameter handling, while highlighting the significant complexity challenges inherent in higher-level exploitation.
Introduction
The landscape of cybersecurity is increasingly defined by the arms race between automated defense and sophisticated manual attack. While tools like Nessus or Burp Suite are indispensable for identifying known signatures, they are often "brittle," failing to replicate the creative, multi-stage logical leaps of a human penetration tester. Bridging this gap requires moving beyond static scanners toward autonomous agents capable of reasoning through complex environments.
However, applying modern Artificial Intelligence—specifically Reinforcement Learning (RL)—to web hacking has been hindered by the lack of standardized environments. Unlike games like Go or Chess, hacking does not have a naturally defined state-action space that fits the Markov Decision Process (MDP) required by RL algorithms. The researchers behind the Agent Web Model (AWM) address this by formalizing the "art" of hacking into a structured, measurable hierarchy.
The Agent Web Model (AWM)
The core contribution of this work is the AWM, which breaks down web exploitation into seven distinct layers of increasing complexity. This modular approach allows researchers to isolate specific skills and train agents in a curriculum-based fashion.
The layers are defined as follows:
- Link Layer: Navigating explicit links between static HTML files.
- Hidden Link Layer: Identifying "implicit" links, such as those found in code comments or common directory naming conventions.
- Dynamic Content Layer: Interacting with server-side scripts that require a single input parameter.
- Web Method Layer: Distinguishing between GET and POST requests and managing multiple parameters simultaneously.
- HTTP Header Layer: Handling session management, cookies, and interpreting various HTTP status codes (e.g., 200 OK, 404 Not Found, 500 Internal Server Error).
- Server Structure Layer: Moving beyond the webroot to interact with the underlying system, including Local File Inclusion (LFI) and SQL Injection (SQLi).
- Server Modification Layer: The ultimate goal of an exploit, where agents can create, delete, or modify files, achieving Remote Code Execution (RCE).
Methodology and Experimental Setup
To test the viability of the AWM, the authors implemented the first three layers using the OpenAI Gym interface. This allows standard RL algorithms to interact with a simulated web server as if it were a game environment.
A key innovation in this study is the move away from static datasets. Instead, the authors developed a generative environment. By defining adjacency matrices for files and parameters, the system can procedurally generate an infinite variety of Capture The Flag (CTF) style challenges. This ensures that agents learn generalized exploitation strategies rather than simply memorizing the map of a specific target site.
The researchers evaluated this environment using a Synchronous Advantage Actor-Critic (A2C) agent, a standard RL algorithm that combines policy-based and value-based learning.
Key Insights: The Complexity Cliff
The transition between layers reveals a "complexity cliff." While Level 1 (Link Layer) requires an agent to choose from a finite set of $N$ files, Level 3 (Dynamic Content) introduces an exponential explosion of possible actions. The combination of file paths, parameter names, and potential parameter values creates a state space that is significantly harder to navigate.
Furthermore, the AWM acts as a "Rosetta Stone" for cybersecurity. By mapping classic vulnerabilities—such as Cross-Site Scripting (XSS), SQLi, and Cross-Site Request Forgery (CSRF)—to specific layers, the model provides a roadmap for what an agent must master to handle real-world threats. For example, an agent proficient at Level 5 (HTTP Header Layer) is theoretically equipped to handle session-hijacking attacks.
Results and Discussion
The validation of the AWM yielded promising, albeit sobering, results:
- Levels 1 & 2: The A2C agents successfully converged on optimal policies, demonstrating that basic site navigation and hidden link discovery are well within the capabilities of current RL.
- Level 3: While the agent showed a positive learning trajectory, it struggled to reach an optimal solution. The reward increased over time, but the sheer size of the parameter-based state space proved challenging for an off-the-shelf A2C agent.
These results confirm that while web hacking can be modeled for RL, moving from "toy" problems to sophisticated exploitation will require more than just standard algorithms.
Conclusion and Future Work
The Agent Web Model provides a much-needed formal foundation for the development of autonomous ethical hacking agents. While the current study only implemented the first three layers, it sets the stage for future research into hierarchical RL and curriculum learning, where agents can be trained to master simple navigation before tackling database injection or remote code execution.
The authors acknowledge the ethical "dual-use" risk: the same technology that helps a company find bugs can be used by malicious actors to automate attacks. However, by standardizing the environment, the AWM empowers the white-hat community to develop more robust, proactive defenses against the next generation of automated threats.
Summary updated