Threat reportSupply ChainTL-2026-3366
Malicious 'pyronut' PyPI Package (Trojanized Pyrogram) Backdoors Telegram Bots with Remote Code Execution
The malicious PyPI package 'pyronut' (versions 2.0.184, 2.0.185, 2.0.186) is a trojanized copy of the Pyrogram Telegram API framework. It hides a runtime backdoor in Client.start() that gives two hardcoded attacker Telegram accounts remote Python (/e) and shell (/shell) execution on every host running an affected bot.
Key facts for TL-2026-3366
| Identifiers | TL-2026-3366 |
|---|---|
| Also known as | Trojanized Pyrogram fork, pyronut backdoor |
| Severity | HIGH |
| Exploitation status | Exploited in the wild |
| Affected products | PyPI (third-party package) pyronut; Telegram bot developers Python Telegram bots built on pyronut (Pyrogram fork) |
| Weaknesses (CWE) | CWE-506, CWE-912 |
| Malware | Pyronut backdoor, Python, telegram |
| MITRE ATT&CK techniques | T1036.005 Match Legitimate Resource Name or Location, T1059.004 Unix Shell, T1059.006 Python, T1070.004 File Deletion, T1071.001 Web Protocols, T1102.002 Bidirectional Communication, T1195 Supply Chain Compromise, T1195.002 Compromise Software Supply Chain |
| Motivation | UNKNOWN |
| Target sectors | technology, software development, telegram bot operators |
| Target regions | Global |
| Detection rules | 9 (1 shown free) |
| Sources | 10 cited sources |
Detection coverage for TL-2026-3366
As of 2026-10-12, Threadlinqs Intelligence publishes 9 detection rule(s) for TL-2026-3366 across Splunk SPL, Microsoft KQL and Sigma, covering 11 indicator(s) of compromise. The whole corpus is readable without an account. Every threat comes with one complete detection in Splunk SPL, Microsoft KQL and Sigma, free for everyone; a free account adds daily TL Creds to unlock the rest. Paid plans add a larger daily allowance, correlation and the MCP server. Threadlinqs MCP server · View plans.
Free detection: Pyronut Malicious PyPI Package Installation — Exploitation Phase
Detects installation of the malicious PyPI package pyronut (versions 2.0.184, 2.0.185, 2.0.186), a trojanized fork of the Pyrogram Telegram framework that hides a runtime /e and /shell backdoor in Client.start(). All published versions are malicious, so any pip/uv/poetry/pipenv install referencing pyronut is a supply-chain compromise (T1195.002) that requires credential rotation.
- Languages: Splunk SPL, Microsoft KQL, Sigma
- ATT&CK: T1195.002, T1195, T1036.005
- Data sources: sysmon_linux, edr_process_events, cim_endpoint_processes
- Severity: high
- Confidence: high
Splunk SPL
| tstats summariesonly=false count min(_time) as firstTime max(_time) as lastTime from datamodel=Endpoint.Processes where Processes.process="*pyronut*" (Processes.process="*pip*" OR Processes.process="*poetry*" OR Processes.process="*pipenv*" OR Processes.process="*uv add*" OR Processes.process="*uv pip*" OR Processes.process="*setup.py*") by Processes.dest Processes.user Processes.parent_process_name Processes.process_name Processes.process
| rename Processes.* as *
```Flag installs of the malicious PyPI package pyronut, a trojanized Pyrogram fork with versions 2.0.184 to 2.0.186```
| rex field=process "pyronut(?:==|=|-| )*(?<pyronut_version>2[.]0[.][0-9]+)?"
| eval known_malicious_version=if(match(pyronut_version,"^2[.]0[.]18[4-6]$"),"yes","unspecified")
| convert ctime(firstTime) ctime(lastTime)
| table firstTime lastTime dest user parent_process_name process_name process pyronut_version known_malicious_version countMicrosoft KQL
DeviceProcessEvents
| where Timestamp > ago(24h)
| where ProcessCommandLine has "pyronut"
| where FileName in~ ("pip", "pip3", "uv", "poetry", "pipenv", "python", "python3")
or ProcessCommandLine has_any ("pip install", "pip3 install", "poetry add", "uv add", "uv pip", "pipenv install", "setup.py")
| extend PyronutVersion = extract(@"pyronut(?:==|=|-| )*(2[.]0[.][0-9]+)", 1, ProcessCommandLine)
| extend KnownMaliciousVersion = iff(PyronutVersion in ("2.0.184", "2.0.185", "2.0.186"), "yes", "unspecified")
| project Timestamp, DeviceName, AccountName, InitiatingProcessFileName, InitiatingProcessCommandLine, FileName, ProcessCommandLine, PyronutVersion, KnownMaliciousVersion
| order by Timestamp descSigma
title: Malicious PyPI Package pyronut Installation (Trojanized Pyrogram Fork)
id: 7b1f6c1e-3a52-4f0e-9d63-1c2a5e8b4a11
status: experimental
description: Detects pip, uv, poetry or pipenv installing the malicious PyPI package pyronut (versions 2.0.184 to 2.0.186), a trojanized Pyrogram fork with a runtime Telegram backdoor (TL-2026-3366).
references:
- https://www.endorlabs.com/learn/malicious-pyronut-package-backdoors-telegram-bots-with-remote-code-execution
- https://attack.mitre.org/techniques/T1195/002/
author: AII-Detector — ThreadLinqs Intelligence
date: 2026/10/12
tags:
- attack.initial-access
- attack.t1195.002
- attack.t1195
- attack.defense-evasion
- attack.t1036.005
logsource:
category: process_creation
product: linux
detection:
selection_img:
Image|endswith:
- '/pip'
- '/pip3'
- '/python'
- '/python3'
- '/uv'
- '/poetry'
- '/pipenv'
selection_cli:
CommandLine|contains: 'pyronut'
condition: selection_img and selection_cli
falsepositives:
- Security researchers or package-reputation scanners that download pyronut for analysis
- Dependency-audit pipelines that download known-bad packages into a sandbox
level: high
Known false positives:
- Security researchers or sandboxes intentionally downloading pyronut for analysis
- Package-reputation scanners that download suspicious packages for inspection
Tuning notes: Requires the Endpoint.Processes data model to be populated and accelerated. Exclude known malware-analysis sandbox hosts via dest. Pair with SBOM and lock-file hunts, because installs from requirements.txt do not always show the package name on the command line. Re-run against historical data back to 2026-03-18.
- [indicator] Hidden Backdoor Module secret.py Written to pyrogram/helpers — Exploitation Phase · unlock with TL Creds
- Python-Spawned Shell Harvesting Secrets and Session Files — Post-Exploitation · unlock with TL Creds
- Telegram-Connected Python Process Spawning Shell — C2 to Execution Chain · unlock with TL Creds
- [indicator] Package Directory Present in site-packages — Exploitation Phase · unlock with TL Creds
- Python-Spawned Shell Fetching Second-Stage Tooling — Post-Exploitation · unlock with TL Creds
- Python Process Connecting to Telegram Hostnames — C2 Channel · unlock with TL Creds
- Python Bot Process Spawning /bin/bash -c ([indicator] /shell Backdoor) — Post-Exploitation · unlock with TL Creds
- Python Process Egress to Telegram Datacenter Ranges — C2 Channel · unlock with TL Creds
Indicators of compromise for TL-2026-3366
As of 2026-10-12, Threadlinqs Intelligence tracks 11 indicators of compromise for TL-2026-3366.
How Malicious 'pyronut' PyPI Package (Trojanized Pyrogram) works
All three versions were quarantined on 2026-03-18.
Endor Labs identified the PyPI package pyronut as a malicious fork of pyrogram, a popular Telegram API framework with roughly 370,000 monthly downloads. The package copied the legitimate project's description verbatim. The names are too different for classic typosquatting, so the package was most likely promoted through social engineering and community channels. The GitHub repository URL listed in the package metadata was non-functional. Only three versions were ever published (2.0.184, 2.0.185, 2.0.186), all malicious, and all were published, identified and quarantined on 2026-03-18, so the exposure window was a matter of hours.
Unlike many malicious packages, pyronut has no install-time hook. The backdoor runs at application runtime. The actor modified pyrogram/methods/utilities/start.py (around lines 73-78) so that Client.start() imports a hidden module, pyrogram/helpers/secret.py, and calls secret.init_secret(self) inside a bare try/except that fails silently. That call registers two Telegram message handlers that accept commands only from two hardcoded attacker user IDs (1905813501 and 8020909936). The handlers also reject forwarded messages and messages relayed by bots. The backdoor skips installation when the running account is one of the attacker IDs (if client.me.id in OWNERS: return), which indicates deliberate design.
The /e command evaluates attacker-supplied Python in the running client process through the meval library. The code has access to the live pyrogram.Client object, the raw Telegram API layer, and the message and chat objects. Output is returned over Telegram, split at the 4,096-character message limit, with longer output written to a temporary file and sent back as a document. The /shell command passes attacker input directly to /bin/bash -c through subprocess and runs with the privileges of the Python process. Command and control and result delivery both run over Telegram's own infrastructure, so there are no external domains or IPs to block. Detection has to rely on package, file and behavioral artifacts.
Impact: an attacker controlling either ID could run arbitrary code on any server or workstation hosting a bot that imported pyronut, and could read environment variables, API keys, SSH keys, database credentials and Telegram sessions and bot tokens accessible to that process. The source report does not name a threat actor and states no CVE or CVSS score. Checkmarx's separate 'Operation Navy Ghost' reporting describes other trojanized Pyrogram forks that use a similar hardcoded OWNERS-list pattern. However, the BleepingComputer coverage of that campaign does not mention pyronut, so no link between the two is asserted here.
MITRE ATT&CK techniques by tactic:
Defense Evasion
T1036.005 Match Legitimate Resource Name or Location; T1070.004 File Deletion
Execution
T1059.004 Unix Shell; T1059.006 Python
Command and Control
T1071.001 Web Protocols; T1102.002 Bidirectional Communication
Initial Access
T1195 Supply Chain Compromise; T1195.002 Compromise Software Supply Chain
Remediation for Malicious 'pyronut' PyPI Package (Trojanized Pyrogram)
Patches
- No patch applies. The versions were quarantined by PyPI. Install the legitimate pyrogram package from its official source.
Immediate actions
- Search requirements.txt, Pipfile, pyproject.toml, setup.py, lock files and installed environments for pyronut 2.0.184, 2.0.185 or 2.0.186
- Uninstall pyronut and rebuild virtual environments or container images from a known-good state
- Treat all environment variables, API keys, SSH keys and database passwords reachable by the affected process as compromised and rotate them
- Revoke all Telegram sessions and Bot API tokens used by affected bots
- Hunt for pyrogram/helpers/secret.py and for /bin/bash -c child processes spawned by Python bot processes
Workarounds
- Block or monitor Telegram traffic from hosts that do not need it
- Audit Client.start() in installed pyrogram code for undocumented imports
Longer-term hardening
- Pin dependencies by hash and verify package names against the upstream project before adding them
- Restrict bot hosts to least privilege and egress-filter where feasible
- Add package-reputation or malicious-package scanning to CI/CD
- Alert on meval appearing in dependency manifests
Affected and fixed versions
- PyPI (third-party package) — pyronut
Vulnerable versions: 2.0.184; 2.0.185; 2.0.186 - Telegram bot developers — Python Telegram bots built on pyronut (Pyrogram fork)
Vulnerable versions: Any deployment that installed and started a client with pyronut 2.0.184-2.0.186
Fixed in: Reinstall legitimate pyrogram and rotate credentials
Timeline of Malicious 'pyronut' PyPI Package (Trojanized Pyrogram)
- Approximate start (month precision) of the separate Checkmarx-reported 'Operation Navy Ghost' campaign (Nov 2025 - Jun 2026), which used trojanized Pyrogram forks with a similar secret.py helper and hardcoded OWNERS list. No link to locked-ioc-10 is asserted by the sources.
- Secondary coverage (Cryptika, ThreatCluster) republished the Endor Labs findings the same day, and ThreatCluster created a locked-ioc-10 malware entity page.
- Endor Labs published its analysis of the backdoor, covering the /e Python and /shell command execution and the two hardcoded attacker locked-ioc-9 IDs.
- All three locked-ioc-10 versions were quarantined on PyPI the same day they were published, giving an exposure window of roughly several hours.
- Endor Labs identified the hidden backdoor module locked-ioc-2 and the modified Client.start() in locked-ioc-10.
- Malicious locked-ioc-10 versions 2.0.184, 2.0.185 and 2.0.186 published to PyPI as a trojanized fork of pyrogram.
- The Endor Labs source article was updated, per the hunt record.
Sources cited for Malicious 'pyronut' PyPI Package (Trojanized Pyrogram)
- MITRE ATT&CK T1195.002 Compromise Software Supply Chain MITRE · Advisory · 2026-03-18
- MITRE ATT&CK T1059.006 Python MITRE · Advisory · 2026-03-18
- Malicious 'Pyronut' Package Backdoors Telegram Bots with Remote Code Execution (Endor Labs) endorlabs.com · Research · 2026-03-18
- pyronut malware entity page (ThreatCluster) threatcluster.io · Research · 2026-03-18
- Operation Navy Ghost Targets Telegram Bot Developers with Malicious PyPI Packages (ThreatCluster, Checkmarx reporting) threatcluster.io · Research
- meval on PyPI (dynamic expression evaluation library abused by the backdoor) pypi.org · Research · 2026-03-18
- Malicious 'Pyronut' Package Backdoors Telegram Bots With Remote Code Execution (Cryptika) cryptika.com · News · 2026-03-18
- Malicious Pyronut Package Compromises Telegram Bots via RCE (ThreatCluster) threatcluster.io · News · 2026-03-18
- Malicious PyPI packages give hackers control of Telegram bot servers (BleepingComputer; related Operation Navy Ghost reporting, pyronut not named) BleepingComputer · News
- Malware on PyPI Targets Servers Running Telegram Bots (Hackmag) hackmag.com · News
Previous and next in supply chain
- Sonatype Q3 2026 Open Source Malware Index: Compounding Supply-Chain Compromise (Mini Shai-Hulud npm wave, mlflow-ui PyPI AI-agent-uploaded malware) Previous report
- Software Supply Chain Attacks: Upstream Poisoning via Registries, Maintainer Accounts and Build Pipelines (Shai-Hulud, PhantomRaven, SUNBURST) Next report
Further reading
Drafted by the Threadlinqs research pipeline from 10 sources; published ; last updated —.