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

· Original article ↗

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

TypeIndicatorContext
SHA25644f3766323d813752e9ec879edf17a284f5ed971f814777f18f5e8f83c1ff5baSHA-256 hash identified for the malicious DOMOAuth2_ OAuth2.0.dll artifact.
SHA2566d64d0ca9b3262eb00396e2c441a389fb748b750a3f16b8d086456cc3364d397SHA-256 hash identified for the malicious IRAOAuth2.0 OAuth2.0.dll artifact.
SHA2567c1a9a681411c528ee2bd291450d955f9d599a03cf34a530d9c526451c63c0aaSHA-256 hash identified for the malicious NCryptYo/NCrypt.dll artifact.
SHA256c2ac85bcbf38c6a4e1b4ba971742f126eb0deaf486b7bd396858d98a3773de73SHA-256 hash identified for the malicious SimpleWriter_.dll artifact.

MITRE ATT&CK

Threat Actors

Products

Tools

Related Articles