Current frameworks for training offensive penetration testing agents with deep reinforcement learning struggle to produce agents that perform well in real-world scenarios, due to the reality gap in simulation-based frameworks and the lack of scalability in emulation-based frameworks. Additionally, existing frameworks often use an unrealistic metric that measures the agents' performance on the training data. NASimEmu, a new framework introduced in this paper, addresses these issues by providing both a simulator and an emulator with a shared interface. This approach allows agents to be trained in simulation and deployed in the emulator, thus verifying the realism of the used abstraction. Our framework promotes the development of general agents that can transfer to novel scenarios unseen during their training. For the simulation part, we adopt an existing simulator NASim and enhance its realism. The emulator is implemented with industry-level tools, such as Vagrant, VirtualBox, and Metasploit. Experiments demonstrate that a simulation-trained agent can be deployed in emulation, and we show how to use the framework to train a general agent that transfers into novel, structurally different scenarios. NASimEmu is available as open-source.
翻译:当前用于深度强化学习训练进攻性渗透测试智能体的框架,因基于模拟框架中的现实差距和基于仿真框架的可扩展性不足,难以产生在真实场景中表现良好的智能体。此外,现有框架常采用衡量智能体在训练数据上性能的非现实指标。本文提出的新框架NASimEmu通过提供共享接口的模拟器与仿真器解决了这些问题。该方法允许智能体在模拟环境中训练并部署至仿真器,从而验证所用抽象模型的现实性。本框架促进开发能够迁移到训练阶段未见的新场景的通用智能体。在模拟部分,我们采用现有模拟器NASim并增强其现实性;仿真器则采用Vagrant、VirtualBox和Metasploit等行业级工具实现。实验表明,经模拟训练的智能体可部署于仿真环境,并展示了如何利用该框架训练能够迁移至结构迥异新场景的通用智能体。NASimEmu已作为开源项目发布。