Fake AI Agent Repositories on GitHub: SmartLoader, StealC, and the Malware Supply Chain Hiding in READMEs
Fake AI-agent repos on GitHub hid the install step in the README. What the samples show about SmartLoader, StealC, and developer trust.
A Telegram bot or Discord webhook in malware is not always the same job. Stealers drop files; designs like Telecord keep a live session. Webhook-only hunts miss that second pattern.

A malware sample can disclose more about its operator's communication choices than its embedded IP addresses. Instead of pointing to an unfamiliar server, its configuration may contain an endpoint on a service used by millions of legitimate people: Telegram's Bot API or a Discord webhook. The HTTPS destination looks familiar. The process making the request often does not.
The instinct is to classify both as “messaging C2.” But the same services can fulfill fundamentally different roles. A stealer might upload a single archive and never expect a command. A remote-access implant may need to receive tasking, preserve a session, and return output. The distinction changes what defenders should measure, which network paths matter, and how confidently an extracted token can be interpreted.
To examine that gap, OffPerimeter reviewed messaging endpoints recovered from malware configurations in our climate, then examined the public Go implementation of TelecordC2 as a separate code-level reference for a dual-platform interactive design. The two sets answer different questions: climate measures how many pipes show up and how long they last; Telecord shows one concrete interactive design.
For detection, a Discord-webhook-only hunt covers one abuse pattern, not every interaction that appears when Discord bot/Gateway features and Telegram's Bot API are combined.
As of mid-November 2026, OffPerimeter's climate on messaging endpoints recovered from malware configurations looked like this:
| Measurement | Value | Reading |
|---|---|---|
| Distinct Telegram bot IDs | 587 | Bot identities, not operators |
| Distinct Discord webhook IDs | 628 | Webhook identities, not URLs |
| Families represented in that climate | ~200 | Family labels in the corpus |
| Telegram bots reviewed in one status pass | 413 | Subset of the climate; not all 587 |
| Still responding in that pass | 68 | ~16.5% of the 413, not of 587 |
| No longer responding | 345 | Point-in-time status |
The 68 responders are about one in six of the reviewed subset, not one in six of every Telegram id in the climate. One operator can rotate secrets or run many bots, and a webhook ID is not a Gateway session or an actor.
At the network edge, a stealer posting to Telegram and an implant receiving commands through Telegram may both open TLS to api.telegram.org. Separation needs direction, API method, and process context.
Exfiltration / notification. Telegram sendMessage and sendDocument can push text and files to a bot-associated destination. A Discord incoming webhook accepts a POST to a webhook URL. The platform delivers the payload; the malware author does not need a custom receive server. A webhook POST is mainly a submission path, not the real-time event interface a Discord bot uses on the Gateway.
Interactive command and control. Telegram getUpdates can poll for pending updates. Discord applications can keep a Gateway WebSocket and receive events in real time. That is a different operating model from a one-shot webhook upload. An agent can keep an identity, accept tasking, and return output on the same channel or another.
That is why an HTTP request containing /api/webhooks/ does not cover all Discord-based C2. A Discord bot session may use the Gateway without looking like a webhook POST, and webhook traffic can also be legitimate. Originating process, timing, and surrounding host activity decide the triage.
We reviewed the public repository ELMERIKH/TelecordC2, pinned to commit 462b38e (branch activity through 22 February 2025). It is framed as a cross-platform red-team C2 with Go agents for Windows, Linux, and macOS. The reading here is static: the design in source, not a runtime on a victim host.
In the agent source, a Discord message handler watches a configured channel. For a targeted interaction, it compares the requested agent id with a local temporary .id.txt. Only a matching agent starts its Telegram-side session. Discord becomes the multi-agent switchboard; Telegram does not need every agent awake at once.
The Telegram side uses go-telegram-bot-api, initializes the bot, and consumes updates via GetUpdatesChan. Source capabilities include shell execution, directory change, screenshot / screen share, and file transfer. Windows uses a command shell; Linux uses sh; macOS includes an AppleScript-oriented path.
Controller code also references a Discord webhook for notifications. That does not make the agent's Discord control path a webhook. Three roles stay separate: Discord bot/Gateway session, Telegram Bot API session, and webhook as a notification channel.
| Component | Evidence in reviewed source | Defensive implication |
|---|---|---|
| Discord handler | messageCreate in platform agents |
Possible long-lived Discord API/Gateway relationship |
| Agent selection | Match against local .id.txt |
Ties an operator request to a local identity |
| Telegram activation | startTelegramBot() after selection |
Telegram command traffic may follow a Discord event |
| Update intake | GetUpdatesChan |
Polling is relevant to control-plane hunts |
| Remote actions | Shell, file, screenshot branches | Local process/file evidence can corroborate egress |
| Controller notify | Webhook use in Telecord.go |
A webhook can exist without being primary agent control |
An unusual process that talks to Discord and later to Telegram deserves more attention than either link alone. Temporal proximity alone is not enough: legitimate automation can use both platforms.
Of 413 Telegram bots reviewed in that pass, 68 still responded (~16.5%). The rest did not. A fraction of the climate was still live at that moment, but liveness ages fast: secrets rotate, bots die, and platforms revoke access. The snapshot is climate, not a permanent alert list.
What matters is the relationship between process and network, not a list of popular domains. Four progressive checks in authorized telemetry:
Start from DeviceNetworkEvents. Depending on the source, RemoteUrl may be a hostname or a full URL.
let Services = dynamic(["api.telegram.org", "discord.com", "discordapp.com", "gateway.discord.gg"]);
DeviceNetworkEvents
| where Timestamp > ago(14d)
| extend Domain = tolower(extract(@"^(?:https?://)?([^/:?]+)", 1, tostring(RemoteUrl)))
| where Domain in (Services)
| summarize Connections=count(), FirstSeen=min(Timestamp), LastSeen=max(Timestamp),
ServiceDomains=make_set(Domain, 10)
by DeviceId, DeviceName, InitiatingProcessFileName, InitiatingProcessId,
InitiatingProcessCreationTime
| order by Connections desc
Leave raw URLs and command lines out of the export, because Telegram Bot API paths and Discord webhook URLs can embed live secrets.
DeviceNetworkEvents
| where Timestamp > ago(14d)
| extend Domain = tolower(extract(@"^(?:https?://)?([^/:?]+)", 1, tostring(RemoteUrl)))
| extend Service = case(Domain == "api.telegram.org", "Telegram",
Domain in ("discord.com", "discordapp.com", "gateway.discord.gg"), "Discord", "Other")
| where Service != "Other"
| summarize FirstSeen=min(Timestamp), LastSeen=max(Timestamp),
Services=make_set(Service, 2), Connections=count()
by DeviceId, DeviceName, InitiatingProcessFileName,
InitiatingProcessId, InitiatingProcessCreationTime
| where set_has_element(Services, "Telegram") and set_has_element(Services, "Discord")
| order by LastSeen desc
Grouping by the same originating process sharpens the leads, though it misses designs that split Telegram and Discord across two processes. Those need ancestry, services or tasks, and a per-device timeline.
With proxy visibility, Telegram sendDocument versus getUpdates, or a Discord webhook POST versus a persistent Gateway session, can be told apart. DNS/TLS hostnames alone do not prove the method. In ATT&CK, T1567.004 fits webhook exfil and T1102.002 fits bidirectional C2 through web services.
Separate detection lanes for webhook exfil, Telegram upload/polling, and Discord bot/Gateway activity, then correlate with process identity, parent-child, persistence, file access, and approved business automation. If the business does not need these APIs, prefer egress deny-by-default; if it does, scope by application.
| Finding | Basis |
|---|---|
| Hundreds of distinct Telegram bot IDs and Discord webhook IDs in climate | OP aggregates |
| ~16.5% of the reviewed Telegram subset still answered at snapshot | Point-in-time pass |
| TelecordC2 implements Discord-addressed wake of a Telegram session | Pinned source |
Same trusted messaging APIs, different jobs. Stealers often use them as dropboxes. Dual-channel designs like Telecord show why webhook-only Discord hunts under-count interactive control. Climate tells you the pipes keep showing up; public source shows how a second job can ride the same pipes.
462b38eOffPerimeter
When the threat surface moves onto trusted messaging APIs, the work shifts from listing domains to reading climate and behavior together. That is the lens OffPerimeter brings to this class of abuse: offperimeter.com.
Explore your attack surface, credential exposure and threat intelligence with OffPerimeter.