RedShell: A Generative AI-Based Approach to Ethical Hacking
Ricardo Bessa, Rui Claro, Jo\~ao Trindade, Jo\~ao Louren\c{c}o

TL;DR
RedShell is a novel tool that leverages generative AI to ethically produce malicious PowerShell code for cybersecurity testing, demonstrating high syntactic validity and semantic consistency.
Contribution
This work introduces RedShell, a specialized generative model for malicious PowerShell code, along with a new dataset for training and evaluating offensive code generation models.
Findings
RedShell generates syntactically valid PowerShell with less than 10% parse errors.
Generated samples achieve over 50% similarity on Edit Distance and 40% on METEOR.
The approach advances AI-assisted pentesting within controlled, ethical environments.
Abstract
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…
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
