利用 LLM 加强基于 ML 的跨站脚本检测
Leveraging LLM to Strengthen ML-Based Cross-Site Scripting Detection
AI总结:
本文利用微调的 LLM 自动生成复杂的混淆 XSS 有效载荷作为训练数据,显著提升了基于 ML 的 XSS 检测模型在应对混淆攻击时的准确率和复杂度处理能力。
摘要:
根据 Open Web Application Security Project (OWASP),Cross-Site Scripting (XSS) 是一种严重的安全漏洞。尽管已有数十年的研究,XSS 仍位列十大安全漏洞之中。研究人员提出了多种技术来保护系统免受 XSS 攻击,其中机器学习 (ML) 是最广泛使用的方法之一。ML 模型在数据集上进行训练以识别潜在的 XSS 威胁,这使其有效性高度依赖于训练数据的规模和多样性。XSS 的一种变体是混淆 XSS,攻击者应用混淆技术改变代码结构,使安全系统难以检测其恶意意图。我们研究的随机森林模型在传统(非混淆)XSS 数据上训练达到了 99.8% 的准确率。然而,在测试混淆 XSS 样本时,准确率降至 81.9%,这凸显了使用混淆数据训练 ML 模型以提高其检测 XSS 攻击有效性的重要性。一个重大挑战是,尽管有几种公开工具可用,但要生成高度复杂的混淆代码。这些工具只能产生达到一定复杂度级别的混淆。\n 在我们提出的系统中,我们微调了一个 Large Language Model (LLM) 以自动生成复杂的混淆 XSS 有效载荷。通过将原始 XSS 样本转换为多样化的混淆变体,我们为 ML 模型评估创建了具有挑战性的训练数据。我们的方法在混淆数据集上达到了 99.5% 的准确率。我们还发现,LLM 生成的混淆样本比其他工具创建的样本复杂度高 28.1%,显著提升了模型处理高级 XSS 攻击的能力,使其在现实应用安全中更加有效。
英文摘要:
According to the Open Web Application Security Project (OWASP), Cross-Site Scripting (XSS) is a critical security vulnerability. Despite decades of research, XSS remains among the top 10 security vulnerabilities. Researchers have proposed various techniques to protect systems from XSS attacks, with machine learning (ML) being one of the most widely used methods. An ML model is trained on a dataset to identify potential XSS threats, making its effectiveness highly dependent on the size and diversity of the training data. A variation of XSS is obfuscated XSS, where attackers apply obfuscation techniques to alter the code's structure, making it challenging for security systems to detect its malicious intent. Our study's random forest model was trained on traditional (non-obfuscated) XSS data achieved 99.8% accuracy. However, when tested against obfuscated XSS samples, accuracy dropped to 81.9%, underscoring the importance of training ML models with obfuscated data to improve their effectiveness in detecting XSS attacks. A significant challenge is to generate highly complex obfuscated code despite the availability of several public tools. These tools can only produce obfuscation up to certain levels of complexity. In our proposed system, we fine-tune a Large Language Model (LLM) to generate complex obfuscated XSS payloads automatically. By transforming original XSS samples into diverse obfuscated variants, we create challenging training data for ML model evaluation. Our approach achieved a 99.5% accuracy rate with the obfuscated dataset. We also found that the obfuscated samples generated by the LLMs were 28.1% more complex than those created by other tools, significantly improving the model's ability to handle advanced XSS attacks and making it more effective for real-world application security.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。