{"id":7568,"date":"2025-10-10T10:03:05","date_gmt":"2025-10-10T10:03:05","guid":{"rendered":"https:\/\/serisec.com\/index.php\/2025\/10\/10\/llm-enabled-malterminal-malware-leverages-gpt-4-to-generate-ransomware-code\/"},"modified":"2025-10-10T10:03:05","modified_gmt":"2025-10-10T10:03:05","slug":"llm-enabled-malterminal-malware-leverages-gpt-4-to-generate-ransomware-code","status":"publish","type":"post","link":"https:\/\/serisec.com\/index.php\/2025\/10\/10\/llm-enabled-malterminal-malware-leverages-gpt-4-to-generate-ransomware-code\/","title":{"rendered":"LLM-enabled MalTerminal Malware Leverages GPT-4 to Generate Ransomware Code"},"content":{"rendered":"<p>    LLM-enabled MalTerminal Malware Leverages GPT-4 to Generate Ransomware Code<br \/>\n \t<BR><br \/>\n<BR><\/BR><br \/>\n    <!-- no image --><br \/>\n \t<BR><br \/>\n<BR><\/BR><\/p>\n<div>\n<p>Cybersecurity researchers have identified what is believed to be the earliest known instance of malware that leverages a Large Language Model (LLM) to generate malicious code at runtime. <\/p>\n<p>Dubbed \u2018<a href=\"https:\/\/cybersecuritynews.com\/first-ever-ai-powered-malterminal-malware\/\" target=\"_blank\" rel=\"noreferrer noopener\">MalTerminal<\/a>\u2019 by SentinelLABS, the malware uses OpenAI\u2019s GPT-4 to dynamically create ransomware code and reverse shells, presenting a new and formidable challenge for detection and threat analysis.<\/p>\n<p>The discovery highlights a significant shift in adversary tradecraft, where the malicious logic is not hardcoded into the malware itself but is generated on-the-fly by an external AI model. <\/p>\n<p>This approach can render traditional security measures, such as static signatures, ineffective, as the code can be unique for each execution. The findings were part of broader research into how threat actors are weaponizing LLMs.<\/p>\n<h2 class=\"wp-block-heading\" id=\"h-a-new-generation-of-adaptable-threats\"><strong>A New Generation Of Adaptable Threats<\/strong><\/h2>\n<p>Unlike other adversarial uses of AI, such as creating convincing phishing emails or using AI software as a lure, LLM-enabled malware embeds the model\u2019s capabilities directly into its payload. This allows the malware to adapt its behavior based on the target environment.<\/p>\n<p>SentinelLABS researchers established a clear definition for this threat, distinguishing it from malware simply created <em>by<\/em> an LLM, which they note remains immature.<\/p>\n<p>The primary concern with LLM-enabled malware is its unpredictability. By offloading code generation to an LLM, the malware\u2019s actions can vary significantly, making it difficult for security tools to anticipate and block its behavior. <\/p>\n<p>Prior documented cases like <a href=\"https:\/\/cybersecuritynews.com\/first-ai-ransomware\/\" target=\"_blank\" rel=\"noreferrer noopener\">PromptLock<\/a>, a proof-of-concept ransomware, and LameHug (or PROMPTSTEAL), linked to the Russian APT28 group, demonstrated how LLMs could be used to generate system commands and exfiltrate data. These examples paved the way for hunting more advanced threats.<\/p>\n<p>The breakthrough came from a novel threat-hunting methodology developed by SentinelLABS. Instead of searching for malicious code, researchers hunted for the artifacts of LLM integration: embedded API keys and specific prompt structures.<\/p>\n<p>They wrote YARA rules to detect key patterns for major LLM providers like OpenAI and Anthropic. A year-long retrohunt on <a href=\"https:\/\/cybersecuritynews.com\/virustotal-shares-new-ideas\/\" target=\"_blank\" rel=\"noreferrer noopener\">VirusTotal<\/a> flagged over 7,000 samples with embedded keys, though most were non-malicious developer errors.<\/p>\n<p>The key to finding MalTerminal was focusing on samples with multiple API keys, a redundancy tactic for malware, and hunting for prompts with malicious intent.<\/p>\n<p>The researchers used an LLM classifier to score the maliciousness of discovered prompts. This strategy led them to a set of Python scripts and a Windows executable named <code>MalTerminal.exe<\/code>. <\/p>\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-large\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEhi8tUcSsXh9ON4ycX4-DpuNfADv-Hu3yoWJtOdzHKsnFFmQzv03XIUcHm8fbGRy4lG0OYlJNKbN_j7JPWghI7vMmfFGx11nLR79sDeVqZWPsgeXUSOMir0_gDb8-FEOhOaGV4K7TQ_mQIzW4MO1R0u5b10p_mkFUmT8TuICunsLkzefAMwj-CaVCrvDXSG\/s1767\/llm_enable_malware_1_imresizer.webp?ssl=1\" alt=\"\"><\/figure>\n<\/div>\n<p>Analysis indicated that it utilized a deprecated OpenAI chat completion API endpoint, which was retired in November 2023. This suggests the malware was developed prior to that date, making it the earliest known sample of its kind.<\/p>\n<p>MalTerminal prompts an operator to choose between deploying ransomware or a reverse shell, then uses GPT-4 to generate the necessary code.<\/p>\n<figure class=\"wp-block-table\">\n<table class=\"has-fixed-layout\">\n<thead>\n<tr>\n<th>File name<\/th>\n<th>Purpose<\/th>\n<th>Notes<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>MalTerminal.exe<\/td>\n<td>Malware<\/td>\n<td>Compiled Python2EXE sample:C:UsersPublicProjMalTerminal.py<\/td>\n<\/tr>\n<tr>\n<td>testAPI.py (1)<\/td>\n<td>Malware<\/td>\n<td>Malware generator Proof-of-Concept (PoC) scripts<\/td>\n<\/tr>\n<tr>\n<td>testAPI.py (2)<\/td>\n<td>Malware<\/td>\n<td>Malware generator PoC scripts<\/td>\n<\/tr>\n<tr>\n<td>TestMal2.py<\/td>\n<td>Malware<\/td>\n<td>An early version of MalTerminal<\/td>\n<\/tr>\n<tr>\n<td>TestMal3.py<\/td>\n<td>Defensive Tool<\/td>\n<td>\u201cFalconShield: A tool to analyze suspicious Python files.\u201d<\/td>\n<\/tr>\n<tr>\n<td>Defe.py (1)<\/td>\n<td>Defensive Tool<\/td>\n<td>\u201cFalconShield: A tool to analyze suspicious Python files.\u201d<\/td>\n<\/tr>\n<tr>\n<td>Defe.py (2)<\/td>\n<td>Defensive Tool<\/td>\n<td>\u201cFalconShield: A tool to analyze suspicious Python files.\u201d<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/figure>\n<h2 class=\"wp-block-heading\" id=\"h-cyber-defense-for-threats\">\n<strong>Cyber Defense<\/strong> <strong>for Threats<\/strong><br \/>\n<\/h2>\n<p>The emergence of malware like MalTerminal, <a href=\"https:\/\/cybersecuritynews.com\/first-ai-ransomware\/\" target=\"_blank\" rel=\"noreferrer noopener\">PromptLock<\/a>, and LameHug signals a new frontier in cyber defense. The primary challenge is that detection signatures can no longer rely on static malicious logic.<\/p>\n<p>Furthermore, network traffic to legitimate LLM APIs can be difficult to distinguish from malicious use. However, this new class of malware has its own weaknesses. Its dependency on external APIs and the need to embed API keys and prompts within its code create new opportunities for detection.<\/p>\n<p>If an API key is revoked, the malware can be neutralized. Researchers also discovered other offensive LLM tools, including vulnerability injectors and people search agents, by hunting for these artifacts. <\/p>\n<p>While LLM-enabled malware is still in an experimental stage, its development gives defenders a critical opportunity to adapt their strategies for a future where malicious code is generated on demand.<\/p>\n<p class=\"has-text-align-center has-background\" style=\"background:linear-gradient(180deg,rgb(238,238,238) 94%,rgb(169,184,195) 100%)\"><strong>Follow us on <a href=\"https:\/\/news.google.com\/publications\/CAAqMggKIixDQklTR3dnTWFoY0tGV041WW1WeWMyVmpkWEpwZEhsdVpYZHpMbU52YlNnQVAB?hl=en-IN&amp;gl=IN&amp;ceid=IN:en\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Google News<\/a>, <a href=\"https:\/\/www.linkedin.com\/company\/cybersecurity-news\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">LinkedIn<\/a>, and <a href=\"https:\/\/x.com\/cyber_press_org\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">X<\/a> for daily cybersecurity updates. <a href=\"https:\/\/cybersecuritynews.com\/contact-us\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Contact us<\/a> to feature your stories.<\/strong><\/p>\n<p>The post <a href=\"https:\/\/cybersecuritynews.com\/llm-enabled-malterminal-malware-gpt-4\/\">LLM-enabled MalTerminal Malware Leverages GPT-4 to Generate Ransomware Code<\/a> appeared first on <a href=\"https:\/\/cybersecuritynews.com\/\">Cyber Security News<\/a>.<\/p>\n<\/div>\n<p> \t<BR><br \/>\n <BR><\/BR><br \/>\n    Guru Baran<br \/>\n \t<BR><br \/>\n<BR><\/BR><br \/>\n<a href=\"https:\/\/cybersecuritynews.com\/llm-enabled-malterminal-malware-gpt-4\/\">Go to cyber-security-news<\/a><br \/>\n \t<BR><br \/>\n <BR><\/BR><\/p>\n","protected":false},"excerpt":{"rendered":"<p>LLM-enabled MalTerminal Malware Leverages GPT-4 to Generate Ransomware Code Cybersecurity researchers have identified what is believed to be the earliest known instance of malware that leverages a Large Language Model (LLM) to generate malicious code at runtime. Dubbed \u2018MalTerminal\u2019 by SentinelLABS, the malware uses OpenAI\u2019s GPT-4 to dynamically create ransomware code and reverse shells, presenting [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[129,63,258,231],"tags":[130],"class_list":["post-7568","post","type-post","status-publish","format-standard","hentry","category-cyber-security","category-cyber-security-news","category-malware","category-ransomware","tag-cyber-security-news"],"_links":{"self":[{"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/posts\/7568"}],"collection":[{"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/comments?post=7568"}],"version-history":[{"count":0,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/posts\/7568\/revisions"}],"wp:attachment":[{"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/media?parent=7568"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/categories?post=7568"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/tags?post=7568"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}