Cybersecurity researchers at ReversingLabs have uncovered a persistent and coordinated campaign targeting the NuGet package manager. This campaign, active since August 1, 2023 , aims to distribute the SeroXen RAT remote access trojan by releasing new malicious packages. The threat actors exploit NuGet’s MSBuild integrations feature to insert malicious code onto victims’ systems , a method never seen before in the NuGet repository.
The campaign involves the continuous release of new malicious packages that cleverly imitate popular ones. The threat actors use spaces and tabs to conceal the malicious code and artificially inflate the download counts to appear more legitimate . They demonstrate persistence by continuously publishing new malicious packages, showing their commitment to sustaining this operation .
Recently, ReversingLabs detected three packages, ZendeskApi.Client.V2 , Betalgo.Open.AI , and Forge.Open.AI , that are part of the same campaign . These packages employ a new code execution technique by downloading the payload from a GitHub repository instead of an attacker-controlled IP address. The attackers have evolved their techniques , using NuGet’s MSBuild integrations feature to execute malicious code     . The new code execution technique involves placing the malicious functionality inside the <packageID>.targets file in the “build” directory . This technique was first observed in version 6.5.3 of the Pathoschild.Stardew.Mod.Build.Config package .
The ultimate goal of these decoy packages is to serve as a conduit for retrieving a second-stage .NET payload from a temporary GitHub repository . The threat actor behind this campaign is meticulous and detail-oriented  , determined to keep this malicious campaign alive and active. It is worth noting that ReversingLabs quickly detected and removed these malicious packages. They are linked to a previous campaign reported by Phylum , which delivered the SeroXen RAT malware using PowerShell scripts . The previous campaign , starting in August 2023 , included over 700 packages . The malicious functionality in these packages was simple  , downloading and executing a stage 2 payload . The packages were not sophisticated and were easily detected due to naming conventions and other factors .
The discovery of this persistent and coordinated campaign targeting the NuGet package manager highlights the need for enhanced security measures. The use of new code execution techniques and the continuous release of malicious packages demonstrate the evolving tactics of threat actors. It is crucial for organizations to remain vigilant and implement robust security measures to detect and mitigate such threats. Additionally, this campaign serves as a reminder of the importance of timely detection and removal of malicious packages to protect users from potential harm.