Skip to content

About

πŸ”΄ LLM-driven Telegram C2 PoC β€” Unit42 2026 threat intel. Codeless malware operations via Telegram Bot + Groq/Llama NL command translation. Authorized security research only.

Topics

Resources

Security policy

Stars

5 stars

Watchers

0 watching

Forks

Latest commit

Β 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ”΄ c2Telegram β€” LLM-Driven C2 PoC via Telegram

Proof of Concept Β· Threat Intelligence Research Β· Unit42 2026

Python License Research KONDOR


⚠️ 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. Ver SECURITY.md para 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.md for full terms.


Tabla de Contenidos / Table of Contents


EspaΓ±ol

ΒΏQuΓ© es esto?

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.

Contexto de la Amenaza

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

ΒΏPor quΓ© esto es relevante?

  • 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)

Arquitectura

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                     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)                 β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Fases de EjecuciΓ³n

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

InstalaciΓ³n

Requisitos

Pasos

# 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)

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Γ­
    ...
}

Campos a editar

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

CΓ³mo obtener tu Telegram ID

EnvΓ­a cualquier mensaje al bot @userinfobot β€” te responderΓ‘ con tu id numΓ©rico.


Uso

# Activar entorno virtual si no estΓ‘ activo
source .venv/bin/activate

# Ejecutar el PoC
python3 llm_telegram_poc.py

Una vez iniciado, el implante enviarΓ‘ un beacon con la informaciΓ³n del host y comenzarΓ‘ a escuchar comandos desde el chat de Telegram.

Comandos de Ejemplo (en lenguaje natural)

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

Capacidades del PoC

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

English

What is this?

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.

Threat Context

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

Why is this relevant?

  • 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)

Architecture

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                       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)                        β”‚   β”‚
β”‚  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜   β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Execution Phases

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

Installation

Requirements

Steps

# 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)

Configuration

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
    ...
}

Fields to edit

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

How to get your Telegram ID

Send any message to @userinfobot β€” it will reply with your numeric id.


Usage

# Activate virtual environment if not already active
source .venv/bin/activate

# Run the PoC
python3 llm_telegram_poc.py

Once started, the implant sends an initial beacon with host information and begins listening for commands from the Telegram chat.

Example Commands (natural language)

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

PoC Capabilities

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

Referencias / References


Estructura del Proyecto / Project Structure

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

About

πŸ”΄ LLM-driven Telegram C2 PoC β€” Unit42 2026 threat intel. Codeless malware operations via Telegram Bot + Groq/Llama NL command translation. Authorized security research only.

Topics

Resources

Security policy

Stars

5 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages