Cloud Threat Landscape
  • Incidents
  • Actors
  • Techniques
  • Defenses
  • Tools
  • Targeted Technologies
  • Posters & Newspapers
  • About
  • RSS
  • STIX
  • Back to wiz.io

Made with 💙 by Wiz

Last Updated: April 3, 2025

Cloud Threat Landscape
/Incidents
Incidents
/
Supply Chain Compromise of rand-user-agent: Obfuscated RAT with C2 Communication and File Exfiltration

Supply Chain Compromise of rand-user-agent: Obfuscated RAT with C2 Communication and File Exfiltration

Type
Campaign
Actors
❓Unknown
Pub. date
May 5, 2025
Initial access
Supply chain vector
Impact
Supply chain attack
Observed techniques
Supply Chain Compromise
Targeted technologies
npm
References
https://www.aikido.dev/blog/catching-a-rat-remote-access-trojian-rand-user-agent-supply-chain-compromise
Status
Finalized
Last edited
May 22, 2025 12:23 PM

Researchers detected a malicious update to the popular npm package rand-user-agent, used for generating randomized user-agent strings. The attacker published multiple unauthorized versions (1.0.110, 2.0.83, 2.0.84) containing heavily obfuscated code designed to covertly install a Remote Access Trojan (RAT). This RAT establishes a persistent communication channel with a command-and-control server and exfiltrates data via HTTP POST requests.

The malware dynamically installs required dependencies (axios, socket.io-client) in a hidden .node_modules folder within the user’s home directory. It supports a range of remote commands — from changing directories and uploading files to executing arbitrary shell commands. On Windows, it leverages a PATH hijack by prepending a fake Python directory to the PATH environment variable, enabling silent execution of attacker-controlled binaries.