The application of Machine Learning techniques in code generation is now a common practice for most developers. Tools such as ChatGPT from OpenAI leverage the natural language processing capabilities of Large Language Models to generate machine code from natural language descriptions. In the cybersecurity field, red teams can also take advantage of generative models to build malicious code generators, providing more automation to Pentest audits. However, the application of Large Language Models in malicious code generation remains challenging due to the lack of data to train and evaluate offensive code generators. In this work, we propose RedShell, a tool that allows ethical hackers to generate malicious PowerShell code. We also introduce a ground truth dataset, combining publicly available code samples to fine-tune models in malicious PowerShell generation. Our experiments demonstrate the strong capabilities of RedShell in generating syntactically valid PowerShell, with fewer than 10% of the generated samples resulting in parse errors. Furthermore, our specialized model was able to produce samples that were semantically consistent with reference snippets, achieving a competitive performance on standard output similarity metrics such as Edit Distance and METEOR, with their mean similarity scores exceeding 50% and 40%, respectively. This work sheds light on the state-of-the-art research in the field of Generative AI applied to Pentesting, and also serves as a steppingstone for future advancements, highlighting the potential benefits these models hold within such controlled environments.


翻译:机器学习技术在代码生成中的应用如今已成为大多数开发者的普遍实践。诸如OpenAI的ChatGPT等工具利用大语言模型的自然语言处理能力,从自然语言描述中生成机器代码。在网络安全领域,红队亦可利用生成式模型构建恶意代码生成器,从而为渗透测试审计提供更高程度的自动化。然而,由于缺乏训练和评估恶意代码生成器的数据,大语言模型在恶意代码生成中的应用仍面临挑战。本文提出RedShell这一工具,使道德黑客能够生成恶意的PowerShell代码。我们还引入了一个真实数据集,结合公开可用的代码样本,以微调恶意PowerShell生成的模型。实验表明,RedShell在生成语法有效的PowerShell代码方面表现强劲,生成的样本中语法错误比例低于10%。此外,我们的专用模型能够生成与参考片段语义一致的样本,在编辑距离和METEOR等标准输出相似度指标上取得了有竞争力的表现,其平均相似度得分分别超过50%和40%。本研究揭示了生成式人工智能应用于渗透测试领域的前沿研究,并作为未来进展的基石,突出了此类模型在受控环境中的潜在优势。

0
下载
关闭预览

相关内容

代码(Code)是专知网的一个重要知识资料文档板块,旨在整理收录论文源代码、复现代码,经典工程代码等,便于用户查阅下载使用。
【新书】利用生成式人工智能进行网络防御策略
专知会员服务
31+阅读 · 2024年10月18日
《网络安全中的生成式人工智能方法综述》41页长综述
专知会员服务
40+阅读 · 2024年5月7日
生成式AI:认知对抗的新武器
专知会员服务
83+阅读 · 2023年12月29日
被重塑的世界?ChatGPT崛起下人工智能与国家安全新特征
专知会员服务
72+阅读 · 2023年10月23日
《人工智能安全测评白皮书》,99页pdf
专知
36+阅读 · 2022年2月26日
【智能金融】机器学习在反欺诈中应用
产业智能官
35+阅读 · 2019年3月15日
Java 工程师快速入门深度学习,可以从 Deeplearning4j 开始
人工智能头条
13+阅读 · 2018年12月14日
NLP中自动生产文摘(auto text summarization)
机器学习研究会
14+阅读 · 2017年10月10日
国家自然科学基金
4+阅读 · 2017年12月31日
国家自然科学基金
6+阅读 · 2017年12月31日
国家自然科学基金
9+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
19+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
25+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Arxiv
0+阅读 · 3月9日
VIP会员
最新内容
AutoScientists:自组织智能体团队驱动长期科学实验
战略前沿人工智能的再思考(中文)
专知会员服务
3+阅读 · 今天14:53
《量化地基防空系统间接效应的博弈论方法》
专知会员服务
3+阅读 · 今天14:51
“史诗怒火行动”中美军损失的作战飞机
专知会员服务
2+阅读 · 今天14:38
ICML 2026 | 理解上下文持续学习中的泛化与遗忘
专知会员服务
5+阅读 · 5月28日
Agent Harness综述:大模型智能体执行器工程全景
专知会员服务
13+阅读 · 5月28日
《基于理论的威慑效能评估》
专知会员服务
8+阅读 · 5月28日
相关基金
国家自然科学基金
4+阅读 · 2017年12月31日
国家自然科学基金
6+阅读 · 2017年12月31日
国家自然科学基金
9+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
2+阅读 · 2015年12月31日
国家自然科学基金
1+阅读 · 2015年12月31日
国家自然科学基金
19+阅读 · 2015年12月31日
国家自然科学基金
0+阅读 · 2015年12月31日
国家自然科学基金
25+阅读 · 2014年12月31日
国家自然科学基金
0+阅读 · 2014年12月31日
Top
微信扫码咨询专知VIP会员