Mind the Gap: towards generalizable autonomous penetration testing via domain randomization and meta-reinforcement learning

Shicheng ZHOU , Jingju LIU , Yuliang LU , Jiahai YANG , Yue ZHANG , Jie CHEN

Eng Inform Technol Electron Eng ›› 2025, Vol. 26 ›› Issue (12) : 2511 -2528.

PDF (638KB)
Eng Inform Technol Electron Eng ›› 2025, Vol. 26 ›› Issue (12) :2511 -2528. DOI: 10.1631/FITEE.2500100
Research Article

Mind the Gap: towards generalizable autonomous penetration testing via domain randomization and meta-reinforcement learning

Author information +
History +
PDF (638KB)

Abstract

With the increasing number of vulnerabilities exposed on the Internet, autonomous penetration testing (pentesting) has emerged as a promising research area. Reinforcement learning (RL) is a natural fit for studying this topic. However, two key challenges limit the applicability of RL-based autonomous pentesting in real-world scenarios: the training environment dilemma—training agents in simulated environments is sample-efficient while ensuring that their realism remains challenging; poor generalization ability—agents' policies often perform poorly when transferred to unseen scenarios, with even slight changes potentially causing a significant generalization gap. To address both challenges, we propose a generalizable autonomous pentesting framework termed GAP, which aims to achieve efficient policy training in realistic environments and train generalizable agents capable of drawing inferences about other cases from one instance. GAP introduces a real-to-sim-to-real pipeline that enables end-to-end policy learning in unknown real environments while constructing realistic simulations and improves agents' generalization ability by leveraging domain randomization and meta-RL learning. We are among the first to apply domain randomization in autonomous pentesting and propose a large language model-powered domain randomization method for synthetic environment generation. We further apply meta-RL to improve agents' generalization ability in unseen environments by leveraging synthetic environments. Combining the two methods effectively bridges the generalization gap and improves agents' policy adaptation performance. Simulations are conducted on various vulnerable virtual machines, with results showing that GAP can enable policy learning in various realistic environments, achieve zero-shot policy transfer in similar environments, and achieve rapid policy adaptation in dissimilar environments.

Keywords

Cybersecurity / Penetration testing / Reinforcement learning / Domain randomization / Meta-reinforcement learning / Large language model

Cite this article

Download citation ▾
Shicheng ZHOU, Jingju LIU, Yuliang LU, Jiahai YANG, Yue ZHANG, Jie CHEN. Mind the Gap: towards generalizable autonomous penetration testing via domain randomization and meta-reinforcement learning. Eng Inform Technol Electron Eng, 2025, 26(12): 2511-2528 DOI:10.1631/FITEE.2500100

登录浏览全文

4963

注册一个新账户 忘记密码

References

RIGHTS & PERMISSIONS

Zhejiang University Press

AI Summary AI Mindmap
PDF (638KB)

39

Accesses

0

Citation

Detail

Sections
Recommended

AI思维导图

/