LLM-generated PowerShell malware closely mimics real malware, 84.5% median Jaccard similarity
LLM-generated PowerShell malware achieves high similarity to real malware in dynamic behavior
AI/ML arXiv 29 Jun 2026 Benchmark Prototype evidence
Published as “AI-Generated PowerShell Malware: An Experimental Framework and Dataset”
Why it matters
Attackers could leverage small, open-source LLMs to craft functional PowerShell malware, lowering the barrier for AI-assisted cyber offenses.
Summary
LLMs with fewer than 10 billion parameters can generate high-fidelity PowerShell malware, achieving a median Jaccard similarity of 84.5% and 48.4% of samples showing complete event overlap with real malware. The study introduces the PSStrikes dataset of 1,944 deobfuscated PowerShell malware samples with natural-language descriptions, an evaluation framework combining static and dynamic analysis, and the PSSandman sandbox for behavior comparison. Experiments on three open-weight LLMs (Yi-Coder-9B-Chat, Qwen2.5-Coder-7B-Instruct, Deepseek-coder-7b-instruct-v1.5) and an anonymized baseline confirm functional malware generation despite textual divergence from reference code. Evidence is based on real-world samples; no explicit limitations are stated in the provided sections.
What they found 3
- LLMs under 10 B parameters can generate high-fidelity PowerShell malware.
“high-fidelity PowerShell malware can be generated by LLMs with fewer than 10 billion parameters, even using consumer hardware, leveraging Quantized LowRank Adaptation (QLoRa) training procedures and quantization algorithms for deployment.”
- Generated malware shows strong behavioral similarity to real samples.
“median Jaccard index of 84.5%, with 48.4% of the instances exhibiting complete event overlap compared to real-world malware reference”
- Generated code often diverges textually from reference implementations.
“LLM-generated malware frequently diverges from reference implementations (e.g., in terms of textual similarity between generated code and the corresponding real malware sample)”
Caveats 1
- LLM-generated malware frequently diverges from reference implementations (e.g., in terms of textual similarity between generated code and the corresponding real malware sample)
What’s new here 3
- Provides the first curated, deobfuscated PowerShell malware dataset paired with natural-language prompts (PSStrikes).
- Introduces a three-stage evaluation framework that includes dynamic sandbox analysis (PSSandman) for generated malware.
- Demonstrates that sub-10 B parameter open-source LLMs can produce functional malware using QLoRa quantization.