释放大语言模型从协议实现中推断状态机的力量
Unleashing the Power of LLM to Infer State Machine from the Protocol Implementation
AI总结:
提出ProtocolGPT,利用大语言模型和检索增强生成从协议实现源码推断状态机,精确率超90%,结合模糊测试提升覆盖率并发现两个0-day漏洞。
摘要:
状态机对于增强协议分析以识别漏洞至关重要。然而,由于复杂的代码语法和语义,从网络协议实现中推断状态机颇具挑战。传统的动态分析方法常因覆盖范围有限而遗漏关键状态转换,而静态分析则面临路径爆炸问题。为克服这些挑战,我们提出了一种利用大语言模型(LLMs)的新型状态机推断方法,命名为ProtocolGPT。该方法采用检索增强生成技术,用来自协议实现的特定知识增强预训练模型。通过有效的提示工程,我们准确识别并推断状态机。据我们所知,我们的方法是首个利用协议实现源代码进行状态机推断的工作。我们对六个协议实现的评估表明,我们的方法实现了超过90%的精确率,比基线方法高出30%以上。此外,将我们的方法与协议模糊测试相结合,覆盖率提高了20%以上,并相比基线方法发现了两个0-day漏洞。
英文摘要:
State machines are essential for enhancing protocol analysis to identify vulnerabilities. However, inferring state machines from network protocol implementations is challenging due to complex code syntax and semantics. Traditional dynamic analysis methods often miss critical state transitions due to limited coverage, while static analysis faces path explosion issues. To overcome these challenges, we introduce a novel state machine inference approach utilizing Large Language Models (LLMs), named ProtocolGPT. This method employs retrieval augmented generation technology to enhance a pre-trained model with specific knowledge from protocol implementations. Through effective prompt engineering, we accurately identify and infer state machines. To the best of our knowledge, our approach represents the first state machine inference that leverages the source code of protocol implementations. Our evaluation of six protocol implementations shows that our method achieves a precision of over 90%, outperforming the baselines by more than 30%. Furthermore, integrating our approach with protocol fuzzing improves coverage by more than 20% and uncovers two 0-day vulnerabilities compared to baseline methods.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。