RubyGems Ethereum/crypto wgkit cluster - 25 gems drop `/tmp/.w1/wg_install.sh` from 45.138.*.*
OpenSSF/Amazon Inspector flagged 25 RubyGems packages posing as Ethereum/Bitcoin/Lightning crypto utilities on 2026-10-05. All v1.0.0; extconf.rb base64/XOR-decodes a Ruby payload, double-forks, sleeps 20-40 min, then downloads wgkit.tar.gz from 45.138.*.*:8089-8092 and runs /tmp/.w1/wg_install.sh. Fires only on dev hosts with SSH/git/gem creds.
- Incident type
- Malicious package. A package that was malicious from its first publish under its own name - a fake tool, a lure used in a social-engineering campaign, or a trojanised utility - rather than a copy of an existing name.
- Detected by
- OpenSSF malicious-packages · Amazon Inspector · GitHub Advisory Database
- Also known as
- wgkit.tar.gz RubyGems crypto cluster · 45.138.*.* RubyGems Ethereum typosquat burst
- Ecosystems
- RubyGems
- Packages tracked
- 25
What happened
Between roughly 2026-10-05 09:00 and 22:00 UTC, the GitHub Advisory Database (via OpenSSF malicious-packages and Amazon Inspector`s IN-MAL feed) published 25 RubyGems malware advisories flagging a tightly-coherent operator-level typosquat / brand-lure wave in the Ethereum, Bitcoin, Lightning Network, and Web3 verticals.
Payload family
All 26 gems share an identical delivery pattern:
- The gem ships an
ext/<name>/extconf.rbnative-extension build file thatgem installauto-executes. extconf.rbbase64-decodes a Ruby payload withBase64.decode64and runs it undereval.- The payload double-forks a detached background process, applies sandbox-evasion gates (CI env, hostname regex
uvm/firecracker/sandbox/vagrant, analysis-path prefix/tmp|/opt/rubygems|/workspace|/private/var/tmp, developer-artefact presence~/.ssh|~/.gitconfig|~/.npmrc|~/.gem/credentials|~/.bundle, uptime > 1800 s), and jitters 20-40 minutes before activating. - The payload reconstructs a URL by XOR-decoding a 4-byte-keyed hex blob, downloads
wgkit.tar.gzover plain HTTP, extracts to/tmp/.w1/, and runsbash /tmp/.w1/wg_install.sh. - A subset (
btc-wallet-tools,crypto-mnemonic-tools,web3-eth-utils,eth-address-utils,eth-keystore-utils) instead (or additionally) opens a TCP reverse shell to the C2 directly viaIO.popenwith socket bridging to/bin/sh.
The shipped C extensions are empty stubs (etheremu.rb ships only a truncated BIP39 wordlist with no Ethereum code; tx-broadcast-utils has no broadcast code; cryoto-toolbox has no crypto routines). The entire package exists to deliver the dropper.
C2 infrastructure
All C2 endpoints are on the Russian/Dutch-hosted 45.138.0.0/16 superblock across several /24s:
| Host | Port | Observed in |
|---|---|---|
45.138.12.177 | 8089 | bitcoin-rpc-lite, web3-eth-utils (reverse shell) |
45.138.12.177 | 8090 | btc-wallet-tools, crypto-mnemonic-tools, eth-address-utils (reverse shell) |
45.138.17.70 | 809 | tx-broadcast-utils |
45.138.17.177 | 8092 | tron-rb |
45.138.122.177 | 8092 | blockchain-sync-utils, kecack |
45.138.127.77 | 8092 | crypto-key-utils |
45.138.172.177 | 8092 | electrum-protocol-lite |
All of them serve the same wgkit.tar.gz → /tmp/.w1/wg_install.sh installer where the operator stages whatever current second-stage is desired.
Package inventory and source SHA-256 (all v1.0.0)
| Package | GHSA | SHA-256 of malicious release |
|---|---|---|
bitcoin-rpc-lite | GHSA-xw7g-6j29-52jp | 4567a3469d6774fbe9be233375145274adf41f8e7a20521724a9a15606351044 |
blockchain-sync-utils | GHSA-fp5m-6565-9wg5 | (dropper to 45.138.122.177:8092) |
btc-wallet-tools | GHSA-65q2-732f-r3gg | 06838084180f1f087704c390cedde5a8d3610f4895356632f938139faef7d5e3 |
electrum-protocol-lite | GHSA-8cm7-334g-4377 | 668c7bcfd51cfcc2efda2d772dc087067883a214357361a960f6db8e2a9ca1e8 |
cryoto-toolbox | GHSA-f8ww-m74w-j9mq | 3fcf75a196193219b146e937b6d9a7cf8937df152658a2d7b7b8905605c9f8a6 |
crypto-key-utils | GHSA-9vq6-8jf2-mh9q | 559eb6e590366fcb8968de4964d8eb9d61ad6149a1ce1d4696ff4f64bff1a214 |
etheremu.rb | GHSA-r55r-pjq3-j9f4 | a82ac5d3f021ab23f4f461181f4150c12d672ef421b6f80c10dd8a307178442e |
crypti-toolbox | GHSA-pv2w-f5fh-p8xw | 5ec4d5d5915335d90b2f18b45b050936fa5d2db9d176d7d081bd8c292c7c6795 |
ethereum-tx-helper | GHSA-gm98-33j2-hm68 | e870b276b866298ef1e57e1ceff7ef4e253cb43055d0163572e25646be7b8791 |
crypto-mnemonic-tools | GHSA-q7p5-w99x-qqcw | 20550e421f034d2bf7c4ca653a79a2558f3d84a49a54566e874d92cc80557469 |
crylto-toolbox | GHSA-gxwc-r8hg-vg7r | 4362469cec139567ebe3c986d7f2eca2dda837ecff87373d14d9cfbedf81e6b0 |
coinmarket-utils | GHSA-f63h-97qr-7h9q | 7ace1863ec858e5931ba2848276c14fb050fff204b2fbea82e2f64ae3f9a0ffc |
etherdum.rb | GHSA-f6c2-r38w-6v9x | a27b2952de0064d1745d45f18fc1ab974e48cfe185b8f41e90447265be1a880f |
kecack | GHSA-fj4h-hgwh-qmc6 | f17f86c78cebe16698b84a8ab5a9b87865c63a890588c23fbe1d2638c4501647 |
ligbtning-invoice | GHSA-vv4j-hg36-54f8 | 86fdee6169e308a4849aae46edf725272a04cc0fe706f18006dcde8f54f86e2a |
web3-eth-utils | GHSA-847r-2824-c2jx | 248aba9be7a8bfbd125b43640f1c52007358e34078b3bfec5430933c996b8666 |
eth-keystore-utils | GHSA-3chv-pqgw-55f8 | cd660255e3a3483ed89e81f30c696390f8b182a891f8f1fb7e4c1cbb3b52eb32 |
eth-address-utils | GHSA-cg29-22qj-86m4 | 8ed9d372d4fc694697be41c22e7c4d02d873e53e16bde2336069787b7b961ce2 |
lighthing-invoice | GHSA-j2pr-fmc4-v7mw | 206884c57f9427c6952744828fa53861634d5451b97ba86885c701ee47ef5012 |
keccka | GHSA-9c95-4459-6pcw | e4f005ef5a4a20f9aadcdd2c6e78e6d68bb52765b2f5fac2abee6abd7dd261c5 |
hdkey-derive-helper | GHSA-q82p-2pwq-fvp4 | 04f5409730ece37713b6a8d3afddcce30744e213b80759f7ae89478731b0264a |
merkle-proof-lite | GHSA-f56x-cg82-pmmp | 566447bbe57c81d3ad0e7f640951edd848b5a843c8b423ca370d96938d803cba |
tron-rb | GHSA-pfxv-45h9-p87w | a483b2d8f8273b5dca3a95d449d762cdfe9d79e8aea485cb89673c469e4cda6f |
tx-broadcast-utils | GHSA-m56c-f68h-prj5 | 60efdf159c3ce8550c985b3f19cbe72f2bfcae0266cb63fb8c0dd458b56b9901 |
web3-sign-helper | GHSA-5878-j847-4p4p | adeb83bd6e9fada6d55dfe140c32a5ae29d4b3331fb888643ebe064e6d57fc23 |
All affected at exactly version 1.0.0. No patched versions exist for any of them - the entire package is the malware.
Attribution and classification
No named-actor attribution. The targeting vertical (crypto / Web3 / Ethereum / Bitcoin / Lightning / TRON developers), the single-C2-family infrastructure (45.138.*.*), the uniform wgkit.tar.gz → /tmp/.w1/wg_install.sh installer, and the uniform anti-analysis / developer-artefact gates argue strongly for one operator rather than a loose group.
Classified malicious-package (the dominant pattern - most names are brand-adjacent lures built fresh for this wave rather than strict single-character typosquats), severity high (confirmed install-time RCE and reverse-shell payload, but reach is limited to whoever installs the lure - not a known-popular gem hijack).
Discovery
OpenSSF malicious-packages, Amazon Inspector. All 25 advisories published to GitHub Advisory Database on 2026-10-05.
Affected packages (25)
- RubyGemsbitcoin-rpc-lite1.0.0
- RubyGemsblockchain-sync-utils1.0.0
- RubyGemsbtc-wallet-tools1.0.0
- RubyGemscoinmarket-utils1.0.0
- RubyGemscrylto-toolbox1.0.0
- RubyGemscryoto-toolbox1.0.0
- RubyGemscrypti-toolbox1.0.0
- RubyGemscrypto-key-utils1.0.0
- RubyGemscrypto-mnemonic-tools1.0.0
- RubyGemselectrum-protocol-lite1.0.0
- RubyGemseth-address-utils1.0.0
- RubyGemseth-keystore-utils1.0.0
- RubyGemsetherdum.rb1.0.0
- RubyGemsetheremu.rb1.0.0
- RubyGemsethereum-tx-helper1.0.0
- RubyGemshdkey-derive-helper1.0.0
- RubyGemskecack1.0.0
- RubyGemskeccka1.0.0
- RubyGemsligbtning-invoice1.0.0
- RubyGemslighthing-invoice1.0.0
- RubyGemsmerkle-proof-lite1.0.0
- RubyGemstron-rb1.0.0
- RubyGemstx-broadcast-utils1.0.0
- RubyGemsweb3-eth-utils1.0.0
- RubyGemsweb3-sign-helper1.0.0
These are usually pulled in as transitive dependencies rather than installed directly. Check your whole tree at once - it runs in your browser and nothing is uploaded.
Impact
- All 25 gems share one operator infrastructure:
wgkit.tar.gzdropper over plain HTTP from the45.138.*.*subnet (45.138.12.177:8089,45.138.12.177:8090,45.138.17.70:809,45.138.17.177:8092,45.138.122.177:8092,45.138.127.77:8092,45.138.172.177:8092). After extracting to/tmp/.w1/, the installer runsbash /tmp/.w1/wg_install.shwith the installer user`s privileges - Install-time Ruby
eval()of a base64-decoded payload shipped insideext/<name>/extconf.rbmasquerading as a native-extension build file. The real extensions are empty C stubs; the "build" step is the entire malware - Sandbox-evasion gates skip execution under CI (
CI,GITHUB_ACTIONS,BUILDKITE,GITLAB_CI), under analysis path prefixes (/tmp,/opt/rubygems,/workspace,/private/var/tmp), under hostnames matchinguvm,firecracker,sandbox,vagrant, and when developer artefact signals (~/.ssh,~/.gitconfig,~/.npmrc,~/.gem/credentials,~/.bundle) are absent. Jittered 20-40 min sleep further defeats short-window sandboxes - A subset (
btc-wallet-tools,crypto-mnemonic-tools,web3-eth-utils,eth-address-utils,eth-keystore-utils) opens a direct TCP reverse shell to45.138.12.177:8089/:8090instead of (or in addition to) thewgkit.tar.gzfetch; the rest fetch and execute the shell script - Target profile is cryptocurrency / Web3 developer workstations: SSH keys, GitHub PATs, RubyGems API keys,
~/.ethereum/keystore, MetaMask browser profiles, hardware-wallet companion configs, and any crypto exchange CLI credentials on the host are reachable oncewg_install.shruns - Package names: 10 are deliberate single-char typosquats of real crypto gems (
crypti-toolbox/crylto-toolbox/cryoto-toolbox→crypto-toolbox;keccka/kecack→keccak;lighthing-invoice/ligbtning-invoice→lightning-invoice;etherdum.rb/etheremu.rb→ethereum.rb; plustron-rbfor the TRON vertical); 15 are brand-adjacent lures built from Ethereum / Bitcoin / Web3 ecosystem terms (eth-keystore-utils,eth-address-utils,web3-eth-utils,web3-sign-helper,crypto-key-utils,crypto-mnemonic-tools,hdkey-derive-helper,merkle-proof-lite,btc-wallet-tools,bitcoin-rpc-lite,electrum-protocol-lite,blockchain-sync-utils,coinmarket-utils,ethereum-tx-helper,tx-broadcast-utils)
What to do
- 1
grep -nE "(bitcoin-rpc-lite|blockchain-sync-utils|btc-wallet-tools|electrum-protocol-lite|cryoto-toolbox|crypto-key-utils|etheremu\.rb|crypti-toolbox|ethereum-tx-helper|crypto-mnemonic-tools|crylto-toolbox|coinmarket-utils|etherdum\.rb|kecack|ligbtning-invoice|web3-eth-utils|eth-keystore-utils|eth-address-utils|lighthing-invoice|keccka|hdkey-derive-helper|merkle-proof-lite|tron-rb|tx-broadcast-utils|web3-sign-helper|cryoto-toolbox)" Gemfile Gemfile.lock gemspecacross every repo. On any hit:gem uninstall <name>, deleteGemfile.lock, delete~/.gem/credentialstokens, rebuild from scratch - 2Host-level hunt on any machine that ran
gem installorbundle installagainst the above since 2026-10-05: look for a directory/tmp/.w1/(any user), a file/tmp/.w1.tgz, a shellbash /tmp/.w1/wg_install.shin bash history or process audit logs, outbound HTTP to45.138.12.177,45.138.17.70,45.138.17.177,45.138.122.177,45.138.127.77,45.138.172.177on ports 809, 8089, 8090, 8092. Any single hit means image the host - the dropper runs as the installing user and the second-stage is attacker-controlled, so persistence is anything the script dropped - 3Rotate on any confirmed hit: SSH keys (
~/.ssh/*), Git tokens (~/.gitconfig,~/.config/gh, GitHub/GitLab PATs), RubyGems API key (~/.gem/credentials; log in to rubygems.org, revoke old key, issue new one), npm authToken (~/.npmrc), Bundler config (~/.bundle/config), any~/.ethereum/keystore/*(treat seed phrases AS exposed - rotate the wallets, not just the config), hardware-wallet companion app secrets, exchange CLI credentials. On a developer who runsgem installas a privileged user, assume~/.aws/credentialsand~/.config/gcloudare reachable too and rotate those - 4Egress blocklist additions for CI, build hosts, and corporate developer egress proxies: deny outbound TCP to
45.138.12.177,45.138.17.70,45.138.17.177,45.138.122.177,45.138.127.77,45.138.172.177(whole/24s if your proxy supports it:45.138.12.0/24,45.138.17.0/24,45.138.122.0/24,45.138.127.0/24,45.138.172.0/24). Deny outbound HTTP (not HTTPS - the dropper is plain HTTP) by default from CI; whitelist specific HTTPS mirrors instead - 5Developer education: the real crypto gems are
crypto-toolbox,keccak,lightning-invoice,ethereum.rb,eth(noteth-*),web3(notweb3-eth-*as a bare gem), and the official hardware-wallet SDKs. Any gem that advertises Bitcoin/Ethereum/Web3 functionality at1.0.0with no release history andextconf.rbunderext/<name>/deserves a tarball inspection in a sandbox beforegem install
References
- GitHubGitHub Advisory Database - recent RubyGems malware advisoriesgithub.com
- GitHubGHSA-xw7g-6j29-52jp - rubygems bitcoin-rpc-litegithub.com
- GitHubGHSA-fp5m-6565-9wg5 - rubygems blockchain-sync-utilsgithub.com
- GitHubGHSA-65q2-732f-r3gg - rubygems btc-wallet-toolsgithub.com
- GitHubGHSA-8cm7-334g-4377 - rubygems electrum-protocol-litegithub.com
- GitHubGHSA-f8ww-m74w-j9mq - rubygems cryoto-toolbox (typosquat crypto-toolbox)github.com
- GitHubGHSA-9vq6-8jf2-mh9q - rubygems crypto-key-utilsgithub.com
- GitHubGHSA-r55r-pjq3-j9f4 - rubygems etheremu.rb (typosquat ethereum.rb)github.com
- GitHubGHSA-pv2w-f5fh-p8xw - rubygems crypti-toolbox (typosquat crypto-toolbox)github.com
- GitHubGHSA-gm98-33j2-hm68 - rubygems ethereum-tx-helpergithub.com
- GitHubGHSA-q7p5-w99x-qqcw - rubygems crypto-mnemonic-toolsgithub.com
- GitHubGHSA-gxwc-r8hg-vg7r - rubygems crylto-toolbox (typosquat crypto-toolbox)github.com
- GitHubGHSA-f63h-97qr-7h9q - rubygems coinmarket-utilsgithub.com
- GitHubGHSA-f6c2-r38w-6v9x - rubygems etherdum.rb (typosquat ethereum.rb)github.com
- GitHubGHSA-fj4h-hgwh-qmc6 - rubygems kecack (typosquat keccak)github.com
- GitHubGHSA-vv4j-hg36-54f8 - rubygems ligbtning-invoice (typosquat lightning-invoice)github.com
- GitHubGHSA-847r-2824-c2jx - rubygems web3-eth-utilsgithub.com
- GitHubGHSA-3chv-pqgw-55f8 - rubygems eth-keystore-utilsgithub.com
- GitHubGHSA-cg29-22qj-86m4 - rubygems eth-address-utilsgithub.com
- GitHubGHSA-j2pr-fmc4-v7mw - rubygems lighthing-invoice (typosquat lightning-invoice)github.com
- GitHubGHSA-9c95-4459-6pcw - rubygems keccka (typosquat keccak)github.com
- GitHubGHSA-q82p-2pwq-fvp4 - rubygems hdkey-derive-helpergithub.com
- GitHubGHSA-f56x-cg82-pmmp - rubygems merkle-proof-litegithub.com
- GitHubGHSA-pfxv-45h9-p87w - rubygems tron-rbgithub.com
- GitHubGHSA-m56c-f68h-prj5 - rubygems tx-broadcast-utilsgithub.com
- GitHubGHSA-5878-j847-4p4p - rubygems web3-sign-helpergithub.com