# PROMPTSTEAL / LAMEHUG LLM command-generating data miner

- ID: promptsteal-lamehug-apt28-2025-07
- Reported: 2025-07-17
- Researcher: CERT-UA; Google GTIG; Cato CTRL
- Organization: CERT-UA / Google GTIG
- AI role: llm_generated_malware (LLM-generated malware)
- Confidence in AI involvement: not assessed
- Research / borderline: false
- Last reviewed: 2026-10-20
- Entry page: https://openattacks.ai/attacks/promptsteal-lamehug-apt28-2025-07/
- Entry JSON: https://openattacks.ai/api/attacks/promptsteal-lamehug-apt28-2025-07.json
- Browse title: PROMPTSTEAL / LAMEHUG LLM-driven data miner (APT28)
- Editorial summary: Malware that asks a Hugging Face-hosted LLM for Windows recon and document-theft commands was used against Ukrainian government targets. GTIG calls it the first LLM-querying malware seen in live operations.
- Evidence class (catalog annotation): Reported campaign
- Source-stated target environments: Windows
- Stage hunts and conditional defenses: https://openattacks.ai/api/defenses/promptsteal-lamehug-apt28-2025-07.json

## Technique
Python/PyInstaller data miner queries Hugging Face API (Qwen2.5-Coder-32B-Instruct) to generate one-line Windows recon and document-collection commands, executes them, exfiltrates. Masquerades as image-generation tool. GTIG: first observed malware querying LLM in live ops.

## Stack relevance (editorial)
Assessment: mapped. Editorial applicability reviewed against the catalog source account; not a scan or independent incident verification.
First action: Investigate suspicious ZIP delivery, generated command execution and document exfiltration.
- Relationship: environment; tools: no specific product; OS scope: windows; requires existing MCP connections: false.
  Relevance: The reported data miner executes generated commands on Windows victim hosts.
  Condition to check: The actor uses an external LLM; being a user of that model service is not the victim condition.
  Evidence: https://cloud.google.com/blog/topics/threat-intelligence/threat-actor-usage-of-ai-tools/ ; https://www.catonetworks.com/blog/cato-ctrl-threat-research-analyzing-lamehug/ ; https://csirt.csi.cip.gov.ua/en/posts/apt28-targets-security-and-defence-sector-with-ai-powered-software
A product mention alone is not a victim-side applicability mapping. Selection does not verify affected versions, permissions or compromise.

## Initial access
Phishing emails with ZIP (Додаток.pdf.zip) impersonating ministry representative

## AI tooling and models
- [Qwen2.5-Coder-32B-Instruct](https://huggingface.co/Qwen/Qwen2.5-Coder-32B-Instruct) via [Hugging Face API](https://huggingface.co/) — Official model page; the former GitHub repository redirects to a newer model family.
- ~270 HF tokens per Cato analysis

## Other tooling
- [PyInstaller](https://github.com/pyinstaller/pyinstaller)
- SFTP or HTTP POST exfil (variant-dependent)

## Victims and sectors
Ukrainian government / security and defence sector

## Target geography
- Ukraine

## Attribution
APT28 / FROZENLAKE (GTIG); CERT-UA moderate confidence APT28

## Scale and metrics
Observed in operations mid-2025; continued sample development with obfuscation/C2 changes

## Attack flow
Catalog reconstruction of the supplied source account. Unknowns and research caveats are preserved.
### step-1: Phishing delivers a ZIP attachment [access]
The message impersonates a ministry representative.
Evidence: https://cloud.google.com/blog/topics/threat-intelligence/threat-actor-usage-of-ai-tools/ ; https://www.catonetworks.com/blog/cato-ctrl-threat-research-analyzing-lamehug/ ; https://csirt.csi.cip.gov.ua/en/posts/apt28-targets-security-and-defence-sector-with-ai-powered-software

### step-2: Miner queries a hosted code model [ai]
The executable requests Windows reconnaissance and collection commands through Hugging Face.
Evidence: https://cloud.google.com/blog/topics/threat-intelligence/threat-actor-usage-of-ai-tools/ ; https://www.catonetworks.com/blog/cato-ctrl-threat-research-analyzing-lamehug/ ; https://csirt.csi.cip.gov.ua/en/posts/apt28-targets-security-and-defence-sector-with-ai-powered-software

### step-3: Generated commands run on the host [execution]
The Python/PyInstaller malware executes the returned one-line commands.
Evidence: https://cloud.google.com/blog/topics/threat-intelligence/threat-actor-usage-of-ai-tools/ ; https://www.catonetworks.com/blog/cato-ctrl-threat-research-analyzing-lamehug/ ; https://csirt.csi.cip.gov.ua/en/posts/apt28-targets-security-and-defence-sector-with-ai-powered-software

### step-4: Documents and information are exfiltrated [impact]
The report links the data-mining campaign to Ukrainian government targets.
Evidence: https://cloud.google.com/blog/topics/threat-intelligence/threat-actor-usage-of-ai-tools/ ; https://www.catonetworks.com/blog/cato-ctrl-threat-research-analyzing-lamehug/ ; https://csirt.csi.cip.gov.ua/en/posts/apt28-targets-security-and-defence-sector-with-ai-powered-software

Connections:
- step-1 -> step-2
- step-2 -> step-3
- step-3 -> step-4

## Stage defense and hunting recommendations
Editorial recommendations, not validated coverage. Source-controlled query starters are drafts. Custom-schema examples require telemetry collection and field mapping; absence of a mapping means not assessed. MagicSword policy opportunities require managed Windows scope and enforcement.
### step-1: Lure → user action / delivery
- Visibility: Defender-side logs where collected
- Query origin: catalog_authored; status: draft; log scope: custom_schema
- SIGMA query download: /api/detections/phishing.sigma.yml
- KQL query download: /api/detections/phishing.kql
- SPL query download: /api/detections/phishing.spl
- Hunt hypothesis: An impersonating message, ad or website leads to a suspicious download, consent request, pasted command or payment instruction.
- Required telemetry: Email / secure-web-gateway records; Browser redirects, downloads and URL reputation; User reports and downstream execution / identity events
- Investigate: Reconstruct redirect and delivery provenance using original report indicators, without visiting payload URLs.
- Investigate: Correlate the click with the actual download, consent or execution; verify the sender through an independent channel.
- Limitation: Polished text, AI branding and a novel domain do not prove maliciousness or AI generation. Follow-on evidence matters.
- No direct MagicSword prevention claim is recorded for this stage.

### step-2: Unexpected process → model service
- Visibility: Defender-side logs where collected
- Query origin: catalog_authored; status: draft; log scope: custom_schema
- SIGMA query download: /api/detections/model-network.sigma.yml
- KQL query download: /api/detections/model-network.kql
- SPL query download: /api/detections/model-network.spl
- Hunt hypothesis: An unexpected script, implant or local model client communicates with a model service near command execution, collection or file modification.
- Required telemetry: Per-process network / DNS records; AI-service request logs where available; Process and file behavior on the calling host
- Investigate: Join the network connection to the process tree and the actions before and after the response.
- Investigate: Compare with approved AI integrations; inspect local model listeners for PoCs that do not use a hosted API.
- Limitation: Connecting to a legitimate model domain does not establish malicious use or reveal returned code. Local / in-process models can evade network-only hunts.
- No direct MagicSword prevention claim is recorded for this stage.

### step-3: Suspicious Windows script execution
- Visibility: Defender-side logs where collected
- Query origin: catalog_authored; status: draft; log scope: native
- SIGMA query download: /api/detections/windows-shell.sigma.yml
- KQL query download: /api/detections/windows-shell.kql
- SPL query download: /api/detections/windows-shell.spl
- Hunt hypothesis: A script host or shell runs encoded content, a remote URL, or inline script syntax, then downloads or launches a payload.
- Required telemetry: Windows process creation: Sysmon Event 1 or Defender DeviceProcessEvents; PowerShell script-block logging when enabled; Download / network and installer events
- Investigate: Follow the parent and child process tree and recover the script or URL from logs without executing it.
- Investigate: Correlate the payload's signer/hash, persistence, and network activity; baseline approved automation.
- Limitation: Encoded commands and remote administration can be legitimate. This does not cover every script host, in-process execution, or non-Windows branch.
- Conditional MagicSword policy: Use MagicSword to audit the actual executable's signer, publisher or hash, then enforce a policy that denies unapproved code on managed Windows hosts.
- Policy scope: The Windows Python / PyInstaller payload if an enforced policy denies that payload. Permitted interpreters can still execute generated commands.
- Policy limitation: Policy opportunity, not tested incident coverage. Requires enrolled Windows devices, a policy covering the actual executable, and enforcement. Audit mode records decisions without blocking; allowed tools and in-process / cloud actions can remain reachable.
- Policy reference: https://www.magicsword.io/use-cases/application-control?utm_source=openattacks&utm_medium=referral&utm_content=stage-control

### step-4: Sensitive data → unusual destination
- Visibility: Defender-side logs where collected
- Query origin: catalog_authored; status: draft; log scope: custom_schema
- SIGMA query download: /api/detections/exfil.sigma.yml
- KQL query download: /api/detections/exfil.kql
- SPL query download: /api/detections/exfil.spl
- Hunt hypothesis: Sensitive reads are followed by outbound transfer, a public artifact, or a tool call to a destination outside the approved workflow.
- Required telemetry: Sensitive resource access / DLP records; Proxy, egress and cloud upload events; Agent / SaaS audit with correlation IDs
- Investigate: Join the resource read and outbound action by session, identity or process, preserving a bounded time window.
- Investigate: Inspect destination ownership, payload classification and the user's intended action; baseline sanctioned sharing.
- Limitation: An outbound connection or high byte count alone is not exfiltration. Encrypted traffic may hide content, and bulk legitimate exports are common.
- No direct MagicSword prevention claim is recorded for this stage.


## MITRE ATLAS
Mappings are catalog annotations based on described behavior, not assignments or endorsements by MITRE.
- AML.T0102: Generate Malicious Commands — The miner generates collection commands using a hosted Qwen model.
  Technique: https://atlas.mitre.org/techniques/AML.T0102
  Evidence: https://cloud.google.com/blog/topics/threat-intelligence/threat-actor-usage-of-ai-tools/ ; https://www.catonetworks.com/blog/cato-ctrl-threat-research-analyzing-lamehug/ ; https://csirt.csi.cip.gov.ua/en/posts/apt28-targets-security-and-defence-sector-with-ai-powered-software

## Defensive notes
Block unexpected Hugging Face API from endpoints; detect PyInstaller 'image gen' lures; app control on unexpected recon binaries

## Sources
- https://cloud.google.com/blog/topics/threat-intelligence/threat-actor-usage-of-ai-tools/
- https://www.catonetworks.com/blog/cato-ctrl-threat-research-analyzing-lamehug/
- https://csirt.csi.cip.gov.ua/en/posts/apt28-targets-security-and-defence-sector-with-ai-powered-software
