To address the issues of insufficient automation and program coverage in existing programmable logic controller (PLC) protocol fuzz testing, a black-box fuzz testing method is proposed. Firstly, the characteristics of PLC protocol, which are characterized by a “request-response” pattern with function code as the core, are analyzed to demonstrate its adaptability to niche genetic algorithms. Secondly, a method of dividing niches based on function codes and an evolution strategy of “subpopulation selection and full population evolution” are proposed to improve the niche genetic algorithm. Then, a fitness calculation method combining individual similarity and the response status of the device under test is designed, aiming to automatically guide test cases to more comprehensively explore the program space. Experiments show that compared with Peach and the method using a simple genetic algorithm, the generated test cases trigger a higher proportion of abnormal responses and have stronger vulnerability discovery capabilities. Faults are triggered in three PLCs from Schneider, Mitsubishi, and General Electric (GE), and one undisclosed vulnerability is found.
在进化组织方面,文献[15]以造成异常的可疑漏洞点为核心,把个体聚类成不同子种群,分别探索程序的不同区域,然而初始异常点并不能反应程序中所有的潜在漏洞,因而会导致漏报。文献[16]根据适应度把种群分为高、低两个种群,高适应度种群保证了收敛速度,低适应度种群保留了个体的多样性,然而通过多样性提高程序覆盖率具有不确定性。文献[17]改进了选择算子。文献[18]用自适应随机测试算法(Adaptive Random Testing, ART)改进初始种群,增强了多样性。文献[19]把小生境遗传算法用于文件传输协议(File Transfer Protocol, FTP)模糊测试中,体现了多峰函数优化思想。其小生境采用自然划分的方法,没有特定的依据。这种方式初始阶段各子种群分布特征相同,适合在没有明确约束条件的情况下使用,不足是随机性强收敛时间较长。
YOOH, SHONT. Grammar-based adaptive fuzzing: evaluation on SCADA Modbus protocol[C]∥Proceedings of the 2016 IEEE International Conference on Smart Grid Communications. Piscataway, USA: IEEE, 2016:557-563.
KIMS, JO W, SHONT. A novel vulnerability analysis approach to generate fuzzing test case in Industrial Control systems[C]∥Proceedings of the 2016 IEEE Information Technology, Networking, Electronic and Automation Control Conference. Piscataway, USA: IEEE, 2016:566-570.
LINP Y, TIENC W, HUANGT C, et al. ICPFuzzer: proprietary communication protocol fuzzing by using machine learning and feedback strategies[J]. Cybersecur, 2021,4(1):No.28.
HOLLANDJ H. Adaption in natural and artificial systems[M]. Cambridge MA, USA: MIT Press,1975:1-10.
[13]
蒋昀昕.自适应小生境遗传算法的研究[D].淮安:安徽理工大学,2008:1-47.
[14]
SATYADASA, KRISHNAKUMARK. Genetic algorithm modules in MATLAB: design and implementation using software engineering practices[J]. Genetic Algorithms in Engineering and Computer Science,1995,12(9):321-344.