A supply chain attack targeting .NET developers has been detailed by cybersecurity researchers, exposing the inner workings of the cryptocurrency stealer malware that was distributed via 13 malicious NuGet packages. The campaign impersonated legitimate packages to execute PowerShell code and retrieve a follow-on binary from a hard-coded server.
The two-stage attack culminates in the deployment of a .NET-based persistent backdoor called Impala Stealer, which can gain unauthorized access to users’ cryptocurrency accounts.
The payload used a rare obfuscation technique, called ‘.NET AoT compilation,’ to make the binary hard to reverse engineer while being more stealthy than using off-the-shelf obfuscators.
Furthermore, native AOT apps have faster startup time and smaller memory footprints, and can run on a machine without .NET runtime installed. The second-stage payload is designed with an auto-update mechanism that can retrieve new versions of the executable from a remote location, and it achieves persistence by injecting JavaScript code into Discord or Microsoft Visual Studio Code apps, activating the launch of the stealer binary.
Additionally, the bad actors used typosquatting techniques to deploy a custom malicious payload, which targets the Exodus crypto wallet and leaks the victim’s credentials to cryptocurrency exchanges using code injection.
At the same time, security experts warn that no open-source software repository is completely trustworthy, and safety measures should be taken at every step of the software development lifecycle to ensure the software supply chain remains secure.
The malware was uncovered as Phylum found a malicious npm package named mathjs-min that was uploaded to the repository on March 26, 2023, and was found to harbor a credential stealer that grabs Discord passwords from the official app and web browsers like Google Chrome, Brave, and Opera.