用大模型学习漏洞攻击模式,智能生成测试用例。
FuzzCoder: Byte-level Fuzzing Test via Large Language Model
- 用大模型将输入字节序列转为变异后序列,指导模糊测试
- 在ELF/JPG/MP3/XML上提升有效变异率和崩溃数
- 适合安全研究者与自动化漏洞挖掘工具开发者
模糊测试是一种重要的动态程序分析技术,用于发现复杂软件中的漏洞。该技术通过向目标程序注入精心构造的恶意输入,引发崩溃、缓冲区溢出、内存错误和异常。高效生成恶意输入仍是开放难题,现有最佳方法通常对已有有效输入进行均匀随机变异。本文提出FuzzCoder,一种基于微调大语言模型的字节级模糊测试方法,通过学习成功攻击中输入文件的模式来引导后续模糊测试探索。我们构建了指令数据集Fuzz-Instruct,其中包含从启发式模糊测试工具收集的成功模糊测试历史。FuzzCoder将变异过程建模为序列到序列任务,接收原始字节序列并输出变异后的字节序列,可预测触发程序异常行为的变异位置与策略。实验表明,基于AFL(American Fuzzy Lop)的FuzzCoder在多种输入格式(ELF、JPG、MP3、XML)下显著提升了有效变异比例(EPM)和崩溃数量(NC)。
原文摘要 · Abstract (English)
Fuzzing is an important dynamic program analysis technique designed for finding vulnerabilities in complex software. Fuzzing involves presenting a target program with crafted malicious input to cause crashes, buffer overflows, memory errors, and exceptions. Crafting malicious inputs in an efficient manner is a difficult open problem and the best approaches often apply uniform random mutations to pre-existing valid inputs. In this work, we propose to adopt fine-tuned large language models (FuzzCoder) to learn patterns in the input files from successful attacks to guide future fuzzing explorations. Specifically, we develop a framework to leverage the code LLMs to guide the mutation process of inputs in fuzzing. The mutation process is formulated as the sequence-to-sequence modeling, where LLM receives a sequence of bytes and then outputs the mutated byte sequence. FuzzCoder is fine-tuned on the created instruction dataset (Fuzz-Instruct), where the successful fuzzing history is collected from the heuristic fuzzing tool. FuzzCoder can predict mutation locations and strategies locations in input files to trigger abnormal behaviors of the program. Experimental results show that FuzzCoder based on AFL (American Fuzzy Lop) gain significant improvements in terms of effective proportion of mutation (EPM) and number of crashes (NC) for various input formats including ELF, JPG, MP3, and XML.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。