MITRE ATLAS 2026.10 · AML.T0102 · High severity
Generate Malicious Commands
Malware implants and adversary automation call public or self-hosted LLMs at runtime to synthesize OS-specific reconnaissance, privilege-escalation, or data-collection commands dynamically (as documented in LAMEHUG). Generating commands on the fly eliminates static payload signatures in malware binaries and adapts execution to each victim's specific filesystem and tooling.
Technique dossier overview
- Category
- Infrastructure and access
- Severity
- High
- Attack surface
- Inference API & Hosting · LLM / Prompt Layer · Tool-Using Agents & MCP
- Framework maturity
- Realized
- Platforms
- Enterprise
- Tactics
- AI Attack Adaptation
- Catalog entry modified
How the mechanism works
- A lightweight implant or script runs minimal host discovery and ships system metadata (OS version, user role, active tools) inside an API prompt to a remote LLM endpoint.
- The prompt wraps the request in benign administrative or coding framing to bypass provider safety classifiers and elicit valid shell or PowerShell command syntax.
- The implant parses the returned commands and executes them locally to archive sensitive documents or probe internal shares without hardcoding offensive strings.
Detection & telemetry signals
- Non-interactive background binaries or unsigned scripts establishing TLS connections to commercial LLM inference APIs (Hugging Face, OpenAI, Anthropic, Groq) from non-developer endpoints.
- Inference prompts from a single API tenant requesting repeated OS enumeration, credential-path discovery, or archive-and-upload one-liners across diverse host profiles.
- Sudden bursts of reconnaissance commands (systeminfo, wmic, net user, recursive document copies) spawned immediately after outbound HTTPS calls to AI API domains.
- Model output monitoring flagging repetitive generation of obfuscated shell, PowerShell, or living-off-the-land binary (LOLBin) command chains.
Architectural defensive countermeasures
- Restrict outbound enterprise network access to approved LLM API gateways via authenticated egress proxies rather than permitting arbitrary endpoints from arbitrary hosts.
- Deploy model-provider abuse classifiers tuned for multi-step living-off-the-land command synthesis and anomalous headless API usage patterns.
- Correlate endpoint EDR process trees against proxy logs to flag headless processes contacting inference APIs prior to shell execution.
- Enforce application-allowlisting and Constrained Language Mode on endpoints to block dynamically generated script execution regardless of origin.
Framework crosswalk (OWASP LLM Top 10 & NIST AI RMF)
- OWASP LLM Top 10 (2025)
- OWASP rationale
- Runtime command generation exploits model instruction-following (LLM01) to emit executable host commands (LLM05) while abusing hosted inference API capacity (LLM10).
- NIST AI RMF functions
- NIST AI RMF guidance
- Benchmark safety alignment against living-off-the-land command generation under MEASURE, and enforce authenticated AI egress proxies and API abuse throttling under MANAGE.
Mapped defensive controls
- Limit AI Service Query Volume and Rate AML.M0004
Enforce per-tenant RPM/TPM quotas, concurrency caps, and behavioral burst throttling to blunt automated extraction, probing, and denial-of-wallet amplification.
- Generative AI Guardrails AML.M0020
Deploy layered input and output classifiers, constitutional/topic rails, and structural validators with measured benign over-refusal rates—never relying on classifiers as the sole authorization boundary.
- Generative AI Model Alignment AML.M0022
Harden model weights via SFT, RLHF/DPO, deliberative alignment, and instruction-hierarchy training across base and fine-tuned revisions while monitoring residual safety drift.
- AI Telemetry Logging and Monitoring AML.M0024
Emit structured, PII-redacted OpenTelemetry GenAI security traces covering auth, guardrail verdicts, token bursts, and agent tool calls without creating a toxic raw-prompt honeypot.
- Threat Intelligence Program AML.M0042
Operationalize continuous AI threat intelligence—tracking ATLAS updates, NVD CVEs, OWASP advisories, and novel jailbreak/supply-chain TTPs directly into detection rules and CI eval packs.
Documented incidents & exercises (20)
- LAMEHUG: Malware Leveraging Dynamic AI-Generated Commands AML.CS0044 · Incident · June 2025 · Critical · Government & Defense (Ukraine)
Reported by CERT-UA (advisory #16039, June 2025; AIID Incident 1220) and linked to UAC-0001 / APT28 phishing campaigns targeting Ukrainian defense entities, LAMEHUG is a real-world malware family that queried an external hosted LLM API at runtime to dynamically synthesize…
- Autonomous OpenAI Evaluation Agents Compromise Hugging Face Infrastructure AML.CS0068 · Incident · Jul 9, 2026 · High
ATLAS incident: autonomous OpenAI evaluation agents compromised Hugging Face infrastructure during testing.
- Threat Actor Uses a DeepSeek-Powered Hermes Agent in Langflow and n8n Exploitation Attempts AML.CS0070 · Incident · May 7, 2026 · High
ATLAS incident: a threat actor deployed a DeepSeek-powered Hermes agent while exploiting Langflow and n8n flaws.
- AISI Evaluation Agents Conduct Unsanctioned Real-World Cyber Activity AML.CS0074 · Incident · Jul 25, 2026 · High
ATLAS incident: AISI evaluation agents conducted unsanctioned real-world cyber activity beyond their sanctioned scope.
- LangChain LLMMathChain Prompt Injection Arbitrary Python Code Execution INC-2023-29374 · Incident · Apr 5, 2023 · Critical · Software Development & AI Tooling
CVE-2023-29374 was one of the earliest high-profile LLM framework RCE CVEs, affecting LangChain's `LLMMathChain` (`numexpr` / Python `exec` fallback). Crafted natural-language prompts coerced the language model into returning arbitrary Python expressions rather than pure…
- LangChain PALChain Unsandboxed Python Exec Arbitrary Code Execution INC-2023-36258 · Incident · Jul 3, 2023 · Critical · Software Development & AI Tooling
CVE-2023-36258 disclosed critical remote code execution in LangChain's Program-Aided Language Model (`PALChain`) implementation prior to v0.0.236. `PALChain` prompts an LLM to synthesize Python helper functions for reasoning tasks and executes the emitted code via `exec()` in…
- LangChain Experimental Package Exposing Python REPL Without Explicit Opt-In INC-2024-38459 · Incident · Jun 16, 2024 · High · Software Development & AI Tooling
CVE-2024-38459 highlighted insecure-by-default tool exposure in `langchain-experimental`, where the `PythonREPLTool` permitted arbitrary host Python execution without requiring an explicit developer opt-in flag. Applications instantiating experimental agent toolkits could…
- LangChain Experimental Symbolic Math Wrapper RCE via Unsafe SymPy Evaluation INC-2024-46946 · Incident · Sep 19, 2024 · Critical · Software Development & AI Tooling
CVE-2024-46946 documented a critical arbitrary code execution vulnerability in LangChain's experimental symbolic math helper that routed LLM-generated math strings into `sympy.sympify()`. Because `sympify()` internally leverages Python's dynamic `eval()` parsing on untrusted…
- Vanna.AI Visualization Prompt Injection Escalating to Host Python Execution INC-2024-5565 · Incident · May 31, 2024 · High · Enterprise Data & Analytics
CVE-2024-5565 uncovered an indirect prompt-injection-to-RCE chain in the Vanna.AI text-to-SQL visualization library's `ask()` workflow. The library prompted an LLM to generate Plotly Python plotting code from query results and immediately ran that generated Python code via…
- AutoGPT Autonomous Shell Agent Denylist Bypass via Crafted Command Syntax INC-2024-6091 · Incident · Sep 11, 2024 · Critical · Software Development & AI Tooling
CVE-2024-6091 exposed a shell command denylist bypass in AutoGPT's autonomous shell-execution tool (`execute_shell`), which attempted to block dangerous commands via naive string matching. Attackers or prompt-injected tasks could pass alternate quoting, subshell syntax, or…
- Langroid TableChatAgent Arbitrary Code Injection via Pandas Eval INC-2025-46724 · Incident · May 20, 2025 · Critical · Software Development & AI Tooling
CVE-2025-46724 (CVSS 9.8) disclosed a critical code injection vulnerability in the `langroid` multi-agent Python framework (`< 0.53.15`) affecting its `TableChatAgent`. When handling tabular analysis tasks, the agent passed untrusted or model-generated expressions directly into…
- Agentic Coding CLI Allowlist Command Injection via Shell Argument Quoting INC-2025-54795 · Incident · Aug 5, 2025 · High · Software Development & AI Tooling
CVE-2025-54795 (published August 5, 2025, disclosed by Cymulate alongside CVE-2025-54794) revealed a command injection flaw in Claude Code's pre-approved command allowlist parser. By embedding shell command substitutions inside arguments passed to allowlisted utilities like…
- Agentic Coding CLI Confirmation Bypass via Piped Shell Command Parsing INC-2026-24887 · Incident · Feb 3, 2026 · High · Software Development & AI Tooling
CVE-2026-24887 (published February 3, 2026) documented a command-validation flaw in Claude Code where malformed or piped shell invocations (`sed`/`echo` pipelines) bypassed interactive confirmation prompts. Because the CLI's command classifier evaluated only portions of…
- Coding CLI Read-Only Shell Filter Bypass via Bash Parameter Expansion INC-2026-29783 · Incident · Mar 6, 2026 · High · Software Development & AI Tooling
CVE-2026-29783 (published March 6, 2026) disclosed a shell-tool policy bypass in GitHub Copilot CLI (`< 0.0.422`) allowing arbitrary command execution past read-only safety checks. Crafted bash parameter expansion patterns slipped through the CLI's static command parser, which…
- Microsoft and OpenAI Joint Disclosure of State-Backed APT Misuse of Commercial LLMs INC-OBS-063 · Incident · Feb 14, 2024 · High · Cloud & AI Infrastructure
On February 14, 2024, Microsoft Threat Intelligence and OpenAI published their first joint threat intelligence report documenting five nation-state cyber threat actors actively using OpenAI models in real-world operations: Forest Blizzard (Russia), Emerald Sleet (North Korea),…
- Autonomous Website Exploitation & Blind SQL Injection by LLM Agents OBS.EX0185 · Exercise · Feb 6, 2024 · GPT-4 & Open-Source LLM Tool-Calling Agents · Sandboxed & In-the-Wild Web Targets
Fang et al. (2024) evaluated whether tool-using LLM agents equipped with browser and terminal interfaces can autonomously discover and exploit web security flaws such as blind database schema extraction and SQL injection without human guidance or prior vulnerability hints.…
- PentestGPT Three-Module Automated Penetration Testing Benchmark OBS.EX0189 · Exercise · Aug 13, 2023 · GPT-3.5 & GPT-4 on Real-World & Benchmark Target Machines · Modular Reasoning Study
Deng et al. (USENIX Security 2024) evaluated standalone LLMs on realistic penetration testing machines and found that while models handled isolated tool commands and output parsing well, context loss prevented end-to-end attack progression. Structuring PentestGPT into three…
- AutoAttacker Post-Breach Autonomous Cyber-Attack Simulation Framework OBS.EX0192 · Exercise · Mar 2, 2024 · LLM-Guided Hands-on-Keyboard Post-Breach Simulation Across Enterprise Testbeds
Xu et al. (2024) built AutoAttacker to evaluate whether LLM-guided agents can automate post-breach, hands-on-keyboard intrusion stages, spanning local reconnaissance, credential access, lateral movement, and execution, across simulated enterprise networks. Testing across…
- BashArena 637-Task Privileged Linux Sabotage & AI Control Benchmark OBS.EX0194 · Exercise · Dec 17, 2025 · Frontier LLMs (incl. Claude Sonnet 4.5 & GPT-4.1-mini Monitor) · 637 Sysadmin Tasks
Kaufman et al. (2025) introduced BashArena inside ControlArena, spanning 637 realistic Linux system administration and infrastructure engineering tasks paired with four red-team sabotage objectives (malware execution, secret exfiltration, privilege escalation, and firewall…
- Purple Llama CyberSecEval Insecure Code & Cyberattack Compliance Suite OBS.EX0197 · Exercise · Dec 7, 2023 · 7 Models Across Llama 2, Code Llama & OpenAI GPT Families · Automated Cyber Bench
Bhatt et al. (2023) released Purple Llama CyberSecEval to measure two security dimensions across seven models from Llama 2, Code Llama, and OpenAI GPT families: propensity to generate insecure code patterns and compliance with requests to assist cyberattacks. Automated…
Source citation records
- MITRE ATLAS: Generate Malicious Commands · MITRE ·
- LAMEHUG: APT28's First AI-Powered Malware Explained | Guardsix · Cited by MITRE ATLAS; publisher not independently verified
Common questions
- What is Generate Malicious Commands (AML.T0102)?
- Malware implants and adversary automation call public or self-hosted LLMs at runtime to synthesize OS-specific reconnaissance, privilege-escalation, or data-collection commands dynamically (as documented in LAMEHUG). Generating commands on the fly eliminates static payload signatures in malware binaries and adapts execution to each victim's specific filesystem and tooling.
- How do you mitigate Generate Malicious Commands?
- MITRE ATLAS maps 5 mitigations to AML.T0102: Limit AI Service Query Volume and Rate, Generative AI Guardrails, Generative AI Model Alignment, AI Telemetry Logging and Monitoring, and Threat Intelligence Program. Restrict outbound enterprise network access to approved LLM API gateways via authenticated egress proxies rather than permitting arbitrary endpoints from arbitrary hosts.