用大模型提升安卓恶意软件检测,解决代码冗长与结构复杂问题
LAMD: Context-driven Android Malware Detection and Classification with LLMs
- 提取关键安全代码段,构建程序结构以聚焦恶意行为
- 分层推理分析指令到语义,实现高精度恶意软件分类
- 适合安全研究人员和需要可解释检测的开发者
移动应用的快速发展加剧了安卓恶意软件威胁。尽管已有多种检测方法,但仍面临攻击演化、数据集偏差和解释性不足等问题。大语言模型(LLMs)凭借零样本推理与推理能力提供了新思路。然而将其应用于安卓恶意软件检测存在两大挑战:(1) 安卓应用包含大量支撑代码,常达数千个类,超出LLM上下文限制,且恶意行为被嵌入良性功能中;(2) 应用的结构复杂性和依赖关系超出LLM的序列化推理能力,导致代码分析碎片化,难以推断恶意意图。为此,我们提出LAMD——一种面向实际应用的上下文驱动框架,支持基于LLM的安卓恶意软件检测。LAMD通过关键上下文提取,隔离出安全关键代码区域并构建程序结构,再采用分层代码推理,从底层指令逐步分析到高层语义,最终输出预测结果与解释。同时引入事实一致性验证机制,有效缓解第一层推理中的幻觉问题。在真实场景下的评估表明,LAMD在性能上优于传统检测器,为动态威胁环境下基于大模型的恶意软件分析提供了可行路径。
原文摘要 · Abstract (English)
The rapid growth of mobile applications has escalated Android malware threats. Although there are numerous detection methods, they often struggle with evolving attacks, dataset biases, and limited explainability. Large Language Models (LLMs) offer a promising alternative with their zero-shot inference and reasoning capabilities. However, applying LLMs to Android malware detection presents two key challenges: (1)the extensive support code in Android applications, often spanning thousands of classes, exceeds LLMs' context limits and obscures malicious behavior within benign functionality; (2)the structural complexity and interdependencies of Android applications surpass LLMs' sequence-based reasoning, fragmenting code analysis and hindering malicious intent inference. To address these challenges, we propose LAMD, a practical context-driven framework to enable LLM-based Android malware detection. LAMD integrates key context extraction to isolate security-critical code regions and construct program structures, then applies tier-wise code reasoning to analyze application behavior progressively, from low-level instructions to high-level semantics, providing final prediction and explanation. A well-designed factual consistency verification mechanism is equipped to mitigate LLM hallucinations from the first tier. Evaluation in real-world settings demonstrates LAMD's effectiveness over conventional detectors, establishing a feasible basis for LLM-driven malware analysis in dynamic threat landscapes.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。