Listen to this Post

Introduction
The convergence of artificial intelligence and offensive cyber operations has transitioned from theoretical speculation to operational reality. On August 10, 2026, South Korean cybersecurity firm Genians released a report revealing that the North Korean state-linked hacking group Kimsuky (also tracked as APT43) has established a comprehensive local large language model (LLM) execution environment. The group has deployed tools including Ollama, GPT4All, and Msty, alongside retrieval-augmented generation (RAG) technology, to automate cyberattacks, analyze stolen intelligence, and produce highly convincing phishing campaigns. This marks a significant escalation—Kimsuky is no longer merely using generative AI for lure creation but is actively integrating AI models into malware development, data exfiltration, and attack automation workflows.
Learning Objectives
- Understand the technical architecture of Kimsuky’s local AI stack, including Ollama, GPT4All, Msty, and RAG implementations.
- Learn how to install, configure, and operate local LLM tools across Linux and Windows environments for both legitimate and defensive security purposes.
- Identify the specific threats posed by AI-powered spear-phishing, automated document analysis, and AI-assisted coding in offensive operations.
- Develop detection and mitigation strategies against RAG knowledge base poisoning, prompt injection, and AI-generated social engineering attacks.
- Implement endpoint detection and response (EDR) and threat-hunting techniques to counter AI-augmented adversarial tradecraft.
You Should Know
- Deconstructing Kimsuky’s Local AI Stack: Ollama, GPT4All, and Msty
Genians’ investigation identified that Kimsuky operators set up tools for running and managing AI models locally, avoiding the need to transmit sensitive stolen data to external cloud-based AI services. This operational security measure allows the group to process exfiltrated documents—including financial records, cryptocurrency wallet details, and Gmail credentials—without exposing their activities to third-party monitoring. The three primary tools observed were:
Ollama is an open-source platform that packages LLMs into a simple CLI and REST server, functioning similarly to Docker for AI models. It supports models including Llama 3, Mistral, Gemma 2, and Phi-3, all downloadable with a single command. Kimsuky likely uses Ollama for its broad model availability and straightforward local inference workflow.
GPT4All is an open-source graphical desktop application that runs LLMs locally without an internet connection, supporting GGUF format models from Hugging Face. Its user-friendly interface enables operators to chat with local models using documents like PDFs, spreadsheets, and text files.
Msty provides a unified local models area for models running through Ollama, MLX, and Llama.cpp, offering features such as knowledge stacks for RAG, batch prompting across multiple models simultaneously, and offline mode for air-gapped use.
Step-by-Step Guide: Installing and Configuring Local LLM Tools
Linux (Ollama)
Install Ollama on Linux (systemd-based distributions) curl -fsSL https://ollama.com/install.sh | sh Start Ollama service and enable on boot sudo systemctl start ollama sudo systemctl enable ollama Pull a model (e.g., Llama 3) ollama pull llama3 Verify installation ollama list ollama run llama3 "Hello, analyze this threat intelligence"
Windows (Ollama)
Download the .exe installer from ollama.com/download and run it After installation, open PowerShell and verify ollama --version ollama pull mistral ollama run mistral
Linux (GPT4All)
Download the installer binary wget https://gpt4all.io/installers/gpt4all-installer-linux.run Enable execute permissions and run chmod +x gpt4all-installer-linux.run ./gpt4all-installer-linux.run Launch GPT4All from applications menu or terminal ~/gpt4all/gpt4all
Msty Studio — Download from msty.ai, install via standard GUI wizard. Open Model Hub > Local Models to install models via Ollama, MLX, or Llama.cpp engines.
- Retrieval-Augmented Generation (RAG): The Force Multiplier for Intelligence Analysis
RAG technology allows LLMs to query external document repositories, significantly enhancing their ability to process and extract insights from large volumes of stolen data. Kimsuky has deployed RAG to automate the analysis of exfiltrated documents, enabling rapid identification of valuable intelligence targets. The group’s RAG implementation likely involves:
- Knowledge Base Construction: Aggregating stolen documents into vector databases for semantic search.
- Contextual Retrieval: Using embeddings to retrieve relevant document chunks for LLM query processing.
- Automated Summarization: Generating concise intelligence briefs from raw stolen materials.
However, RAG systems introduce new attack surfaces. Security researchers have identified multiple vulnerabilities, including knowledge base poisoning, indirect prompt injection, search result manipulation, embedding inversion, and sensitive information leakage. Adversaries can inject malicious content into knowledge bases to manipulate retrieved context and steer model outputs in attacker-desired directions.
Step-by-Step Guide: Building a RAG Pipeline for Threat Intelligence (Defensive Use)
Install required libraries
pip install chromadb langchain ollama pypdf
Python script for local RAG implementation
import os
from langchain.embeddings import OllamaEmbeddings
from langchain.vectorstores import Chroma
from langchain.text_splitter import RecursiveCharacterTextSplitter
from langchain.document_loaders import PyPDFLoader
Load and split documents
loader = PyPDFLoader("threat_intel_report.pdf")
documents = loader.load()
text_splitter = RecursiveCharacterTextSplitter(chunk_size=500, chunk_overlap=50)
chunks = text_splitter.split_documents(documents)
Create embeddings and vector store
embeddings = OllamaEmbeddings(model="llama3")
vectorstore = Chroma.from_documents(chunks, embeddings)
Query the RAG system
query = "What are the indicators of compromise for Kimsuky?"
results = vectorstore.similarity_search(query, k=3)
for doc in results:
print(doc.page_content)
- AI-Powered Spear-Phishing: The New Standard in Social Engineering
Genians observed that Kimsuky has advanced beyond recycling legitimate documents to generating entirely new phishing lures using generative AI. The group has targeted the virtual asset sector, distributing malicious documents disguised as investment strategy reports and financial materials. These AI-generated documents feature natural language and professional formatting that rivals authentic workplace communications.
Previously, Kimsuky primarily used spear-phishing emails impersonating diplomats and security professionals, with victims executing malicious shortcut files disguised as documents within compressed attachments. The integration of AI now enables the group to:
- Generate customized phishing content at scale targeting specific industries and roles.
- Create convincing deepfake military identification cards and government documents.
- Produce finance and cryptocurrency-themed decoy documents that appear legitimate.
Step-by-Step Guide: Detecting AI-Generated Phishing Documents
Linux Command-Line Analysis
Extract metadata from suspicious documents exiftool suspicious_document.pdf Analyze document structure for AI-generation artifacts pdfid suspicious_document.pdf pdf-parser.py -a suspicious_document.pdf Check for obfuscated scripts in Office documents olevba suspicious_document.docm Extract and examine macros python3 -m oletools.olevba -c suspicious_document.docm
Windows PowerShell Detection
Extract and analyze email headers
Get-Content phishing_email.eml | Select-String "Received:|From:|Return-Path:"
Check for suspicious attachments
Get-ChildItem -Path .\attachments\ -Recurse | Where-Object {$_.Extension -match ".(exe|scr|js|vbs|ps1|lnk)"}
Analyze LNK files (Kimsuky's preferred method)
$shell = New-Object -ComObject WScript.Shell
$shortcut = $shell.CreateShortcut("malicious.lnk")
$shortcut.TargetPath
$shortcut.Arguments
4. AI-Assisted Coding: Accelerating Malware Development
Genians also identified AI agent development frameworks and Cursor, an AI-assisted coding tool, on infrastructure linked to the Kimsuky campaign. This suggests the group is using AI to accelerate malware development, potentially:
- Generating boilerplate code for backdoors and command-and-control (C2) infrastructure.
- Assisting with obfuscation and evasion techniques.
- Automating the creation of exploit scripts and payloads.
The group has also been observed using speech-to-text (STT) tools, indicating potential voice-based espionage or audio data analysis capabilities.
Step-by-Step Guide: Defensive Code Analysis for AI-Generated Malware
Static analysis of suspicious binaries strings suspicious_binary.exe | grep -i "http|cmd|powershell|eval" Check for AI-generated code patterns (unusual variable naming, repetitive structures) python3 -m pylint suspicious_script.py --disable=all --enable=R Analyze PE headers for anomalies pecheck suspicious_binary.exe Dynamic analysis in sandbox strace -f -e trace=network,file,process ./suspicious_binary 2>&1 | tee sandbox.log
- Defensive Countermeasures: EDR, Threat Hunting, and Zero-Trust Architecture
Moon Jong-hyun, Genians Security Center Director, emphasized that as AI advances, social engineering attacks will become more refined, making EDR-based threat hunting systems—focused on detecting execution behaviors rather than document content—critical. Recommended defensive strategies include:
- Behavioral Detection: Implement EDR solutions that monitor process creation, PowerShell execution, and unusual network connections rather than relying solely on signature-based detection.
- Email Security: Deploy AI-powered email filtering that analyzes linguistic patterns and detects AI-generated content anomalies.
- RAG Security: Implement input validation and output filtering for RAG systems; monitor for prompt injection attempts; regularly audit knowledge bases for poisoned content.
- Zero-Trust Architecture: Restrict lateral movement; enforce least-privilege access; segment networks to contain breaches.
- Threat Intelligence Sharing: Leverage frameworks like MITRE ATT&CK to map Kimsuky TTPs (e.g., T1566 – Phishing, T1059 – Command and Scripting Interpreter).
Step-by-Step Guide: EDR Threat Hunting for Kimsuky Indicators
PowerShell: Hunt for suspicious LNK file execution
Get-WinEvent -LogName "Security" | Where-Object {$<em>.Id -eq 4688 -and $</em>.Message -match ".lnk"} | Format-Table TimeCreated, Message
Linux: Detect unusual outbound connections
sudo netstat -tunap | grep ESTABLISHED | awk '{print $5}' | cut -d: -f1 | sort | uniq -c | sort -1r
Check for Ollama/GPT4All/Msty installations in unauthorized environments
Linux
ps aux | grep -E "ollama|gpt4all|msty"
Windows
Get-Process | Where-Object {$_.ProcessName -match "ollama|gpt4all|msty"}
What Undercode Say
- AI Offense is Here to Stay: Kimsuky’s adoption of local LLMs and RAG represents a paradigm shift. Nation-state actors will increasingly integrate AI across the entire attack kill chain—from reconnaissance to exploitation to exfiltration. This is not a future threat; it is already operational.
-
Local LLMs Solve the Intelligence Dilemma: By running models locally, adversaries avoid the operational security risks of cloud-based AI services. This enables them to process stolen data at scale without detection. Defenders must assume that attackers have access to the same AI capabilities they do—and plan accordingly.
The Genians report underscores a critical reality: the democratization of AI cuts both ways. While organizations leverage AI for defense, adversaries are equally empowered. The key differentiator will be implementation speed, data quality, and the human expertise to interpret AI-generated insights. Kimsuky’s move to build a localized AI stack demonstrates sophisticated tradecraft that prioritizes operational security alongside capability enhancement. This is a wake-up call for enterprises to audit their AI supply chains, implement robust RAG security controls, and invest in AI-1ative threat detection. The offensive AI arms race has officially begun.
Prediction
- -1: AI-powered cyberattacks will increasingly outpace traditional signature-based defenses. Organizations that fail to adopt AI-1ative security architectures will face disproportionate breach risks within the next 12–18 months.
-
-1: RAG knowledge base poisoning will emerge as a critical vulnerability in enterprise AI deployments. Attackers will target vector databases and retrieval pipelines to manipulate model outputs, leading to data breaches and reputational damage.
-
+1: The cybersecurity industry will accelerate development of AI-driven threat detection and response platforms, creating new market opportunities for vendors specializing in adversarial AI defense and RAG security.
-
-1: State-sponsored hacking groups will continue to weaponize open-source AI tools, lowering the barrier to entry for sophisticated cyberattacks and increasing the overall threat landscape complexity.
-
+1: Increased awareness of AI-powered threats will drive regulatory frameworks mandating AI security controls, similar to existing data protection regulations, fostering a more secure AI ecosystem.
▶️ Related Video (76% Match):
https://www.youtube.com/watch?v=2LUFhxcQCx8
🎯Let’s Practice For Free:
🎓 Live Courses & Certifications:
Join Undercode Academy for Verified Certifications
🚀 Request a Custom Project:
Secure, high-velocity infrastructure and disruptive technological engineering. Contact our engineering team for high-tier development and proprietary systems:
[email protected]
💎 Smart Architecture | 🛡️ Secure by Design | ⭐ Trusted by Thousands
IT/Security Reporter URL:
Reported By: Gregorydevans North – Hackers Feeds
Extra Hub: Undercode MoN
Basic Verification: Pass ✅


