Wednesday, September 16, 2026

Malicious NuGet Packages Target ASP.NET Developers to Steal Login Credentials

Malicious NuGet packages posing as legitimate developer utilities are targeting ASP.NET projects to steal identity credentials and silently backdoor applications through a localhost proxy.

All four were published between August 12–21, 2024, by a NuGet user named “hamzazaheer” and have collectively amassed a little over 4,500 downloads before takedown requests were submitted.

The campaign’s core objective is to intercept ASP.NET Identity authorization flows, exfiltrate user and permission data, and inject attacker-controlled authorization rules to create persistent backdoors in victim applications.

The lead package, NCryptYo, masquerades as a cryptography library through aggressive typosquatting of the legitimate NCrypto package while shipping an obfuscated dropper instead of real encryption routines.

Socket’s Threat Research Team has uncovered a coordinated NuGet supply chain attack abusing four interlinked packages – NCryptYo, DOMOAuth2_, IRAOAuth2.0, and SimpleWriter_ – to compromise ASP.NET web application developers.

Although it exposes a public API with Encrypt and Decrypt extension methods, every method returns null, while the true malicious logic is hidden behind JIT-time decryption and runtime hooks.

VirusTotal analysis reportedly shows only 1 of 72 vendors flagging NCrypt.dll as malicious, underscoring how heavily obfuscated .NET malware can evade conventional static detection.

JIT Hooking, Localhost Proxy

Once referenced in a project, NCryptYo’s static constructor executes on assembly load, installing JIT compiler hooks that decrypt embedded payloads and deploy a second-stage binary.  

The package name targets NCrypto, the DLL filename NCrypt.dll mimics Windows’ CNG cryptography provider at C:\\Windows\\System32\\NCrypt.dll, and the namespace NCrypt matches Microsoft’s cryptography APIs.

VirusTotal analysis shows only 1 of 72 security vendors detected NCrypt.dll, highlighting the challenges of detecting heavily obfuscated .NET malware (Source : Socket's Threat Research).
VirusTotal analysis shows only 1 of 72 security vendors detected NCrypt.dll, highlighting the challenges of detecting heavily obfuscated .NET malware (Source : Socket’s Threat Research).

This stage-2 component establishes a local proxy on https://localhost:7152, which becomes the pivot point between the malicious NuGet ecosystem and external command-and-control infrastructure whose address is resolved dynamically at runtime.  

NCryptYo contains no visible networking code in its metadata, instead relying on this hidden payload and local tunnel to relay traffic for the companion packages.

DOMOAuth2_ and IRAOAuth2.0 plug directly into ASP.NET Identity flows to siphon sensitive authentication and authorization data.

DOMOAuth2_ integrates via an IServiceCollection extension that registers an internal OAuthService, then silently exfiltrates user GUIDs, role IDs, role mappings and module-level permissions whenever developers call methods like GetUserPermissions or UpdateRolePermissions.

All outbound requests are sent to https://localhost:7152/api/auth/ using a hardcoded attacker credential that is automatically applied when no API key is configured, and the token is hidden from typical JSON logging via JsonIgnore annotations.

VirusTotal sandbox results confirm this execution path, with process trees showing loaddll32.exe spawning cmd.exe which invokes rundll32.exe with the DLL.

VirusTotal sandbox analysis showing NCrypt.dll's execution via rundll32.exe (Source : Socket's Threat Research).
VirusTotal sandbox analysis showing NCrypt.dll’s execution via rundll32.exe (Source : Socket’s Threat Research).

IRAOAuth2.0 mirrors the same four exfiltration endpoints but removes all configurability, inlining the attacker’s auth token directly into each request and ignoring any caller-supplied AuthKey parameter.

Malicious NuGet Packages

This hardcoded-only channel ensures credential theft continues even if developers attempt to override or lock down DOMOAuth2_.  

Both packages also support a bidirectional control path where the C2 server can return modified permission data, allowing the attacker to dynamically grant themselves elevated roles or alter access rules at runtime.

SimpleWriter_ rounds out the toolkit by adding unconditional file write and stealthy process execution capabilities under the guise of HTML-to-PDF conversion.  

Each call to ConvertHtmlToPDF first beacons to the localhost proxy, then writes arbitrary content to disk and starts a hidden process (wkhtmltopdf.exe) with output streams redirected, regardless of network reachability.

The binary itself is not shipped in the package and is expected to be dropped by NCryptYo, giving the attacker flexible control over what actually executes on developer systems and, ultimately, in production environments.

By chaining these components, the threat actor focuses less on compromising developer endpoints directly and more on quietly weaponizing the applications those developers ship.

Once affected ASP.NET applications are deployed with these dependencies, the localhost proxy and C2 channel continue operating in production, streaming authorization data off-site and accepting attacker-supplied authorization rules that can grant admin-level access on demand.

Follow us on Google NewsLinkedIn, and X to Get Instant Updates and Set GBH as a Preferred Source in Google.

Mayura Kathir
Mayura Kathirhttps://gbhackers.com/
Mayura Kathir is a cybersecurity reporter at GBHackers News, covering daily incidents including data breaches, malware attacks, cybercrime, vulnerabilities, zero-day exploits, and more.

Hot this week

How To Access Dark Web Anonymously and know its Secretive and Mysterious Activities

What is Deep Web The deep web, invisible web, or...

How to Build and Run a Security Operations Center (SOC Guide) – 2023

Today’s Cyber security operations center (CSOC) should have everything...

Russian Hackers Bypass EDR to Deliver a Weaponized TeamViewer Component

TeamViewer's popularity and remote access capabilities make it an...

Web Server Penetration Testing Checklist – 2026

Web server pentesting is performed under three significant categories: identity,...

ATM Penetration Testing – Advanced Testing Methods to Find The Vulnerabilities

ATM Penetration testing, Hackers have found different approaches to...

Google Search Makes It Harder to See Where a Link Really Goes Before You Click

Google has begun routing some organic Search result links...

Phishing Attacks Abuse Trusted Email Infrastructure and URL Cloaking to Evade Security Filters

Phishing operators are increasingly shifting away from malware-laden attachments...

Hackers Actively Exploit Critical WooCommerce Plugin Vulnerability to Upload PHP Backdoors

Threat actors are actively exploiting a critical vulnerability in...

Weekly Cybersecurity Newsletter – Top 50 Biggest Cybersecurity Stories of the Week

Microsoft Patches 973 CVEs, Claude Agents Automate Attacks, China...

WordPress Events Calendar Vulnerabilities Let Hackers Take Over 600,000 Websites

Two critical unauthenticated vulnerability chains in the widely used...

Telegram Desktop XSS Vulnerability Lets Attackers Steal Entire Chat Histories

A stored cross-site scripting (XSS) vulnerability in Telegram Desktop...

Marimo RCE Flaw Lets Hackers Steal AWS Credentials and Pivot to Bastion Host in 8 Seconds

A threat actor exploited a critical pre-authentication remote code...

Related Articles

Recent News