Proof of Concept Β· Threat Intelligence Research Β· Unit42 2026
β οΈ AVISO LEGAL / LEGAL NOTICE Este repositorio es exclusivamente para investigaciΓ³n de seguridad autorizada y propΓ³sitos educativos. El uso de este cΓ³digo contra sistemas sin autorizaciΓ³n explΓcita es ilegal. VerSECURITY.mdpara tΓ©rminos completos.This repository is exclusively for authorized security research and educational purposes. Use of this code against systems without explicit authorization is illegal. See
SECURITY.mdfor full terms.
Este repositorio implementa un Proof of Concept (PoC) basado en el reporte de inteligencia de amenazas publicado por Palo Alto Networks Unit42 el 17 de junio de 2026, que documentΓ³ el uso de bots de Telegram combinados con modelos de lenguaje (LLMs) para crear infraestructura de Comando y Control (C2) sin necesidad de cΓ³digo especializado por parte del atacante.
El vector de ataque documentado combina tres tecnologΓas accesibles:
| Componente | FunciΓ³n | Herramienta |
|---|---|---|
| Telegram Bot API | Canal C2 cifrado y anΓ³nimo | Bot de Telegram |
| LLM (Groq/Llama) | TraducciΓ³n de lenguaje natural β comandos shell | Groq API |
| Implante Python | EjecuciΓ³n en el host comprometido | Script Python |
- Elimina la barrera tΓ©cnica: el operador escribe en lenguaje natural (ej. "lista los archivos del escritorio")
- El LLM traduce la instrucciΓ³n a comandos del sistema operativo concretos
- Usa infraestructura legΓtima de Telegram como canal C2, dificultando el bloqueo
- El implante es multiplataforma (Linux, Windows, macOS)
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β OPERADOR (Atacante) β
β Telegram Chat β Lenguaje natural β
ββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββ
β Mensaje de texto
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β TELEGRAM BOT API β
β Canal cifrado Β· Infraestructura legΓtima β
ββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββ
β Long-polling (HTTPS)
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β IMPLANTE EN EL HOST β
β β
β βββββββββββββββ ββββββββββββββββββββ ββββββββββββββββββββ β
β β Fase 1 β β Fase 3 β β Fase 4 β β
β β Beacon β β LLM Translator β β Executor β β
β β FingerprintββββΆβ Groq API ββββΆβ Shell/File/Net β β
β βββββββββββββββ β llama-3.1-8b β ββββββββββββββββββββ β
β ββββββββββββββββββββ β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Fase 2 β TelegramClient β β
β β β’ Polling de mensajes β’ EnvΓo de resultados β β
β β β’ ExfiltraciΓ³n de archivos (hasta 50 MB) β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Fase 1: Host Fingerprinting & Beacon
ββ Recopila: IP pΓΊblica, hostname, usuario, OS, procesador
ββ EnvΓa beacon inicial al operador vΓa Telegram
Fase 2: C2 Infrastructure (Telegram)
ββ TelegramClient: polling cada 5 seg, filtra mensajes por operator_id
ββ Solo procesa mensajes del operador autorizado
Fase 3: LLM Command Translation
ββ EnvΓa el mensaje al LLM (Groq/Llama)
ββ El LLM devuelve un action token estructurado:
EXECUTE_COMMAND:<cmd> | GET_FILE:<path> | SCAN_NETWORK:<subnet> | ...
Fase 4: Command Execution & Exfiltration
ββ Ejecuta el action token en el host
ββ Devuelve resultado al operador via Telegram
ββ Archivos grandes β exfiltraciΓ³n directa como documento
- Python 3.9 o superior
- Pip
- Cuenta en console.groq.com (gratuita)
- Bot de Telegram creado con @BotFather
# 1. Clonar el repositorio
git clone https://github.com/KONDORDEVSECURITYCORP/c2Telegram.git
cd c2Telegram
# 2. Crear entorno virtual (recomendado)
python3 -m venv .venv
source .venv/bin/activate # Linux/macOS
# .venv\Scripts\activate # Windows
# 3. Instalar dependencias
pip install -r requirements.txt
# 4. Editar credenciales directamente en el script
nano llm_telegram_poc.py
# Busca el bloque CONFIG y reemplaza los placeholders (ver secciΓ³n ConfiguraciΓ³n)Abre llm_telegram_poc.py y localiza el bloque CONFIG. Reemplaza los tres placeholders con tus valores reales:
CONFIG = {
'telegram_bot_token': 'TELEGRAM_BOT_TOKEN', # <-- pega tu token aquΓ
'telegram_operator_id': 0, # <-- pon tu ID numΓ©rico aquΓ
'groq_api_key': 'GROQ_API_KEY', # <-- pega tu API key aquΓ
...
}| Campo en CONFIG | DΓ³nde obtenerlo | Ejemplo de formato |
|---|---|---|
telegram_bot_token |
@BotFather β /newbot |
123456789:ABCdefGHIjklMNOpqrsTUVwxyz |
telegram_operator_id |
@userinfobot (nΓΊmero entero) | 987654321 |
groq_api_key |
console.groq.com β API Keys | gsk_xxxxxxxxxxxxxxxxxxxx |
llm_model |
Opcional, ver modelos Groq | llama-3.1-8b-instant |
poll_interval |
Opcional β segundos entre polls | 5 |
poll_timeout |
Opcional β timeout del long-poll | 30 |
EnvΓa cualquier mensaje al bot @userinfobot β te responderΓ‘ con tu id numΓ©rico.
# Activar entorno virtual si no estΓ‘ activo
source .venv/bin/activate
# Ejecutar el PoC
python3 llm_telegram_poc.pyUna vez iniciado, el implante enviarΓ‘ un beacon con la informaciΓ³n del host y comenzarΓ‘ a escuchar comandos desde el chat de Telegram.
| Lo que escribes en Telegram | Lo que ejecuta el implante |
|---|---|
list files in /tmp |
ls /tmp |
show me running processes |
ps aux |
what's my ip |
Llama a ipify + whoami |
read the file /etc/hostname |
cat /etc/hostname |
check open ports on 192.168.1.1 |
Escaneo de puertos |
| MΓ³dulo | Capacidad | Notas |
|---|---|---|
HostIntelligence |
Fingerprinting del host | IP pΓΊblica, OS, usuario, hostname |
TelegramClient |
C2 vΓa Telegram | Polling + envΓo + exfiltraciΓ³n de archivos |
LLMCommandTranslator |
TraducciΓ³n NL β shell | Groq Llama 3.1 8B |
CommandExecutor |
EjecuciΓ³n de comandos | Shell, lectura de archivos, escaneo de red |
LLMTelegramC2 |
Orquestador principal | Ciclo completo de C2 |
This repository implements a Proof of Concept (PoC) based on the threat intelligence report published by Palo Alto Networks Unit42 on June 17, 2026, which documented the use of Telegram bots combined with Large Language Models (LLMs) to build Command and Control (C2) infrastructure without requiring technical skills from the attacker.
The documented attack vector combines three accessible technologies:
| Component | Function | Tool |
|---|---|---|
| Telegram Bot API | Encrypted, anonymous C2 channel | Telegram Bot |
| LLM (Groq/Llama) | Natural language β shell command translation | Groq API |
| Python Implant | Execution on the compromised host | Python script |
- Eliminates the technical barrier: the operator writes in natural language (e.g., "list the desktop files")
- The LLM translates the instruction into concrete OS commands
- Uses legitimate Telegram infrastructure as the C2 channel, making blocking harder
- The implant is cross-platform (Linux, Windows, macOS)
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β OPERATOR (Attacker) β
β Telegram Chat β Natural Language Input β
ββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββ
β Text message
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β TELEGRAM BOT API β
β Encrypted channel Β· Legitimate infrastructure β
ββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββββββββ
β Long-polling (HTTPS)
βΌ
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β IMPLANT ON HOST β
β β
β βββββββββββββββ ββββββββββββββββββββ ββββββββββββββββββββ β
β β Phase 1 β β Phase 3 β β Phase 4 β β
β β Beacon β β LLM Translator β β Executor β β
β β FingerprintββββΆβ Groq API ββββΆβ Shell/File/Net β β
β βββββββββββββββ β llama-3.1-8b β ββββββββββββββββββββ β
β ββββββββββββββββββββ β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
β β Phase 2 β TelegramClient β β
β β β’ Message polling β’ Result delivery β β
β β β’ File exfiltration (up to 50 MB) β β
β ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Phase 1: Host Fingerprinting & Beacon
ββ Collects: public IP, hostname, username, OS, processor
ββ Sends initial beacon to operator via Telegram
Phase 2: C2 Infrastructure (Telegram)
ββ TelegramClient: polls every 5 sec, filters by operator_id
ββ Only processes messages from the authorized operator
Phase 3: LLM Command Translation
ββ Sends message to LLM (Groq/Llama)
ββ LLM returns a structured action token:
EXECUTE_COMMAND:<cmd> | GET_FILE:<path> | SCAN_NETWORK:<subnet> | ...
Phase 4: Command Execution & Exfiltration
ββ Executes the action token on the host
ββ Returns result to operator via Telegram
ββ Large outputs β direct file exfiltration as Telegram document
- Python 3.9 or higher
- Pip
- Account at console.groq.com (free tier available)
- Telegram Bot created with @BotFather
# 1. Clone the repository
git clone https://github.com/KONDORDEVSECURITYCORP/c2Telegram.git
cd c2Telegram
# 2. Create virtual environment (recommended)
python3 -m venv .venv
source .venv/bin/activate # Linux/macOS
# .venv\Scripts\activate # Windows
# 3. Install dependencies
pip install -r requirements.txt
# 4. Edit credentials directly in the script
nano llm_telegram_poc.py
# Find the CONFIG block and replace the placeholders (see Configuration section)Open llm_telegram_poc.py and locate the CONFIG block. Replace the three placeholders with your real values:
CONFIG = {
'telegram_bot_token': 'TELEGRAM_BOT_TOKEN', # <-- paste your token here
'telegram_operator_id': 0, # <-- put your numeric ID here
'groq_api_key': 'GROQ_API_KEY', # <-- paste your API key here
...
}| CONFIG field | Where to get it | Example format |
|---|---|---|
telegram_bot_token |
@BotFather β /newbot |
123456789:ABCdefGHIjklMNOpqrsTUVwxyz |
telegram_operator_id |
@userinfobot (integer) | 987654321 |
groq_api_key |
console.groq.com β API Keys | gsk_xxxxxxxxxxxxxxxxxxxx |
llm_model |
Optional, see Groq models | llama-3.1-8b-instant |
poll_interval |
Optional β seconds between polls | 5 |
poll_timeout |
Optional β long-poll timeout | 30 |
Send any message to @userinfobot β it will reply with your numeric id.
# Activate virtual environment if not already active
source .venv/bin/activate
# Run the PoC
python3 llm_telegram_poc.pyOnce started, the implant sends an initial beacon with host information and begins listening for commands from the Telegram chat.
| What you type in Telegram | What the implant executes |
|---|---|
list files in /tmp |
ls /tmp |
show me running processes |
ps aux |
what's my ip |
Calls ipify + whoami |
read the file /etc/hostname |
cat /etc/hostname |
check open ports on 192.168.1.1 |
Port scan |
| Module | Capability | Notes |
|---|---|---|
HostIntelligence |
Host fingerprinting | Public IP, OS, user, hostname |
TelegramClient |
C2 via Telegram | Polling + delivery + file exfiltration |
LLMCommandTranslator |
NL β shell translation | Groq Llama 3.1 8B |
CommandExecutor |
Command execution | Shell, file read, network scan |
LLMTelegramC2 |
Main orchestrator | Full C2 lifecycle |
- Palo Alto Networks Unit42 β LLM-Driven Malware via Telegram (2026-06-17)
- Groq API Documentation
- Telegram Bot API
- python-dotenv
c2Telegram/
βββ llm_telegram_poc.py # Main PoC implant β edit CONFIG block here
βββ .gitignore # Git exclusions
βββ requirements.txt # Python dependencies
βββ README.md # This file
βββ SECURITY.md # Responsible use policy
KONDOR DEV SECURITY CORP
Seguridad Ofensiva Β· Red Team Β· Threat Intelligence