大语言模型驱动的网络协议逆向与安全测试方法
网络出版日期: 2026-02-03
基金资助
国家自然科学基金(T2425023, 62172025, U2241213);浙江省自然科学基金(LMS25F020013);北京市自然科学基金(4252019)
版权
Large language model-driven network protocol reverse engineering and security testing methods
Online published: 2026-02-03
Copyright
为系统地探索网络协议实现的输入和状态空间,并自动挖掘HTTP协议中的安全漏洞,提出了一种大语言模型驱动的网络协议逆向与安全测试(LPRT)方法。该方法主要针对网络设备的HTTP协议,通过构建以DeepSeek模型为核心的智能代理系统,对抓取的少量流量进行语义解析和协议报文格式推断;然后基于推断的协议格式生成模糊测试请求,发送至服务器并捕获响应;代理系统分析响应,迭代扩展协议输入和状态空间;在此基础上,系统自主生成易触发安全缺陷的测试用例,检测潜在安全漏洞。实验结果表明,该方法在仅有少量流量样本的HTTP协议场景下,能够探索协议中更多的请求类型与参数组合,并在家庭路由器上发现了10个安全漏洞,验证了大语言模型在网络协议安全测试中的有效性,为协议分析与漏洞挖掘提供了新的智能手段。
张东 , 詹一宸 , 白家驹 , 关振宇 . 大语言模型驱动的网络协议逆向与安全测试方法[J]. 网络空间安全科学学报, 2026 , 4(1) : 1 -12 . DOI: 10.20172/j.issn.2097-3136.251015
To systematically explore the input and state space of HTTP protocol implementations and automate vulnerability discovery, a large language model-driven network protocol reverse engineering security testing method (LPRT), was proposed. Targeting text-based protocols such as HTTP in network devices, the method built an intelligent agent system centered on the DeepSeek model. It semantically analyzed limited captured traffic to infer protocol message formats. Based on these inferred formats, the system generated test requests, sent them to the server, and captured responses. The agent iteratively analyzed the responses to expand the protocol’s input and state space. On this basis, it autonomously generated test cases likely to trigger security flaws and detected potential vulnerabilities. Experimental results showed that the method could explore a broader range of request types and parameter combinations, even with minimal traffic samples, and uncovered ten security vulnerabilities on network devices. These findings demonstrate the effectiveness of large language models in protocol security testing and provide a novel intelligent approach to protocol analysis and vulnerability discovery.
表 1 NetCore路由器交互示例Table 1 Interaction examples of Netcore routers |
| 请求方向 | 消息内容 |
| SEND | {"jsonrpc":"2.0","method":"call","params":["TOKEN","routerd","param_status",{"action":"get"}]} |
| RECV | {"jsonrpc":"2.0","id":null,"result":[0,{"initialized":1,"ExamFlag":false}]} |
表 2 对比工具Table 2 Comparison tools |
| 工具 | 初始操作 | 输入 | 时间 |
| Boofuzz | 手动编写测试脚本 | 10条样本 | 24 h |
| Snipuzz | 手动编写测试脚本 | 10条样本 | 24 h |
| Netzob | 手动编写测试脚本 | 10条样本 | 24 h |
| LLM-Netzob | LLM生成模板 | 10条样本 | 24 h |
表 3 各工具测试用例有效率Table 3 Test case validity rate of different tools |
| 网络设备 | Boofuzz | Snipuzz | Netzob | LLM-Netzob | LPRT |
| ToToLink A720R | 8.08% | 23.06% | 11.83% | 35.84% | 42.18% |
| ToToLink A3300R | 6.12% | 17.60% | 11.01% | 36.25% | 47.36% |
| ToToLink A3600R | 6.12% | 13.41% | 15.72% | 37.42% | 44.92% |
| NetCore POWER4S | 9.49% | 18.63% | 10.21% | 35.96% | 49.87% |
| NetCore POWER9S PRO | 7.32% | 16.38% | 11.18% | 37.13% | 53.11% |
| Linksys EA7500 V2 | 8.65% | 17.43% | 13.66% | 36.50% | 53.72% |
| 平均值 | 7.63% | 17.75% | 12.27% | 36.52% | 48.53% |
表 4 已发现的未公开漏洞Table 4 Unreported vulnerabilities revealed |
| 厂商 | 设备 | 固件版本 | LLM-Netzob | LPRT发现漏洞 |
| ToToLink | A720R | V4.1.5cu.630 | 1 | 4 |
| A3300R | V17.0.0cu.596_B20250515 | 0 | 1 | |
| A3600R | V5.9c.4959 | 2 | 4 | |
| NetCore | POWER4S | V3.0.4.59435 | 0 | 0 |
| POWER9S PRO | V1.0.0.221114.103550 | 0 | 1 |
表 5 CNVD编号信息Table 5 CNVD identification number |
| CNVD编号 | 漏洞类型 | 危害级别 |
| CNVD-2025-19011 | 信息泄露 | 中危 |
| CNVD-2025-19450 | 拒绝服务 | 高危 |
| CNVD-2025-19451 | 未授权访问 | 中危 |
| CNVD-2025-21915 | 代码执行 | 中危 |
| CNVD-2025-22880 | 未授权访问 | 高危 |
| 1 |
Fernandes E, Paupore J, Rahmati A, et al. A security analysis of emerging smart home applications[C]//IEEE Symposium on Security and Privacy (S&P). Piscataway, NJ: IEEE, 2016: 636-654.
|
| 2 |
Antonakakis M, April T, Bailey M, et al. Understanding the mirai botnet[C]//Proceedings of the 26th USENIX Security Symposium (USENIX Security 17). Berkeley, CA: USENIX Association, 2017: 1093-1110.
|
| 3 |
Kumar K, Bose J, Tripathi S. A unified web interface for the Internet of Things[C]//Proceedings of 2016 IEEE India Conference (INDICON). Piscataway, NJ: IEEE, 2016: 1-6.
|
| 4 |
Duchêne J, Le Guernic C, Alata E, et al. State of the art of network protocol reverse engineering tools[J]. Journal of Computer Virology and Hacking Techniques, 2018, 14 (1): 53- 68.
|
| 5 |
Bossert G, Guihéry F, Hiet G, et al. Towards automated protocol reverse engineering using semantic information[C]//Proceedings of the 9th ACM Symposium on Information, Computer and Communications Security (ASIACCS). New York: ACM, 2014: 51-62.
|
| 6 |
Pereyda J. Boofuzz: A network protocol fuzzing framework[EB/OL]. (2017-05-16)[2025-07-31]. https://github.com/jtpereyda/boofuzz.
|
| 7 |
Yang Z, Peng H, Jiang Y, et al. ChatHTTPFuzz: large language model-assisted IoT HTTP fuzzing[J]. International Journal of Machine Learning and Cybernetics, 2025: 1-22.
|
| 8 |
Wei Y, Chi K, Du S, et al. Large language model driven automated network protocol testing[C]//Proceedings of the 2025 Applied Networking Research Workshop (ANRW). New York: ACM, 2025: 32-38.
|
| 9 |
Gascon H, Wressnegger C, Yamaguchi F, et al. PULSAR: stateful black-box fuzzing of proprietary network protocols[C]//Proceedings of the 11th EAI International Conference on Security and Privacy in Communication Networks (SecureComm). Cham: Springer, 2015: 330-347.
|
| 10 |
Feng Y, Lai Y, Liu Z. Vulnerability mining for modbus TCP based on exception field positioning[J]. Simulation Modelling Practice and Theory, 2020, 102, 101989.
|
| 11 |
Lin P Y, Tien C W, Huang T C, et al. ICPFuzzer: proprietary communication protocol fuzzing by using machine Learning and Feedback Strategies[J]. Cybersecurity, 2021, 4 (1): 28.
|
| 12 |
Kleber S, Maile L, Kargl F. Survey of protocol reverse engineering algorithms: decomposition of tools for static traffic analysis[J]. IEEE Communications Surveys & Tutorials, 2019, 21 (1): 526- 561.
|
| 13 |
Zhang A, Zhang Y, Xu Y, et al. Machine learning-based fuzz testing techniques: a survey[J]. IEEE Access, 2023, 12, 14437- 14454.
|
| 14 |
Meng R, Mirchev M, Böhme M, et al. Large language model guided protocol fuzzing[C]//Proceedings of the 31st Annual Network and Distributed System Security Symposium (NDSS). Reston, VA: The Internet Society, 2024.
|
| 15 |
Ma X, Luo L, Zeng Q, et al. LLM-assisted fuzzing of matter IoT devices [C]//Proceedings of the 33rd USENIX Security Symposium (USENIX Security). Berkeley, CA: USENIX Association, 2024: 4783-4800.
|
| 16 |
Cui L, Cui J, Hao Z, et al. An empirical study of vulnerability discovery methods over the past ten years[J]. Computers & Security, 2022, 120, 102817.
|
| 17 |
Aloraini B, Nagappan M, German D M, et al. An empirical study of security warnings from static application security testing tools[J]. Journal of Systems and Software, 2019, 158, 110427.
|
| 18 |
Doupé A, Cova M, Vigna G. Why Johnny can’t pentest: an analysis of black-box web vulnerability scanners[C]//Proceedings of the 7th International Conference on Detection of Intrusions and Malware, and Vulnerability Assessment (DIMVA). Berlin: Springer, 2010: 111-131.
|
| 19 |
Godefroid P, Levin M Y, Molnar D. Automated whitebox fuzz testing[C]//Proceedings of the Network and Distributed System Security Symposium (NDSS). Reston, VA: The Internet Society, 2008.
|
| 20 |
Cadar C, Dunbar D, Engler D R. KLEE: unassisted and automatic generation of high-coverage tests[C]//Proceedings of the 8th USENIX Symposium on Operating Systems Design and Implementation(OSDI) . Berkeley, CA: USENIX Association, 2008: 209-224.
|
| 21 |
Newsome J, Song D. Dynamic taint analysis for automatic detection, analysis, and signature generation of exploits[C]//Proceedings of the Network and Distributed System Security Symposium (NDSS). Reston, VA: The Internet Society, 2005: 37-52.
|
| 22 |
Kaksonen R, Laakso M, Takanen A. A functional method for assessing protocol implementation security[M]. Oulu: VTT Publications, 2001.
|
| 23 |
Eddington M. Peach fuzzing platform[EB/OL].(2011-04-18)[2025-07-31]. Available: https://peachtech.gitlab.io/.
|
| 24 |
Zalewski M. American fuzzy lop: a fuzzer tool[EB/OL]. (2014-11-01)[2025-07-31]. http://lcamtuf.coredump.cx/afl.
|
| 25 |
Pham V T, Böhme M, Roychoudhury A. AFLNET: a greybox fuzzer for network protocols[C]//Proceedings of the 13th IEEE International Conference on Software Testing, Verification and Validation (ICST). Piscataway, NJ: IEEE, 2020: 460-465.
|
| 26 |
Natella R, Cotroneo D, Acri G, et al. StateAFL: greybox fuzzing for stateful network servers[J]. Empirical Software Engineering, 2022, 27 (4): 191.
|
| 27 |
Cui W, Kannan J, Wang H. Discoverer: automatic protocol reverse engineering from network traces[C]//Proceedings of the 16th USENIX Security Symposium. Berkeley, CA: USENIX Association, 2007: 199-212.
|
| 28 |
Comparetti P M, Wondracek G, Krügel C, et al. Prospex: protocol specification extraction[C]//Proceedings of the 30th IEEE Symposium on Security and Privacy (S&P). Piscataway, NJ: IEEE, 2009: 110-125.
|
| 29 |
Feng X, Sun R, Zhu X, et al. Snipuzz: black-box fuzzing of IoT firmware via message snippet inference[C]//Proceedings of the 2021 ACM SIGSAC Conference on Computer and Communications Security (CCS) . New York: ACM, 2021: 337-350.
|
| 30 |
Alshmrany K, Cordeiro L. Finding security vulnerabilities in network protocol implementations[EB/OL]. (2020-01-28)[2025-07-31]. Available: https://arxiv.org/abs/2001.09592.
|
| 31 |
Bermudez I, Tongaonkar A, Iliofotou M, et al. Towards automatic protocol field inference[J]. Computer Communications, 2016, 84, 66- 79.
|
/
| 〈 |
|
〉 |