LameHug is a newly identified Python-based infostealer linked to the Russian state-sponsored group APT28 (aka Fancy Bear/Sofacy). Discovered in mid-2025 by Ukraine’s CERT, it represents the first publicly documented case of malware operationally integrating a Large Language Model (LLM) to assist with attacker tasks.
APT28, long known for custom malware and spear-phishing operations, deployed LameHug in a campaign targeting Ukrainian government agencies amid the ongoing Russo-Ukrainian conflict. The malware’s integration of real-time AI-generated commands allows it to adapt to the target environment without updating the binary, a major shift in attacker tradecraft.
The campaign began with spear-phishing emails sent from a compromised Ukrainian ministry account, targeting security and defense sector entities. Disguised as official correspondence, the messages contained a ZIP archive named Appendix.pdf.zip (or Dodatok.pdf.zip in Ukrainian).
Inside was a .pif executable, an outdated Windows file type made to look like a PDF icon, packaged with PyInstaller and containing the LameHug payload. This double-extension masquerade (MITRE T1036) and the use of a legitimate hijacked account (MITRE T1586) align with APT28’s established phishing methods.
When executed, the payload ran Python-based code in memory (MITRE T1059.006). No persistence mechanisms were observed; instead, LameHug performed a rapid “smash-and-grab” collection before exiting, consistent with espionage-driven objectives focused on quick exfiltration.
LameHug’s defining feature is its use of a cloud-hosted LLM, specifically Alibaba Cloud’s Qwen 2.5-Coder-32B-Instruct accessed via Hugging Face’s API, to generate malicious commands dynamically at runtime.
Base64-encoded prompts (e.g., “gather system information”) are decoded and sent over HTTPS to the model.
The model returns concise Windows command chains, often combining native utilities like systeminfo, wmic, tasklist, netstat, ipconfig, and dsquery for reconnaissance, or commands to recursively copy targeted documents into %ProgramData%\info\.
This on-demand command generation:
Analysts highlight that unusual outbound calls to AI/ML APIs from endpoints may serve as an early detection heuristic.
Once executed, LameHug follows a structured reconnaissance-to-exfiltration workflow, directed by its AI-generated command chains.
LameHug first collects detailed host and network intelligence:
Results are saved to info.txt in %ProgramData%\info\.
The malware searches Desktop, Documents, and Downloads for Office, PDF, and TXT files, copying them into %ProgramData%\info\ — T1083, T1005.
Staging data here (T1074) conceals the activity and simplifies later exfiltration.
Two methods have been observed:
APT28’s use of hijacked and legitimate infrastructure makes malicious traffic harder to distinguish from normal activity.
The LameHug campaign represents a milestone in APT28’s evolution, and potentially in malware development overall, as the first publicly reported case of operational integration between an AI language model and live malware command execution.
By offloading command logic to a cloud-hosted model, operators can adapt tasks mid-operation without deploying a new payload. This capability enables rapid adjustment to defensive changes and target specifics. Analysts note this may signal a shift toward fully adaptive campaigns.
Later variants added deception layers, one posing as an AI image generator that made legitimate NSFW image requests while executing standard LameHug routines in the background. This tactic blended social engineering with AI-driven automation to mask malicious behavior.
While current MITRE ATT&CK mappings cover LameHug’s techniques, such as third-party service abuse for C2 (T1102) and living-off-the-land discovery, AI-assisted execution may require new sub-techniques to capture the nuance of dynamic, model-generated commands.
In 2025, APT28 retained its proven spear phishing, trusted account compromise, and legitimate infrastructure abuse, but LameHug’s LLM integration represents a leap in operational agility.
By merging established TTPs with generative AI, APT28 has demonstrated how state-backed actors can refine tradecraft to evade detection and adapt in real time, challenging defenders to anticipate and counter AI-assisted intrusions.
The Picus Security Validation Platform safely simulates LameHug InfoStealer’s techniques using its continuously updated Threat Library, identifying blind spots across EDRs, NGFWs, and SIEMs before attackers can exploit them.
You can also test your defenses against hundreds of other infostealer variants, such as Lumma Stealer, Atomic Stealer, and Raven Stealer, within minutes with a 14-day free trial of the Picus Platform.
|
Threat ID |
Threat Name |
Attack Module |
|
61063 |
LameHug Malware Dropper Download Threat |
Network Infiltration |
|
73135 |
LameHug Malware Dropper Email Threat |
E-mail Infiltration |
|
96178 |
LameHug Infostealer Download Threat |
Network Infiltration |
|
88347 |
LameHug Infostealer Email Threat |
E-mail Infiltration |