GitHub Repo Trap with 1774 Stars Mimics Microsoft Activation Scripts to Deliver Malware via Telegram Bot

A security researcher built a Telegram bot that daily delivers five trending GitHub repositories from trendshift.io along with README summaries. One repository named Microsoft Activation Scripts contained only a README with a reversed PowerShell command that decoded to download and execute a payload from a lookalike domain. The account was created 94 seconds before the repository and used classic one-liner installation syntax to blend with legitimate projects. Analysis of 321 trending repositories showed that simple filters such as recent account age or irm|iex patterns would incorrectly flag many legitimate projects including codex and opencode. Two independent detection rules were developed: one that normalizes and scans for obfuscated execution commands including base64, mshta, certutil and hidden window flags, and another that flags one-time owners created less than 30 days before the repository with under 10 KB of content. An additional groundedness check using the AIHOT method prevents DeepSeek from inserting unverified claims such as Ruby or Cypress into repository summaries.

HabrTranslated from Russian

Read at source

A Telegram bot that surfaces daily trending GitHub repositories exposed a sophisticated supply-chain trap disguised as the legitimate Microsoft Activation Scripts project.

The repository appeared in the bot’s feed on 26 September with 1774 stars, a clean description and matching tags. Its single README file contained an installation command written in reversed form: iex(irm(-join"…"[-1..-99])). PowerShell reversed the string at runtime, fetched a script from a lookalike domain and executed it immediately, bypassing both human review and simple link scanners.

The attacker’s account had been created only 94 seconds before the repository. The command mimicked the real one-liner used by genuine Microsoft Activation Scripts, increasing the chance that developers would paste it directly into a terminal.

Why obvious filters fail

Scanning 321 repositories sent by the bot between 15 July and 8 October showed that blocking any irm|iex pattern from non-GitHub domains would hide 38 legitimate projects, including codex and opencode, as well as installers for rustup and uv. Checking only account age also failed: on the day the trap appeared the account was already 34 days old.

Two independent signals proved effective. The first normalizes README text, removes invisible characters and backticks, then detects masked execution via reversed strings, base64, mshta, certutil, bitsadmin or -WindowStyle Hidden. The second flags one-time owners created less than 30 days before the repository when the repository contains less than 10 KB or only README and LICENSE files.

Both rules triggered exclusively on the malicious activator and were deployed on 9 October. The bot now replaces flagged repositories, explains the reason and removes the summary button.

Preventing LLM hallucinations

The same pipeline uses DeepSeek to generate one-sentence Russian summaries. A groundedness check adapted from the open-source KKKKhazix/AIHOT project rejects any Latin-capitalized word, number over two digits or percentage absent from the source text. After tuning, the filter reduced false rejections to five cases out of 303 summaries while catching real fabrications such as references to Ruby, Cypress and Scratch.

Meridian digestThe week's most consequential security stories, distilled into one briefing.See the digest

More in Supply Chain & Open Source

Passwordless Kubernetes Image Pulling with Artifact Keeper via ServiceAccount Tokens
Malicious Code Injected into LiteLLM Open Source AI Package via Supply Chain Attack
GhostAction Campaign Compromises 790 GitHub Repositories via Malicious Workflows