Large Language Models are Few-shot Generators: Proposing Hybrid Prompt Algorithm To Generate Webshell Escape Samples

📄 arXiv: 2402.07408v2 📥 PDF

作者: Mingrui Ma, Lansheng Han, Chunjie Zhou

分类: cs.CR, cs.AI

发布日期: 2024-02-12 (更新: 2024-06-05)

备注: 21 pages, 17 figures


💡 一句话要点

提出混合提示算法以解决Webshell逃逸样本生成问题

🎯 匹配领域: 支柱九:具身大模型 (Embodied Foundation Models)

关键词: Webshell攻击 网络安全 样本生成 大型语言模型 混合提示算法 恶意软件检测 人工智能

📋 核心要点

  1. 现有Webshell逃逸样本生成方法依赖手动规则,缺乏公开数据集,导致研究进展缓慢。
  2. 本文提出的混合提示算法结合多种提示思想,利用大型语言模型生成Webshell逃逸样本。
  3. 实验结果显示,混合提示算法在生成样本的逃逸率和生存率上均有显著提升。

📝 摘要(中文)

随着网络攻击的频繁发生,Webshell攻击与防御逐渐成为网络安全领域的研究热点。然而,缺乏公开的基准数据集以及对手动定义规则的过度依赖,减缓了Webshell逃逸样本生成和基于人工智能的Webshell检测相关研究的进展。为了解决Webshell样本逃逸能力弱、缺乏复杂恶意特征的数据集等问题,促进Webshell检测的发展,本文提出了一种基于大型语言模型的混合提示算法。该算法结合了多种提示思想,包括思维链、思维树,并融入Webshell层次模块和少量示例,以帮助大型语言模型学习和推理Webshell逃逸策略。实验结果表明,该算法能够与多种大型语言模型协同工作,生成高质量的Webshell样本,逃逸率达到88.61%(使用GPT-4模型在VirusTotal检测引擎上)和生存率54.98%。

🔬 方法详解

问题定义:本文旨在解决Webshell逃逸样本生成能力弱、缺乏复杂恶意特征数据集的问题。现有方法过于依赖手动定义的规则,限制了研究的进展。

核心思路:混合提示算法通过结合多种提示策略(如思维链和思维树),并引入Webshell层次模块和少量示例,增强大型语言模型的学习和推理能力,从而生成高质量的Webshell逃逸样本。

技术框架:该算法的整体架构包括多个模块:首先是提示生成模块,负责构建适合Webshell样本的提示;其次是样本生成模块,利用大型语言模型生成样本;最后是评估模块,评估生成样本的逃逸率和生存率。

关键创新:混合提示算法的主要创新在于其综合了多种提示思想,并针对Webshell样本生成进行了专门设计,这与现有方法的单一提示策略形成了鲜明对比。

关键设计:在参数设置上,算法采用了少量示例来引导模型学习,损失函数设计上则强调生成样本的质量与多样性,以确保生成的Webshell样本具有较高的逃逸率和生存率。

🖼️ 关键图片

fig_0
fig_1
fig_2

📊 实验亮点

实验结果表明,混合提示算法在使用GPT-4模型时,生成的Webshell样本逃逸率达到88.61%,生存率为54.98%,显著优于传统方法。这一结果展示了大型语言模型在网络安全领域的应用潜力。

🎯 应用场景

该研究的潜在应用领域包括网络安全防护、恶意软件检测和网络入侵检测等。通过生成高质量的Webshell逃逸样本,能够帮助安全研究人员更好地理解和防御Webshell攻击,提升网络安全防护能力。未来,该算法有望在其他恶意软件检测和生成任务中得到应用。

📄 摘要(原文)

The frequent occurrence of cyber-attacks has made webshell attacks and defense gradually become a research hotspot in the field of network security. However, the lack of publicly available benchmark datasets and the over-reliance on manually defined rules for webshell escape sample generation have slowed down the progress of research related to webshell escape sample generation and artificial intelligence (AI)-based webshell detection. To address the drawbacks of weak webshell sample escape capabilities, the lack of webshell datasets with complex malicious features, and to promote the development of webshell detection, we propose the Hybrid Prompt algorithm for webshell escape sample generation with the help of large language models. As a prompt algorithm specifically developed for webshell sample generation, the Hybrid Prompt algorithm not only combines various prompt ideas including Chain of Thought, Tree of Thought, but also incorporates various components such as webshell hierarchical module and few-shot example to facilitate the LLM in learning and reasoning webshell escape strategies. Experimental results show that the Hybrid Prompt algorithm can work with multiple LLMs with excellent code reasoning ability to generate high-quality webshell samples with high Escape Rate (88.61% with GPT-4 model on VirusTotal detection engine) and (Survival Rate 54.98% with GPT-4 model).