arXiv:2507.11222cs.CLcs.AI2025-07被引 2

用大模型自动从协议文档提取状态机,准确率高且少出错。

An Agentic Flow for Finite State Machine Extraction using Prompt Chaining

  • 通过提示词链和思维链让大模型分步推理,逐步构建状态机规则
  • 在FTP和RTSP协议上测试,误提取状态转移极少,精度高
  • 适合做网络安全分析、逆向工程的开发者或研究人员使用

有限状态机(FSM)是建模网络协议运行逻辑的关键工具,可用于验证、分析及漏洞发现。然而,现有FSM提取方法存在可扩展性差、覆盖不全以及自然语言规范歧义等问题。本文提出FlowFSM,一种基于大语言模型(LLM)的智能体框架,结合提示词链与思维链推理,从原始RFC文档中提取精确的FSM。FlowFSM系统化处理协议规范,识别状态转移,并通过串联智能体输出构建结构化规则库。在FTP和RTSP协议上的实验表明,FlowFSM具有高提取精度,同时显著减少幻觉式状态转移,结果令人振奋。研究揭示了基于智能体的LLM系统在推进协议分析与安全逆向工程中的潜力。

原文摘要 · Abstract (English)

Finite-State Machines (FSMs) are critical for modeling the operational logic of network protocols, enabling verification, analysis, and vulnerability discovery. However, existing FSM extraction techniques face limitations such as scalability, incomplete coverage, and ambiguity in natural language specifications. In this paper, we propose FlowFSM, a novel agentic framework that leverages Large Language Models (LLMs) combined with prompt chaining and chain-of-thought reasoning to extract accurate FSMs from raw RFC documents. FlowFSM systematically processes protocol specifications, identifies state transitions, and constructs structured rule-books by chaining agent outputs. Experimental evaluation across FTP and RTSP protocols demonstrates that FlowFSM achieves high extraction precision while minimizing hallucinated transitions, showing promising results. Our findings highlight the potential of agent-based LLM systems in the advancement of protocol analysis and FSM inference for cybersecurity and reverse engineering applications.

状态机大模型协议分析智能体

Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。