Large Language Models (LLMs) are redefining offensive cybersecurity by allowing the generation of harmful machine code with minimal human intervention. While attackers take advantage of dark LLMs such as XXXGPT and WolfGPT to produce malicious code, ethical hackers can follow similar approaches to automate traditional pentesting workflows. In this work, we present RedShell, a privacy-preserving, hardware-efficient framework that leverages fine-tuned LLMs to assist pentesters in generating offensive PowerShell code targeting Microsoft Windows vulnerabilities. RedShell was trained on a malicious PowerShell dataset from the literature, which we further enhanced with manually curated code samples. Experiments show that our framework achieves over 90% syntactic validity in generated samples and strong semantic alignment with reference pentesting snippets, outperforming state-of-the-art counterparts in distance metrics such as edit distance (above 50% average code similarity). Additionally, functional experiments emphasize the execution reliability of the snippets produced by RedShell in a testing scenario that mirrors real-world settings. This work sheds light on the state-of-the-art research in the field of Generative AI applied to malicious code generation and automated testing, acknowledging the potential benefits that LLMs hold within controlled environments such as pentesting.


翻译:大型语言模型(LLMs)正通过以最小人工干预生成恶意机器码的方式重新定义进攻性网络安全。虽然攻击者利用XXXGPT和WolfGPT等暗网大语言模型生成恶意代码,但道德黑客可遵循类似方法实现传统渗透测试工作流的自动化。本文提出RedShell——一种兼顾隐私保护与硬件效率的框架,通过微调大语言模型辅助渗透测试人员生成针对微软Windows漏洞的进攻性PowerShell代码。RedShell基于文献中的恶意PowerShell数据集进行训练,并进一步扩充了人工筛选的代码样本。实验表明,我们的框架在生成样本中实现了超过90%的语法有效性,并与参考渗透测试代码片段保持强语义对齐,在编辑距离等度量指标上优于现有最优方法(平均代码相似度超过50%)。此外,功能实验验证了RedShell生成的代码片段在模拟真实环境的测试场景中的执行可靠性。本研究揭示了生成式AI在恶意代码生成与自动化测试领域的最新研究进展,同时明确了大语言模型在渗透测试等受控环境中的潜在应用价值。

0
下载
关闭预览

相关内容

代码(Code)是专知网的一个重要知识资料文档板块,旨在整理收录论文源代码、复现代码,经典工程代码等,便于用户查阅下载使用。
【CMU博士论文】大型语言模型的隐性特性
专知会员服务
15+阅读 · 2025年10月18日
探索大型语言模型在网络安全中的作用:一项系统综述
专知会员服务
22+阅读 · 2025年4月27日
面向统计学家的大型语言模型概述
专知会员服务
32+阅读 · 2025年3月16日
大型语言模型网络安全综述
专知会员服务
68+阅读 · 2024年5月12日
大型语言模型在预测和异常检测中的应用综述
专知会员服务
70+阅读 · 2024年2月19日
Xsser 一款自动检测XSS漏洞工具
黑白之道
14+阅读 · 2019年8月26日
Web渗透测试Fuzz字典分享
黑白之道
21+阅读 · 2019年5月22日
自然语言处理中的语言模型预训练方法
PaperWeekly
14+阅读 · 2018年10月21日
推荐|上交大推出Texygen:文本生成模型的基准测试平台
国家自然科学基金
4+阅读 · 2017年12月31日
国家自然科学基金
6+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
19+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
Arxiv
26+阅读 · 2024年2月9日
Arxiv
12+阅读 · 2023年5月31日
VIP会员
最新内容
驱动军事决策变革的顶尖人工智能指挥系统
专知会员服务
1+阅读 · 今天13:50
非对称防御中的自组织临界性:俄乌战争
专知会员服务
8+阅读 · 8月10日
《战争中的大语言模型监管》
专知会员服务
9+阅读 · 8月10日
《边缘计算关键技术分析及美军作战实践应用》
边缘计算的军事应用
专知会员服务
11+阅读 · 8月9日
一种考虑资源机动性的武器目标分配混合算法
专知会员服务
12+阅读 · 8月8日
相关基金
国家自然科学基金
4+阅读 · 2017年12月31日
国家自然科学基金
6+阅读 · 2017年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
19+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
国家自然科学基金
4+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员