Automated Malware Source Code Generation via Uncensored LLMs and Adversarial Evasion of Censored Model

Malicious programs, commonly called malware, have had a pervasive presence in the world for nearly forty years and have continued to evolve and multiply exponentially. On the other hand, there are multiple research works focused on malware detection with different strategies that seem to work only temporarily, as new attack tactics and techniques quickly emerge. There are increasing proposals to analyze the problem from the attacker’s perspective, as suggested by MITRE ATT&CK. This article presents a proposal that utilizes Large Language Models (LLMs) to generate malware and understand its generation from the perspective of a red team. It demonstrates how to create malware using current models that incorporate censorship, and a specialized model is trained (fine-tuned) to generate code, enabling it to learn how to create malware. Both scenarios are evaluated using the pass@k metric and a controlled execution environment (malware lab) to prevent its spread.

Authors

Institutions

Publication Details

Journal
Applied Sciences
Published
2025-08-22
DOI
https://doi.org/10.3390/app15179252
Citations
2
Primary Topic
Advanced Malware Detection Techniques
Type
article
Field-Weighted Citation Impact
2.97

Funders

Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

Automated Malware Source Code Generation via Uncensored LLMs and Adversarial Evasion of Censored Model

Eleazar Aguirre Anaya, Raúl Acosta-Bermejo, José Alexis Terrazas-Chavez
2 citations
Applied Sciences
Advanced Malware Detection Techniques
2.97
article

Automated Malware Source Code Generation via Uncensored LLMs and Adversarial Evasion of Censored Model

Eleazar Aguirre Anaya, Raúl Acosta-Bermejo, José Alexis Terrazas-Chavez
article en
2 citations

Abstract

Malicious programs, commonly called malware, have had a pervasive presence in the world for nearly forty years and have continued to evolve and multiply exponentially. On the other hand, there are multiple research works focused on malware detection with different strategies that seem to work only temporarily, as new attack tactics and techniques quickly emerge. There are increasing proposals to analyze the problem from the attacker’s perspective, as suggested by MITRE ATT&CK. This article presents a proposal that utilizes Large Language Models (LLMs) to generate malware and understand its generation from the perspective of a red team. It demonstrates how to create malware using current models that incorporate censorship, and a specialized model is trained (fine-tuned) to generate code, enabling it to learn how to create malware. Both scenarios are evaluated using the pass@k metric and a controlled execution environment (malware lab) to prevent its spread.

Applied SciencesVol. 15(17)
Instituto Politécnico Nacional (MX)
Instituto Politécnico Nacional
Openalex Percentile: Top 8%
Advanced Malware Detection Techniques
2.97
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.