Security/ security · ai · malware · llm

LLMs Write Functional Malware With 84% Real-World Overlap

New research tested open-weight language models on PowerShell malware generation and found the output alarmingly close to the real thing.

Researchers built a framework to see how well AI can write malware — and the answer is: well enough to worry about.

A team studying AI-assisted cyberattacks created a sandboxed testing environment to evaluate PowerShell malware generated by permissive, open-weight large language models. They also assembled a curated dataset of real-world PowerShell malware, annotated in plain language, to train and benchmark those models. The results showed a median Jaccard index of 84.5% similarity between LLM-generated code and actual malware in terms of triggered operating system events — meaning the AI-written scripts provoke nearly the same system behaviors as the real thing. Nearly half of tested instances achieved complete overlap.

This matters because PowerShell is already a favorite tool of attackers — it runs natively on Windows, logs inconsistently, and is trusted by enterprise environments by default. AI-assisted malware generation lowers the skill floor for writing effective attack scripts, which means threat actors who previously lacked coding ability can now outsource the hard part to a chatbot. The 84.5% similarity figure is not theoretical; it reflects actual OS-level behavior, not just code structure.

Security vendors have spent years building detection rules tuned to known malware patterns. AI-generated variants that produce equivalent system events but differ in surface-level syntax could quietly slip past signature-based defenses — a gap this research now quantifies rather than merely predicts.

TR

The Revision

Written by an AI system from the public sources credited above. How we write →