The Infinite Mutation Engine? Measuring Polymorphism in LLM-Generated Offensive Code
Gabriel Hortea, Juan Tapiador

TL;DR
This paper quantifies how a commercial LLM can generate highly diverse, behaviorally identical malware payloads, aiding evasion of detection methods, with explicit prompts significantly increasing structural variation.
Contribution
It introduces a pipeline to measure LLM-generated malware polymorphism, demonstrating that explicit prompting enhances structural diversity while maintaining correctness.
Findings
Structural distances are high without explicit prompts.
Semantic distances remain low despite structural divergence.
Explicit prompts increase structural diversity at minimal API cost.
Abstract
Malware authors have traditionally relied on polymorphic techniques to produce variants in the same malware family, complicating signature-based detection. Integrating generative AI into offensive toolchains enables attackers to synthesize structurally diverse payloads with identical behavior, raising the question of how much polymorphism LLMs provide. Recent work has assumed that LLMs can produce sufficiently polymorphic payloads, leaving unquantified the variation that emerges when an attacker repeatedly builds the same payload, or explicitly instructs the model to avoid prior implementations. In this work, we measure the polymorphic capacity of a commercial model (Claude Opus 4.6) as an automated malware generator. We build a dual-agent, four-stage pipeline that generates, tests, and refines a data-exfiltration payload comprising file traversal, encryption, exfiltration, and…
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.
