Four Malicious NuGet Packages Use JIT Hooking to Target ASP.NET Developers

Summary
Socket researchers link four NuGet packages to a coordinated supply-chain campaign. Analysis found a JIT-hooking dropper, a localhost:7152 proxy, ASP.NET Identity data theft and permission injection, plus file writing and hidden execution.
Key points
- The packages NCryptYo, DOMOAuth2_, IRAOAuth2.0 and SimpleWriter_ were published by hamzazaheer between Aug. 12 and 21, 2024, and had accumulated more than 4,500 downloads.
- NCryptYo uses an obfuscated, execution-on-load dropper that hooks the .NET JIT, decrypts a stage-two payload and establishes a local proxy on localhost:7152.
- DOMOAuth2_ and IRAOAuth2.0 send ASP.NET Identity account and permission data through the proxy; their responses can modify authorization data at runtime.
- SimpleWriter_ can write caller-directed content to disk and execute a local binary in a hidden window; the article says these actions can occur even if the C2 is unreachable.
- Shared authentication-token content, build settings and metadata support the researchers’ assessment that the packages are linked. The packages also use anti-debugging and multiple obfuscation layers.
- The packages’ distribution method remains unclear. The researchers recommend auditing dependencies, checking static constructors and obfuscation, and enabling NuGet signatures and lock files.
Article Details
- Attack Vectors
- Four malicious NuGet packages used typosquatting to target ASP.NET developers and compromise software dependencies.
- NCryptYo executes on assembly load, hooks the .NET JIT, decrypts an embedded stage-2 payload, and deploys a local proxy.
- DOMOAuth2_ and IRAOAuth2.0 send ASP.NET Identity authorization data through the proxy and accept attacker-controlled permission responses.
- SimpleWriter_ writes attacker-controlled content to disk and can execute a local binary with a hidden window.
- The article reports anti-debugging, tamper checks, .NET Reactor obfuscation, and IL virtualization to hinder analysis.
- Defensive Notes
- Audit dependencies for typosquatting, suspicious publishers, unusual publication patterns, and unexpectedly low download counts.
- Inspect package static constructors and decompile suspicious packages, especially those with obfuscation markers, stubbed public methods, or large embedded resources.
- Enable NuGet package signature verification and lock files, and scan dependencies in CI/CD before deployment.
- Monitor for JIT compiler manipulation, unusual localhost connections on port 7152, hardcoded authentication tokens, and hidden process execution.
- Treat packages that modify the CLR runtime or combine anti-debugging with multi-stage obfuscation as high risk.
Indicators of compromise
| Type | Indicator | Context |
|---|---|---|
| SHA256 | 44f3766323d813752e9ec879edf17a284f5ed971f814777f18f5e8f83c1ff5ba | SHA-256 hash identified for the malicious DOMOAuth2_ OAuth2.0.dll artifact. |
| SHA256 | 6d64d0ca9b3262eb00396e2c441a389fb748b750a3f16b8d086456cc3364d397 | SHA-256 hash identified for the malicious IRAOAuth2.0 OAuth2.0.dll artifact. |
| SHA256 | 7c1a9a681411c528ee2bd291450d955f9d599a03cf34a530d9c526451c63c0aa | SHA-256 hash identified for the malicious NCryptYo/NCrypt.dll artifact. |
| SHA256 | c2ac85bcbf38c6a4e1b4ba971742f126eb0deaf486b7bd396858d98a3773de73 | SHA-256 hash identified for the malicious SimpleWriter_.dll artifact. |
MITRE ATT&CK
T1027 · Obfuscated Files or InformationThe packages use .NET Reactor, IL virtualization, encrypted resources, and custom VM bytecode to conceal malicious logic.T1036.005 · Match Legitimate Resource Name or LocationNCryptYo typosquats the legitimate NCrypto package and uses the NCrypt.dll filename to mimic Windows cryptography APIs.T1055 · Process InjectionThe stage-2 payload uses VirtualAlloc, WriteProcessMemory, and OpenProcess for process injection.T1071.001 · Web ProtocolsThe companion packages make HTTP requests to the local proxy, which relays their traffic to external C2 infrastructure.T1140 · Deobfuscate/Decode Files or InformationNCryptYo decrypts embedded resources and stage-2 payload content at runtime through JIT-level decryption.T1195.002 · Compromise Software Supply ChainThe article describes four malicious NuGet packages published to compromise software dependencies used by ASP.NET developers.T1562.001 · Disable or Modify ToolsThe malware checks for an attached debugger and uses RSA signature verification and tamper checks to hinder analysis.T1572 · Protocol TunnelingA proxy deployed on localhost:7152 tunnels companion-package traffic to an external C2 address resolved at runtime.T1574.002 · DLL Side-LoadingThe article describes DLL side-loading as an execution vector and reports that NCrypt.dll exports an entry point callable through rundll32.exe.
Threat Actors
Products
.NETThe packages, published Aug 12–21, 2024 by author hamzazaheer, use typosquatting, heavy .NET obfuscation, JIT compiler hooks and embedded credentials to create persistent backdoors and remote permission injection inASP.NET IdentitySimpleWriter_) deploy a multi-stage payload that establishes a localhost proxy and exfiltrates ASP.NET Identity data.NCryptoLocation – Typosquatting and naming mimicry (package name, DLL filename, namespace) imitate legitimate NCrypto and Windows crypto APIs (‘deliberate typosquatting of the legitimate NCrypto package’ and ‘DLL filenameNuGetSocket’s Threat Research Team discovered a coordinated NuGet supply chain attack where four malicious packages (NCryptYo, DOMOAuth2_, IRAOAuth2.0, SimpleWriter_) deploy a multi-stage payload that establishes a localhost
