Distributed npm Package Cluster Delivers Cross-Platform RAT Targeting Alibaba Developers

Distributed npm Package Cluster Delivers Cross-Platform RAT Targeting Alibaba Developers
Unknown threat actors used a multi-package npm campaign to impersonate Alibaba private packages and deliver a staged downloader that ultimately deployed a targeted RAT against developers using Alibaba Group tools. The final payload enabled data theft, remote command execution, lateral movement through DingTalk, and platform-specific persistence across macOS, Windows, and Linux. #lib-mtop #aone-cli #DingTalk #AlibabaGroup

Keypoints

  • Malicious npm packages impersonated private @ali-scoped Alibaba packages to lure developers into installing the dependency tree.
  • The campaign used multiple package layers, with seemingly benign packages combining to provide downloader functionality and evade detection for about three months.
  • cloud-config-fetcher fetched attacker-controlled configuration from GitHub, while local-config-parser evaluated rules from a local file to trigger execution.
  • The malicious rule code escaped Node.js vm sandbox protections using constructor-based access to the global Function and process objects.
  • The third-stage payload downloaded from Alibaba Cloud performed reconnaissance, fingerprinting, and platform-specific persistence on macOS, Windows, and Linux.
  • The final aone-cli payload was a cross-platform RAT capable of command execution, file transfer, proxying, application-specific persistence, and DingTalk lateral movement.
  • Defenders are advised to treat affected systems as compromised, inspect for injected Python markers, and rotate exposed secrets from clean machines.

MITRE Techniques

  • [T1027 ] Obfuscated Files or Information – The malicious code hid in configuration rules and was camouflaged inside a normal-looking expression (‘the code pretends to be a normal configuration rule’).
  • [T1059.007 ] JavaScript – The initial loader and payload logic were implemented in JavaScript within npm packages (‘fetching a hardcoded remote JavaScript payload using curl’).
  • [T1059.006 ] Python – Persistence was achieved by patching Python scripts in .skills directories to launch malicious code (‘patching Python scripts located inside .skills directories’).
  • [T1105 ] Ingress Tool Transfer – The campaign downloaded multiple stages from attacker-controlled GitHub and Alibaba Cloud infrastructure (‘downloads a third-stage setting.js payload’ / ‘downloads a binary payload’).
  • [T1055 ] Process Injection – The RAT used code injection into targeted tools by modifying their scripts to execute the malicious payload (‘poisoning of AI-tools by patching Python scripts’).
  • [T1546.011 ] Event Triggered Execution: Application Shimming / Script Modification – Modified startup-related files to trigger execution on launch (‘Inserts malicious background script into ~/.zshrc’).
  • [T1547.001 ] Registry Run Keys / Startup Folder – On macOS, persistence was established via Launch Agent and shell startup files (‘sets up a 10-minute Launch Agent’).
  • [T1021 ] Remote Services – The final payload supported lateral movement and remote interaction across systems (‘DingTalk lateral movement’ / ‘encrypted reverse TCP proxy’).
  • [T1053.005 ] Scheduled Task/Job: Scheduled Task – macOS persistence included a timed Launch Agent, functionally similar to scheduled execution (‘sets up a 10-minute Launch Agent’).
  • [T1041 ] Exfiltration Over C2 Channel – The RAT supported data exfiltration and polling of commands via C2 (‘command execution, arbitrary file upload and download’).
  • [T1110 ] Brute Force – Not mentioned.
  • [T1204 ] User Execution – The malicious packages were activated when targets installed dependency trees (‘trigger the installation of the dependency tree’).
  • [T1059.012 ] Command and Scripting Interpreter: Node.js – The attack relied on Node.js package execution, require(), and the vm module (‘uses the vm module for isolated expression evaluation’).
  • [T1059.004 ] Unix Shell – The RAT forwarded arbitrary commands to the local operating-system shell (‘anything else is forwarded to the local operating-system shell’).

Indicators of Compromise

  • [npm packages ] malicious dependency tree and lure packages – lib-mtop, aone-kit-cli, smart-config-manager, and 2 more packages
  • [GitHub repository / maintainer account ] configuration hosting and package publication – smi1e2u, smart-config-manager repository
  • [URLs ] attacker-controlled config and payload hosting – hxxps://raw[.]githubusercontent[.]com/smi1e2u/smart-config-manager/main/defaults/preferences.json, hxxps://aone-cli-next[.]oss-cn-beijing[.]aliyuncs[.]com/config/setting.js
  • [URLs ] staged payload delivery endpoints – hxxps://aone-ai-cli[.]oss-cn-beijing[.]aliyuncs[.]com/app/release/aone-cli.js, hxxps://aone-ai-cli[.]oss-cn-beijing[.]aliyuncs[.]com/app/release/aone-cli.zip
  • [C2 domains ] command-and-control infrastructure – xemzqli2vu[.]ai-app[.]pub, diamond-cli-znsxphqell[.]cn-shanghai[.]fcapp[.]run
  • [File hashes ] malicious payloads and configs – 84a6ccaaab1596139d28e822f40cc99c68d337d4c81d1c6d9692c1d6bb22e4af, 6044974c633b3a319c31bb32110411520c425e89722a64806528553227e7a50a
  • [File hashes ] additional payload artifacts – 0910ecfa049738ef3f2540855341a380df89224ff71da94b4c21689fd66f62e3, b8b81af76163bdcc5b4f7d8fe6795f164991f8a62678c971db031b9e90a27813, and 3 more hashes
  • [File names ] deployed payloads and injected artifacts – aone-cli.js, aone-cli.zip, script.js
  • [Environment variables ] host marker used for detection – ROBOT_UID=3201d407b7899a12d6d439950511c6a5
  • [Markers ] injection marker for compromised Python files – # __INJECT_MARKER__


Read more: https://socket.dev/blog/npm-rat-targets-alibaba