Malicious Go Module Impersonates crypto Library to Deploy Rekoobe Backdoor
A Supply Chain Attack Hiding in Plain Sight
A malicious Go module named github.com/xinfeisoft/crypto has been discovered impersonating the widely-used golang.org/x/crypto library. The module intercepts SSH password input, exfiltrates credentials to attacker infrastructure, and deploys the Rekoobe backdoor — a Linux trojan historically linked to the Chinese state-sponsored group APT31.
The Go security team has since blocked the package on pkg.go.dev, but the attack highlights a growing trend: supply chain compromises targeting developer toolchains rather than production systems directly.
How the Attack Works
Phase 1: Credential Theft via ReadPassword() Hook
The backdoor is embedded in ssh/terminal/terminal.go, specifically in the ReadPassword() function. Any application importing this module that prompts for SSH passwords will silently send captured credentials to an attacker-controlled endpoint.
Phase 2: Shell Script Delivery
After exfiltrating credentials, the module fetches and executes a shell script:
- Appends threat actor SSH keys to
/home/ubuntu/.ssh/authorized_keys - Modifies
iptablesdefault policies to ACCEPT (disabling firewall) - Downloads additional payloads disguised with
.mp5extensions
Phase 3: Rekoobe Backdoor
The final payload is Rekoobe, a Linux backdoor active since 2015, linked to APT31. It provides remote command execution, file exfiltration, reverse shell capability, and additional malware staging.
Detection & Hunting
MITRE ATT&CK Mapping
| Technique | ID |
| Supply Chain Compromise | T1195.001 |
| Input Capture | T1056.001 |
| Account Manipulation: SSH Keys | T1098.004 |
| Impair Defenses: Disable Firewall | T1562.004 |
| Ingress Tool Transfer | T1105 |
IOCs
| Type | Value |
| Go Module | github.com/xinfeisoft/crypto |
| IP Address | 154.84.63.184 (TCP/443) |
| File Path | ssh/terminal/terminal.go |
| File Extension | .mp5 |
Mitigation
- Audit Go dependencies:
go list -m all | grep xinfeisoft - Pin module checksums with
go.sumverification - Monitor
~/.ssh/authorized_keyschanges with FIM - Alert on iptables policy changes to ACCEPT
- Hunt for connections to
154.84.63.184:443
Need help assessing your exposure? Apply to our Beta Tester Program for a comprehensive penetration test.