Abstract
Penetration testing (PT) is a critical method for assessing network security by simulating cyberattacks to identify vulnerabilities. While reinforcement learning has been applied to automate PT, modeling it as a Markov decision process often leads to state-space complexity and dimensional explosion. To address these problems, we propose the Hierarchical Advantage Memory-enhanced Deep Q-Network (HAML-DQN) algorithm, an intelligent PT framework that integrates hierarchical reinforcement learning (HRL) with memory enhancement and action masking (AM) mechanisms. The HRL architecture decomposes PT tasks into high-level host selection and low-level attack execution, effectively mitigating the curse of dimensionality in state and action spaces. The memory-enhanced module stores high-reward action sequences to guide exploration, while the AM mechanism filters out redundant or illogical actions, thus imitating expert decision making. Our contributions include: (i) designing an HRL framework for PT, (ii) improved memory-enhanced exploration strategy, and (iii) proposed an action masking (AM) mechanism for efficient path planning. The results highlight the potential of HAML-DQN to advance automated PT and enhance cybersecurity defenses. Experiments conducted on the Network Attack Simulator platform demonstrate that the HAML-DQN method significantly enhances PT efficiency and exhibits strong scalability in large-scale networks, increasing the applicable network scale by nearly 20 times compared with the baseline DQN algorithm.
Funding Information
  • Natural Science Foundation of Hainan Province (242300421415)

This publication has 30 references indexed in Scilit: