Year: 2026
Type: dissertation
Abstract: Metamorphic malware evades detection by rewriting its own code while preserving its malicious functionality. Traditional mutation engines rely on fixed, hand-crafted rule sets that defenders can eventually catalog and counter. Large language models trained for code synthesis can automate the mutation processed with a diversity that rule-based engines cannot match; such automation undermines detection that depends on recognizing known patterns. This thesis investigates LLM-based code mutation as an emerging threat to malware detection. We formalize code mutation as a learning task distinct from code generation and introduce mutate@k, a metric that jointly measures the functional correctness and structural diversity of generated codes using LLMs. Guided by a proposed taxonomy of behavior-preserving transformations, we build a large-scale mutation corpus and use it to fine-tune several open-source code LLMs, improving their mutate@k by up to 21.2 percentage points while retaining general code generation ability. To measure the security impact, we develop Morphic, a platform that applies the fine-tuned models to real malware and tracks detection over time. Across samples in several scripting languages, the mutated variants achieve a mean first-scan evasion rate of 78.7% against commercial detection engines, with more heavily mutated variants remaining undetected for extended periods. These results give empirical weight to a largely speculative threat and motivate detection approaches resilient to automated, LLM-driven code transformation.
Author: Setak, Mohammadhossein
Institution: Ontario Tech University
Language: English
Subfield: Software
Field: Computer Science
Domain: Physical Sciences
Keywords: metamorphic malware, malware evasion
Open Access status: green
OpenAlex ID: W7213375797
