In recent years, as botnet evolves, the security threat it brings is getting more and more serious. Therefore, it becomes the research emphasis at home and abroad. Botnet emulation is the foundation of in-depth study on botnet, as well as the focus of current research. This paper presents a botnet emulation approach based on testbed, which uses extensible language to customize and describe the emulation scenarios. On this basis, the botnet emulation system implements customizable emulation scenarios, automatically deployable emulation environments, controllable emulation procedures and other emulation functions through the key techniques and modules such as packaging and auto-configuration of emulation scenarios, and data collection and presentation. Finally, some experiments targeting typical scenarios are performed to verify the effectiveness of the system and to evaluate the efficiencies of functionalities including automatic deployment of emulation scenarios.