通过对抗演化提升网页后门检测鲁棒性,兼顾高逃逸率与低误报。
ShellForge: Adversarial Co-Evolution of Webshell Generation and Multi-View Detection for Robust Webshell Defense
- 生成器与检测器迭代对抗,自动生成高隐蔽性后门样本
- 检测器在公开数据集上达到0.981的F1分数,逃逸率超93%仍有效
- 用大模型生成去恶意样本,减少误报,适合安全防御研究者
网页后门仍是攻击者渗透服务器的主要入口,尤其在PHP生态中。现有检测方法难以应对快速变异和复杂混淆技术,且常将合法管理脚本误判为恶意。为此,我们提出ShellForge——一种对抗共进化框架,将自动化网页后门生成与多视角检测结合,持续强化防御边界。框架通过生成器与检测器间的迭代训练循环,互相推送难例样本进行优化。生成器采用监督微调与基于偏好强化学习,生成功能完整、高度隐蔽的变体。检测器融合长字符串压缩的语义特征、剪枝抽象语法树的结构特征及香农熵等全局统计指标。为降低误报,引入大模型生成去恶意样本(保留复杂混淆但无恶意载荷),作为高质量难负样本用于训练。在公开的FWOID基准测试中,收敛后检测器保持0.981 F1分数,生成器对VirusTotal商业引擎实现0.939逃逸率。
原文摘要 · Abstract (English)
Webshells remain a primary foothold for attackers to compromise servers, particularly within PHP ecosystems. However, existing detection mechanisms often struggle to keep pace with rapid variant evolution and sophisticated obfuscation techniques that camouflage malicious intent. Furthermore, many current defenses suffer from high false-alarm rates when encountering benign administrative scripts that employ heavy obfuscation for intellectual property protection. To address these challenges, we present ShellForge, an adversarial co-evolution framework that couples automated webshell generation with multi-view detection to continuously harden defensive boundaries. The framework operates through an iterative co-training loop where a generator and a detector mutually reinforce each other via the exchange of hard samples. The generator is optimized through supervised fine-tuning and preference-based reinforcement learning to synthesize functional, highly evasive variants. Simultaneously, we develop a multi-view fusion detector that integrates semantic features from long-string compression, structural features from pruned abstract syntax trees, and global statistical indicators such as Shannon entropy. To minimize false positives, ShellForge utilizes a LLM-based transformation to create de-malicious samples--scripts that retain complex obfuscation patterns but lack harmful payloads--serving as high-quality hard negatives during training. Evaluations on the public FWOID benchmark demonstrate that ShellForge significantly enhances defensive robustness. Upon convergence, the detector maintains a 0.981 F1-score while the generator achieves a 0.939 evasion rate against commercial engines on VirusTotal.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。