Detection queries Reported campaignWindows

PROMPTSTEAL / LAMEHUG LLM-driven data miner (APT28)

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.

What happened

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.

LLM-driven malware: queries remote LLM at runtime to generate OS commands (just-in-time)

Read the original sourceAdditional source: catonetworks.comAdditional source: csirt.csi.cip.gov.ua

How it happened

Select a stage to explore its defenses MagicSword policy opportunity
Detect this stage
Detect this stage
MagicSword Detect this stage
Detect this stage
Select a stage · Drag to explore · + / − to zoom · Dashed edges are loopsSelect a stage · Arrows show reported connectionsReported sequence
Read the flow as text & sources

A catalog reconstruction of the supplied source account. Unknown steps remain explicit; an edge describes the reported relationship between steps.

  1. 01 · Phishing delivers a ZIP attachment

    The message impersonates a ministry representative.

    Hunt: An impersonating message, ad or website leads to a suspicious download, consent request, pasted command or payment instruction.

    Polished text, AI branding and a novel domain do not prove maliciousness or AI generation. Follow-on evidence matters.

    Source for step 1
  2. 02 · Miner queries a hosted code model

    The executable requests Windows reconnaissance and collection commands through Hugging Face.

    Hunt: An unexpected script, implant or local model client communicates with a model service near command execution, collection or file modification.

    Connecting to a legitimate model domain does not establish malicious use or reveal returned code. Local / in-process models can evade network-only hunts.

    Source for step 2
  3. 03 · Generated commands run on the host

    The Python/PyInstaller malware executes the returned one-line commands.

    Hunt: A script host or shell runs encoded content, a remote URL, or inline script syntax, then downloads or launches a payload.

    Encoded commands and remote administration can be legitimate. This does not cover every script host, in-process execution, or non-Windows branch.

    MagicSword policy opportunity · The Windows Python / PyInstaller payload if an enforced policy denies that payload. Permitted interpreters can still execute generated commands.

    Source for step 3
  4. 04 · Documents and information are exfiltrated

    The report links the data-mining campaign to Ukrainian government targets.

    Hunt: Sensitive reads are followed by outbound transfer, a public artifact, or a tool call to a destination outside the approved workflow.

    An outbound connection or high byte count alone is not exfiltration. Encrypted traffic may hide content, and bulk legitimate exports are common.

    Source for step 4

Why it matters

Reported entry point: Phishing emails with ZIP (Додаток.pdf.zip) impersonating ministry representative. Reported impact: The report links the data-mining campaign to Ukrainian government targets; reported targets include Ukrainian government / security and defence sector.

Check these source-linked conditions against your setup.

Windows

The reported data miner executes generated commands on Windows victim hosts.

Conditions to check
  • The actor uses an external LLM; being a user of that model service is not the victim condition.

Source-linked applicability guidance. Confirm current scope in the original report.

Read the original report

What you can do

Protection & prevention

Start here

Investigate suspicious ZIP delivery, generated command execution and document exfiltration.

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

Catalog defensive guidance based on the reported behavior. Confirm scope and current mitigations in the original source.

Review the original guidance Additional source 2 Additional source 3
Explore scoped MagicSword policy options

Requires an enforced Windows policy covering the actual executable. Audit mode records events without blocking.

Deny an unapproved executable

Use MagicSword to audit the actual executable's signer, publisher or hash, then enforce a policy that denies unapproved code on managed Windows hosts.

Applies to: The Windows Python / PyInstaller payload if an enforced policy denies that payload. Permitted interpreters can still execute generated commands.

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.

Explore the policy control View mapped attack stage
Investigate each phase

Detection queries

Draft query starters grouped by the attack stages where they apply.

Download stage pack

Start with the logs you collect. Each hunt identifies its required visibility, field mapping and limits. Queries are catalog-authored drafts using reusable behavior profiles; test with known activity and your normal baseline before alerting.

01Phishing delivers a ZIP attachmentLure → user action / deliveryCustom schema · Draft

The message impersonates a ministry representative.

What to look for

An impersonating message, ad or website leads to a suspicious download, consent request, pasted command or payment instruction.

Visibility: Defender-side logs where collected

Required logs

  • Email / secure-web-gateway records
  • Browser redirects, downloads and URL reputation
  • User reports and downstream execution / identity events

Coverage limit. Polished text, AI branding and a novel domain do not prove maliciousness or AI generation. Follow-on evidence matters.

Custom-schema candidates, not out-of-box detectors. Map your application / cloud / platform logs to EventType, Actor, Asset, Action, Target and CorrelationId. KQL uses a custom OpenAttacksAudit_CL table; SPL uses openattacks:audit. EventType values are proposed normalization names, not native vendor event names. Correlation and environment-specific alert logic remain to be built.

Sigma
Draft SigmaDownload Sigma
title: Hunt - Lure → user action / delivery
id: e0056b49-9905-485b-ac12-2aa076a7bc82
status: experimental
description: An impersonating message, ad or website leads to a suspicious
  download, consent request, pasted command or payment instruction.
author: MagicSword OpenAttacks catalog
date: 2026-10-23
falsepositives:
  - Authorized activity matching this broad hunt; baseline and investigate
    before alerting.
level: low
logsource:
  category: application
  product: openattacks_audit
  definition: Custom normalized audit schema; map EventType, Actor, Asset, Action,
    Target and CorrelationId from the required source logs first.
detection:
  selection:
    EventType:
      - message.link.click
      - web.download
  condition: selection
KQL
Draft KQLDownload KQL
// SCHEMA TEMPLATE: create/map this custom table before use; not a built-in Sentinel table.
// OpenAttacksAudit_CL: TimeGenerated(datetime), EventType/Actor/Asset/Action/Target/CorrelationId(string).
// Selects candidates only. Apply the stage hypothesis and correlation steps before alerting.
OpenAttacksAudit_CL
| where TimeGenerated > ago(7d)
| where EventType in ("message.link.click", "web.download")
| project TimeGenerated, EventType, Actor, Asset, Action, Target, CorrelationId
| order by TimeGenerated desc
SPL
Draft SPLDownload SPL
sourcetype="openattacks:audit"
EventType IN ("message.link.click", "web.download")
| table _time EventType Actor Asset Action Target CorrelationId
| sort - _time
Investigation steps
  1. Reconstruct redirect and delivery provenance using original report indicators, without visiting payload URLs.
  2. Correlate the click with the actual download, consent or execution; verify the sender through an independent channel.
02Miner queries a hosted code modelUnexpected process → model serviceCustom schema · Draft

The executable requests Windows reconnaissance and collection commands through Hugging Face.

What to look for

An unexpected script, implant or local model client communicates with a model service near command execution, collection or file modification.

Visibility: Defender-side logs where collected

Required logs

  • Per-process network / DNS records
  • AI-service request logs where available
  • Process and file behavior on the calling host

Coverage limit. Connecting to a legitimate model domain does not establish malicious use or reveal returned code. Local / in-process models can evade network-only hunts.

Custom-schema candidates, not out-of-box detectors. Map your application / cloud / platform logs to EventType, Actor, Asset, Action, Target and CorrelationId. KQL uses a custom OpenAttacksAudit_CL table; SPL uses openattacks:audit. EventType values are proposed normalization names, not native vendor event names. Correlation and environment-specific alert logic remain to be built.

Sigma
Draft SigmaDownload Sigma
title: Hunt - Unexpected process → model service
id: 8560daf7-ecd1-4f2b-ad09-b794bb56a394
status: experimental
description: An unexpected script, implant or local model client communicates
  with a model service near command execution, collection or file modification.
author: MagicSword OpenAttacks catalog
date: 2026-10-23
falsepositives:
  - Authorized activity matching this broad hunt; baseline and investigate
    before alerting.
level: low
logsource:
  category: application
  product: openattacks_audit
  definition: Custom normalized audit schema; map EventType, Actor, Asset, Action,
    Target and CorrelationId from the required source logs first.
detection:
  selection:
    EventType:
      - model.connection
      - model.invoke
  condition: selection
KQL
Draft KQLDownload KQL
// SCHEMA TEMPLATE: create/map this custom table before use; not a built-in Sentinel table.
// OpenAttacksAudit_CL: TimeGenerated(datetime), EventType/Actor/Asset/Action/Target/CorrelationId(string).
// Selects candidates only. Apply the stage hypothesis and correlation steps before alerting.
OpenAttacksAudit_CL
| where TimeGenerated > ago(7d)
| where EventType in ("model.connection", "model.invoke")
| project TimeGenerated, EventType, Actor, Asset, Action, Target, CorrelationId
| order by TimeGenerated desc
SPL
Draft SPLDownload SPL
sourcetype="openattacks:audit"
EventType IN ("model.connection", "model.invoke")
| table _time EventType Actor Asset Action Target CorrelationId
| sort - _time
Investigation steps
  1. Join the network connection to the process tree and the actions before and after the response.
  2. Compare with approved AI integrations; inspect local model listeners for PoCs that do not use a hosted API.
03Generated commands run on the hostSuspicious Windows script executionNative logs · Draft

The Python/PyInstaller malware executes the returned one-line commands.

What to look for

A script host or shell runs encoded content, a remote URL, or inline script syntax, then downloads or launches a payload.

Visibility: Defender-side logs where collected

Required logs

  • Windows process creation: Sysmon Event 1 or Defender DeviceProcessEvents
  • PowerShell script-block logging when enabled
  • Download / network and installer events

Coverage limit. Encoded commands and remote administration can be legitimate. This does not cover every script host, in-process execution, or non-Windows branch.

Windows process candidates. Sigma uses normalized process_creation fields; KQL requires Defender for Endpoint; SPL requires the Sysmon XML sourcetype. Tune collectors, fields and baselines before use.

Sigma
Draft SigmaDownload Sigma
title: Hunt - Suspicious Windows script execution
id: 2bb88802-9f03-4d99-a192-fe44c9484e8b
status: experimental
description: A script host or shell runs encoded content, a remote URL, or
  inline script syntax, then downloads or launches a payload.
author: MagicSword OpenAttacks catalog
date: 2026-10-23
falsepositives:
  - Authorized activity matching this broad hunt; baseline and investigate
    before alerting.
level: low
logsource:
  category: process_creation
  product: windows
detection:
  selection:
    Image|endswith:
      - \powershell.exe
      - \pwsh.exe
      - \mshta.exe
      - \wscript.exe
      - \cscript.exe
    CommandLine|contains:
      - -enc
      - http
      - FromBase64String
      - "javascript:"
      - "vbscript:"
  condition: selection
KQL
Draft KQLDownload KQL
// Draft hunt; requires Defender for Endpoint process telemetry for this OS.
DeviceProcessEvents
| where Timestamp > ago(7d)
| where FileName in~ ("powershell.exe", "pwsh.exe", "mshta.exe", "wscript.exe", "cscript.exe")
| where ProcessCommandLine contains "-enc" or ProcessCommandLine contains "http" or ProcessCommandLine contains "FromBase64String" or ProcessCommandLine contains "javascript:" or ProcessCommandLine contains "vbscript:"
| project Timestamp, DeviceName, AccountName, FileName, ProcessCommandLine, InitiatingProcessFileName, InitiatingProcessCommandLine, SHA1
| order by Timestamp desc
SPL
Draft SPLDownload SPL
sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational" EventCode=1
Image IN ("*\\powershell.exe", "*\\pwsh.exe", "*\\mshta.exe", "*\\wscript.exe", "*\\cscript.exe")
CommandLine IN ("*-enc*", "*http*", "*FromBase64String*", "*javascript:*", "*vbscript:*")
| table _time host User Image CommandLine ParentImage ParentCommandLine
| sort - _time
Investigation steps
  1. Follow the parent and child process tree and recover the script or URL from logs without executing it.
  2. Correlate the payload's signer/hash, persistence, and network activity; baseline approved automation.
04Documents and information are exfiltratedSensitive data → unusual destinationCustom schema · Draft

The report links the data-mining campaign to Ukrainian government targets.

What to look for

Sensitive reads are followed by outbound transfer, a public artifact, or a tool call to a destination outside the approved workflow.

Visibility: Defender-side logs where collected

Required logs

  • Sensitive resource access / DLP records
  • Proxy, egress and cloud upload events
  • Agent / SaaS audit with correlation IDs

Coverage limit. An outbound connection or high byte count alone is not exfiltration. Encrypted traffic may hide content, and bulk legitimate exports are common.

Custom-schema candidates, not out-of-box detectors. Map your application / cloud / platform logs to EventType, Actor, Asset, Action, Target and CorrelationId. KQL uses a custom OpenAttacksAudit_CL table; SPL uses openattacks:audit. EventType values are proposed normalization names, not native vendor event names. Correlation and environment-specific alert logic remain to be built.

Sigma
Draft SigmaDownload Sigma
title: Hunt - Sensitive data → unusual destination
id: 04b60968-3179-4b1f-ae13-6f57c2446077
status: experimental
description: Sensitive reads are followed by outbound transfer, a public
  artifact, or a tool call to a destination outside the approved workflow.
author: MagicSword OpenAttacks catalog
date: 2026-10-23
falsepositives:
  - Authorized activity matching this broad hunt; baseline and investigate
    before alerting.
level: low
logsource:
  category: application
  product: openattacks_audit
  definition: Custom normalized audit schema; map EventType, Actor, Asset, Action,
    Target and CorrelationId from the required source logs first.
detection:
  selection:
    EventType:
      - data.export
      - agent.external.send
  condition: selection
KQL
Draft KQLDownload KQL
// SCHEMA TEMPLATE: create/map this custom table before use; not a built-in Sentinel table.
// OpenAttacksAudit_CL: TimeGenerated(datetime), EventType/Actor/Asset/Action/Target/CorrelationId(string).
// Selects candidates only. Apply the stage hypothesis and correlation steps before alerting.
OpenAttacksAudit_CL
| where TimeGenerated > ago(7d)
| where EventType in ("data.export", "agent.external.send")
| project TimeGenerated, EventType, Actor, Asset, Action, Target, CorrelationId
| order by TimeGenerated desc
SPL
Draft SPLDownload SPL
sourcetype="openattacks:audit"
EventType IN ("data.export", "agent.external.send")
| table _time EventType Actor Asset Action Target CorrelationId
| sort - _time
Investigation steps
  1. Join the resource read and outbound action by session, identity or process, preserving a bounded time window.
  2. Inspect destination ownership, payload classification and the user's intended action; baseline sanctioned sharing.
Technical detailsTooling, impact & MITRE ATLAS

Attack context

AI's role
LLM-generated malware
Initial access
Phishing emails with ZIP (Додаток.pdf.zip) impersonating ministry representative

Tooling as reported

AI products, models and artifacts

Other tooling

Targets and reported impact

Targets / sectors
Ukrainian government / security and defence sector
Reported scale / exposure
Observed in operations mid-2025; continued sample development with obfuscation/C2 changes
Target geography
Ukraine

Reported attribution

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

Structured attribution

Actor
APT28
Aliases
FROZENLAKE
Country
Russia
Motivation
nation-state
Attributed by
Google GTIG, CERT-UA
Attribution confidence
medium

Detection rules

  • Detect Hugging Face API connections from endpointsGUIDANCE

    Monitor outbound HTTPS connections to Hugging Face API endpoints (api-inference.huggingface.co) from workstations and servers. Legitimate developer activity is expected; focus on unexpected or unauthorized hosts.

  • PyInstaller executable masquerading as image toolsGUIDANCE

    Detect PyInstaller-packaged executables with image generation or graphics tool names that make unexpected network connections to AI model APIs.

Linked threat actors

Source defensive notes

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

MITRE ATLAS

AI-specific catalog annotations based on the reported behavior; these are not MITRE case-study assignments.

AML.T0102Generate Malicious Commands

The miner generates collection commands using a hosted Qwen model. Source

Sources & research credit

3 sources

Research by CERT-UA; Google GTIG; Cato CTRL · CERT-UA / Google GTIG

  1. cloud.google.com
  2. catonetworks.com
  3. csirt.csi.cip.gov.ua
Record & downloads
Source record name
PROMPTSTEAL / LAMEHUG LLM command-generating data miner
Entry ID
promptsteal-lamehug-apt28-2025-07
Catalog review
October 20, 2026
Category
adversary-use-of-ai
AI involvement confidence
confirmed