LLM能生成混淆的汇编代码,可能威胁杀毒软件检测能力。
Can LLMs Obfuscate Code? A Systematic Analysis of Large Language Models into Assembly Code Obfuscation
- 用LLM直接生成混淆汇编代码,无需原始源码
- 测试中多款LLM生成成功率超70%,最高达86%
- 适合安全研究者关注新兴攻击风险
恶意软件作者常使用代码混淆以规避检测。现有混淆工具多依赖原始源码(如C++或Java),且新增混淆手段耗时费力。本文探究大语言模型能否直接生成混淆汇编代码。通过构建包含32.8万条样本的MetamorphASM数据集(MAD)及三种混淆技术(无用代码、寄存器替换、控制流变换),系统评估GPT-3.5/4、GPT-4o-mini、Starcoder、CodeGemma、CodeLlama、CodeT5和LLaMA 3.1等模型的生成能力。采用信息论指标与人工审核结合的方式验证结果,发现部分模型生成混淆代码成功率超过70%,最高达86%。该研究为防御新型混淆攻击提供了基础。
原文摘要 · Abstract (English)
Malware authors often employ code obfuscations to make their malware harder to detect. Existing tools for generating obfuscated code often require access to the original source code (e.g., C++ or Java), and adding new obfuscations is a non-trivial, labor-intensive process. In this study, we ask the following question: Can Large Language Models (LLMs) potentially generate a new obfuscated assembly code? If so, this poses a risk to anti-virus engines and potentially increases the flexibility of attackers to create new obfuscation patterns. We answer this in the affirmative by developing the MetamorphASM benchmark comprising MetamorphASM Dataset (MAD) along with three code obfuscation techniques: dead code, register substitution, and control flow change. The MetamorphASM systematically evaluates the ability of LLMs to generate and analyze obfuscated code using MAD, which contains 328,200 obfuscated assembly code samples. We release this dataset and analyze the success rate of various LLMs (e.g., GPT-3.5/4, GPT-4o-mini, Starcoder, CodeGemma, CodeLlama, CodeT5, and LLaMA 3.1) in generating obfuscated assembly code. The evaluation was performed using established information-theoretic metrics and manual human review to ensure correctness and provide the foundation for researchers to study and develop remediations to this risk.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。