arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 2505.24252cs.CRcs.AI
收藏

面向红队的奖励驱动自动化WebShell恶意代码生成器

A Reward-driven Automated Webshell Malicious-code Generator for Red-teaming

Beijing Electronic Science and Technology Institute(北京电子科技学院)

Yizhong Ding

AI总结:

提出面向红队的奖励驱动自动化WebShell恶意代码生成器RAWG,通过构建标准化语料库、监督微调开源大模型并应用PPO强化学习,显著提升了生成恶意代码的多样性与逃逸效果。

摘要:

频繁的网络攻击已将WebShell利用与防御提升为网络安全领域的关键研究重点。然而,目前仍严重缺乏按混淆方法分类且公开可用的恶意代码数据集。现有的恶意代码生成方法主要依赖提示工程,其生成的有效载荷往往多样性有限且冗余度高。为解决这些局限性,我们提出了RAWG,一种面向红队应用的奖励驱动自动化WebShell恶意代码生成器。我们的方法首先将来自常见数据集的WebShell样本划分为七种不同的混淆类型。随后,我们利用大型语言模型(LLM)从每个样本中提取并标准化关键标记,构建一个标准化、高质量的语料库。利用该精选数据集,我们对开源大模型进行监督微调(SFT),以生成多样且高度混淆的WebShell恶意有效载荷。为进一步提升生成质量,我们应用了近端策略优化(PPO),在强化学习过程中将恶意代码样本作为“选中”数据,将良性代码作为“拒绝”数据。大量实验表明,RAWG在有效载荷多样性和逃逸效果上均显著优于当前最先进的方法。

英文摘要:

Frequent cyber-attacks have elevated WebShell exploitation and defense to a critical research focus within network security. However, there remains a significant shortage of publicly available, well-categorized malicious-code datasets organized by obfuscation method. Existing malicious-code generation methods, which primarily rely on prompt engineering, often suffer from limited diversity and high redundancy in the payloads they produce. To address these limitations, we propose \textbf{RAWG}, a \textbf{R}eward-driven \textbf{A}utomated \textbf{W}ebshell Malicious-code \textbf{G}enerator designed for red-teaming applications. Our approach begins by categorizing webshell samples from common datasets into seven distinct types of obfuscation. We then employ a large language model (LLM) to extract and normalize key tokens from each sample, creating a standardized, high-quality corpus. Using this curated dataset, we perform supervised fine-tuning (SFT) on an open-source large model to enable the generation of diverse, highly obfuscated webshell malicious payloads. To further enhance generation quality, we apply Proximal Policy Optimization (PPO), treating malicious-code samples as "chosen" data and benign code as "rejected" data during reinforcement learning. Extensive experiments demonstrate that RAWG significantly outperforms current state-of-the-art methods in both payload diversity and escape effectiveness.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑