English

The Power of Words: Generating PowerShell Attacks from Natural Language

Cryptography and Security 2024-04-22 v1 Software Engineering

Abstract

As the Windows OS stands out as one of the most targeted systems, the PowerShell language has become a key tool for malicious actors and cybersecurity professionals (e.g., for penetration testing). This work explores an uncharted domain in AI code generation by automatically generating offensive PowerShell code from natural language descriptions using Neural Machine Translation (NMT). For training and evaluation purposes, we propose two novel datasets with PowerShell code samples, one with manually curated descriptions in natural language and another code-only dataset for reinforcing the training. We present an extensive evaluation of state-of-the-art NMT models and analyze the generated code both statically and dynamically. Results indicate that tuning NMT using our dataset is effective at generating offensive PowerShell code. Comparative analysis against the most widely used LLM service ChatGPT reveals the specialized strengths of our fine-tuned models.

Keywords

Cite

@article{arxiv.2404.12893,
  title  = {The Power of Words: Generating PowerShell Attacks from Natural Language},
  author = {Pietro Liguori and Christian Marescalco and Roberto Natella and Vittorio Orbinato and Luciano Pianese},
  journal= {arXiv preprint arXiv:2404.12893},
  year   = {2024}
}

Comments

18th USENIX WOOT Conference on Offensive Technologies, GitHub Repo: https://github.com/dessertlab/powershell-offensive-code-generation

R2 v1 2026-06-28T15:59:50.972Z