A user named Disti has published malicious NuGet packages on the package manager for the .NET Framework. These packages include a typosquat of a legitimate package and several others that masquerade as crypto service libraries but actually deploy a remote access trojan (RAT). The discovery of these malicious packages highlights the exploitation of open-source ecosystems by attackers .
A user named Disti has uploaded malicious NuGet packages on the package manager for the .NET Framework. One of these packages , called Pathoschild.Stardew.Mod.Build.Config    , is a typosquat of a legitimate package called Pathoschild.Stardew.ModBuildConfig    . The malicious variant has artificially inflated its download count to surpass 100,000 downloads   . Disti has also uploaded six other packages that pretend to be crypto service libraries but actually deploy the SeroXen remote access trojan (RAT).
The attack chain begins with the installation of the package through a PowerShell script   . This script downloads a heavily-obfuscated Windows Batch script  , which is responsible for constructing and executing another PowerShell script to deploy the SeroXen RAT . The SeroXen RAT is a fileless RAT that combines the functions of Quasar RAT   , the r77 rootkit   , and NirCmd   .
Furthermore, additional malicious NuGet packages have been discovered that impersonate crypto wallets , crypto exchanges  , and Discord libraries  . These packages were also uploaded by the user named Disti and contain an XML file that downloads an obfuscated Windows batch file to carry out malicious activities . It is important to note that the download numbers for these packages may be inflated and do not necessarily reflect their reach in the NuGet community.
These malicious NuGet packages have gained significant attention, with over 2 million downloads , as they are being used to distribute the SeroXen RAT. They specifically target developers by impersonating popular crypto wallets, crypto exchanges  , and Discord libraries  . The installation process involves the execution of PowerShell scripts that download and execute CMD and Batch files from external URLs . One of the downloaded files , named ‘x.bin,’ is an obfuscated batch script with over 12,000 lines . Its purpose is to construct and execute another PowerShell script . The final script decrypts and decompresses an encoded payload , which is identified as the SeroXen RAT . This RAT is marketed as a legitimate program and is sold for a monthly fee or a one-time purchase . It is gaining popularity among cybercriminals due to its low detection rates and powerful capabilities .
The discovery of these malicious NuGet packages highlights the vulnerability of open-source ecosystems to exploitation by attackers. It is crucial for developers to be cautious when downloading and installing packages, especially those impersonating popular crypto wallets, crypto exchanges  , and Discord libraries  . Mitigations should include verifying the legitimacy of packages and their download counts, as well as regularly updating security measures. The use of fileless RATs like SeroXen RAT poses a significant threat due to their low detection rates and powerful capabilities. As cybercriminals continue to exploit open-source ecosystems, it is important for the community to remain vigilant and proactive in protecting against such attacks.