📅 February 28, 2026  |  🔴 Supply Chain / APT  |  CVE: Not yet assigned  |  Blocked by Go security team

A Go module named github.com/xinfeisoft/crypto impersonated the legitimate golang.org/x/crypto standard library package and silently exfiltrated SSH credentials before deploying the APT31-associated Rekoobe Linux backdoor. The Go security team has blocked the package — but the attack technique is documented, repeatable, and carries a trusted threat actor's fingerprints.

The Attack in 90 Seconds

The attack exploited a structural property of Go's module system: import paths are URLs, not names. golang.org/x/crypto and github.com/xinfeisoft/crypto are completely different modules. One is maintained by the Go team; the other was a trap.

The malicious package cloned the structure of the legitimate golang.org/x/crypto repository and made one surgical modification: it replaced the ReadPassword() function inside ssh/terminal/terminal.go. The replacement function did everything the original did — but before passing the credential to the caller, it sent it to an attacker-controlled endpoint.

From the victim's perspective: SSH authentication appeared to work normally. Under the hood, every password typed into a terminal using this modified function was being exfiltrated.

That was step one.

Step two: a curl-piped shell stager was downloaded and executed. It performed three operations:

  1. Added an attacker-controlled SSH public key to ~/.ssh/authorized_keys — establishing persistent SSH access independent of any credentials
  2. Loosened iptables rules to permit inbound connections on attacker-specified ports
  3. Downloaded and executed Rekoobe — a C++ Linux backdoor with a decade-long operational history

Rekoobe: The APT31 Fingerprint

Rekoobe is not a commodity RAT picked up from a dark web forum. It is a purpose-built Linux backdoor attributed to APT31 (also tracked as Zirconium, Judgment Panda, and Bronze Vinewood) — a Chinese state-sponsored threat actor with a specific focus on government, defence, and high-technology targets.

First documented in 2015, Rekoobe has remained in continuous operational use across multiple campaigns. Its characteristics:

The presence of Rekoobe in a Go supply chain attack is a significant indicator of targeting intent. This is not a script kiddie operation. APT31 doesn't distribute commodity malware through package registries by accident.

Why Go Modules Are an Attack Surface

The Go module system has a fundamental property that makes it susceptible to namespace confusion attacks: module identity is an import path, and import paths are arbitrary strings. The go toolchain will happily download github.com/xinfeisoft/crypto if that's what's in your go.mod — it doesn't know or care that the string is designed to look like a standard library extension.

This is the same class of attack that has repeatedly targeted npm (event-stream, ua-parser-js, colors), PyPI (requests vs request), and Rust (crates.io name squatting). Go's explicit module paths should make this harder — they're fully qualified, not just short names. But the attack succeeded by exploiting the fact that many Go developers trust Github-hosted packages with familiar-sounding paths without verifying the upstream source.

The Go security team has now blocked github.com/xinfeisoft/crypto from the module proxy and sum database. If you attempt to resolve this module today, you will get an error. But:

Detection: What to Look For

In Your Codebase

Scan your go.mod and go.sum files for suspicious imports — particularly anything that:

Run go mod verify to check that all module checksums match the Go module mirror. Any mismatch is a hard stop for investigation.

At Runtime / on the Host

If you suspect a host has been compromised via this vector:

# Check for unauthorised SSH keys
cat ~/.ssh/authorized_keys
# Also check system-wide
grep -r "authorized_keys" /etc/ssh/sshd_config

# Check for unusual outbound connections (Rekoobe C2)
ss -tulnp | grep -v "LISTEN"
netstat -tupn | grep ESTABLISHED

# Look for modified iptables rules
iptables -L INPUT -n -v | grep -v "ACCEPT.*lo\|ESTABLISHED\|RELATED"

# Check for curl-executed dropper artifacts
ls -la /tmp/ | grep -v "snap\|systemd"
find /tmp -name "*.sh" -newer /var/log/auth.log

# Search for Rekoobe binary signatures
find / -name ".*" -type f -newer /etc/passwd 2>/dev/null | head -20

Network-Level Detection

During the build/CI stage, watch for:

Network egress filtering on your CI runners is the single highest-value control here. A Go build should only need to reach proxy.golang.org, sum.golang.org, and your known VCS hosts. Everything else should be blocked by default.

The Role of Supply Chain Scanners

TruffleHog — now part of SecurityClaw's skill set — is primarily known for secrets detection, but the same principle of scanning dependency files applies to supply chain security. A scanner integrated into your CI pipeline can flag:

For enterprise Go shops, tools like govulncheck and Syft with a vulnerability database scan provide coverage at the dependency graph level. The combination of dependency pinning + checksum verification + egress filtering + supply chain scanning closes most of the attack surface for this class of attack.

Who Is at Risk

Projects most exposed to this technique:

Mitigation Checklist

Action Priority Who
Audit all go.mod files for github.com/xinfeisoft/crypto IMMEDIATE Dev lead
Rotate all SSH credentials on any host that ran an affected build IMMEDIATE Security / DevOps
Check ~/.ssh/authorized_keys on all developer machines and servers IMMEDIATE Security / IT
Verify iptables rules haven't been modified URGENT Security / DevOps
Run IOC scan for Rekoobe on Linux servers/CI runners URGENT Security
Enable network egress filtering on CI runners HIGH DevOps
Add supply chain scanning to CI pipeline (TruffleHog, govulncheck, Syft) HIGH Dev lead
Set GONOSUMCHECK="" and remove any module proxy bypass configurations MEDIUM Dev lead

The Pattern Will Repeat

The Go security team blocked github.com/xinfeisoft/crypto quickly. That's good. But the more important takeaway is that the pattern is documented, simple, and highly effective: clone a widely-used standard library extension. Modify one commonly-called function. Publish it with a plausible name. Wait.

Go's ecosystem is particularly attractive for this because:

Expect this technique to resurface. Verify your import paths. Run supply chain scans. Filter your build environment's network egress. Treat every dependency as potentially adversarial until verified.

🔍 SecurityClaw runs TruffleHog and supply chain analysis as automated skills. If you want your codebase and CI pipeline scanned for malicious or suspicious dependency patterns — including Go module impersonation attacks — learn more at BugHunterTools →

📚 Recommended Reading

  • Hacking: The Art of Exploitation, 2nd Ed. — Foundational understanding of Linux exploitation techniques, process injection, and backdoor mechanics. Directly relevant to how Rekoobe maintains persistence.
  • Black Hat Python, 2nd Ed. — Building supply chain attack tooling, network exfiltration techniques, and offensive scripting — useful for understanding how attackers weaponise package managers.
  • The Web Application Hacker's Handbook (Kindle) — Covers authentication bypass, credential theft patterns, and server-side attack techniques referenced in this article.

🔗 Related Coverage: This attack joins a pattern of APTs using untakeable infrastructure for C2. See our analysis of Aeternum's blockchain-based C2 on Polygon and UNC2814's Google Sheets C2 technique — three very different infrastructure choices, same fundamental defender problem.

Advertisement