Threat reportSupply ChainTL-2026-0137
Malicious NuGet Packages — JIT Hooking ASP.NET Identity Exfiltration and Persistent Backdoor via Local Proxy C2
Socket Security discovered 4 malicious NuGet packages (NCryptYo, DOMOAuth2_, IRAOAuth2.0, SimpleWriter_) published by threat actor 'hamzazaheer' targeting ASP.NET developers. NCryptYo is a heavily obfuscated stage-1 dropper using JIT compiler hooks to decrypt embedded payloads and deploy a localhost proxy on port 7152.
Key facts
| Identifiers | TL-2026-0137 |
|---|---|
| Also known as | NCryptYo Campaign, NuGet JIT Hook Campaign |
| Severity | HIGH |
| Affected products | Microsoft NuGet Package Manager; Microsoft ASP.NET Identity; Microsoft .NET Runtime |
| Weaknesses (CWE) | CWE-494, CWE-829, CWE-506 |
| Tools | 06062730-b307-48a6-a7c3-140e6bae4587 |
| MITRE ATT&CK techniques | T1005 Data from Local System, T1027 Obfuscated Files or Information, T1027.009 Embedded Payloads, T1036.005 Match Legitimate Resource Name or Location, T1041 Exfiltration Over C2 Channel, T1055 Process Injection, T1059.001 PowerShell, T1069.002 Domain Groups, T1071.001 Web Protocols, T1087.002 Domain Account, T1090.001 Internal Proxy, T1106 Native API and 13 more in the attack flow |
| Motivation | FINANCIAL |
| Target sectors | technology, developer, enterprise, financial, government |
| Target regions | Global |
| Detection rules | 9 (1 shown free) |
| Sources | 10 cited sources |
Detection coverage
As of 2026-02-24, Threadlinqs Intelligence publishes 9 detection rule(s) for TL-2026-0137 across Splunk SPL, Microsoft KQL and Sigma, covering 17 indicator(s) of compromise. The whole corpus is readable without an account. Every threat comes with one complete detection in Splunk SPL, Microsoft KQL and Sigma, free for everyone; a free account adds daily TL Creds to unlock the rest. Paid plans add a larger daily allowance, correlation and the MCP server. Threadlinqs MCP server · View plans.
Free detection: NCryptYo JIT Compiler vtable Hook via VirtualAlloc Shellcode, .NET Reactor Obfuscation, and NuGet Supply Chain Dropper
Detects exploitation: NCryptYo NuGet package static constructor firing on assembly load, JIT compiler compileMethod vtable hijack via VirtualAlloc with RWX shellcode (39 bytes x64, 29 bytes x86, 32 bytes ARM64), .NET Reactor obfuscation markers, AES-256-CBC decryption of 5 embedded resources (126 KB stage-2), rundll32.exe loading NCrypt.dll from non-system path, Debugger.IsAttached anti-debug, 14-day time bomb execution guardrail. 1/72 AV detection rate.
- Languages: Splunk SPL, Microsoft KQL, Sigma
- ATT&CK: T1195.002, T1204.002, T1055, T1106, T1027, T1027.009, T1140, T1574.002, T1036.005, T1480, T1497.001
- Data sources: sysmon, edr_process_logs, image_load_logs
- Severity: critical
- Confidence: high
Splunk SPL
index=sysmon sourcetype="XmlWinEventLog:Microsoft-Windows-Sysmon/Operational"
| search (
(EventCode=7 ImageLoaded="*NCrypt*" NOT ImageLoaded="C:\\Windows\\System32\\*" NOT ImageLoaded="C:\\Windows\\SysWOW64\\*")
OR (EventCode=1 Image="*rundll32.exe" CommandLine="*NCrypt.dll*" NOT CommandLine="*System32*")
OR (EventCode=8 CallTrace="*VirtualAlloc*" SourceImage="*dotnet*")
OR (EventCode=7 ImageLoaded="*clrjit*" CallTrace="*VirtualAlloc*")
)
| eval alert_type=case(
EventCode=7 AND match(ImageLoaded, "NCrypt") AND NOT match(ImageLoaded, "System32|SysWOW64"), "ncrypt_dll_sideload",
EventCode=1 AND match(CommandLine, "NCrypt\.dll"), "rundll32_ncrypt_execution",
EventCode=8 AND match(CallTrace, "VirtualAlloc"), "virtualalloc_from_dotnet",
EventCode=7 AND match(ImageLoaded, "clrjit"), "jit_compiler_load_with_hook",
1=1, "unknown"
)
| table _time, Computer, User, Image, ImageLoaded, CommandLine, CallTrace, alert_typeMicrosoft KQL
let ncrypt_sideload = DeviceImageLoadEvents
| where Timestamp > ago(24h)
| where FileName =~ "NCrypt.dll"
| where not(FolderPath startswith "C:\\Windows\\System32" or FolderPath startswith "C:\\Windows\\SysWOW64")
| extend AlertType = "ncrypt_dll_sideload";
let rundll32 = DeviceProcessEvents
| where Timestamp > ago(24h)
| where FileName =~ "rundll32.exe"
| where ProcessCommandLine has "NCrypt.dll"
| where ProcessCommandLine !has "System32"
| extend AlertType = "rundll32_ncrypt_ordinal";
let virtualalloc = DeviceProcessEvents
| where Timestamp > ago(24h)
| where InitiatingProcessFileName has_any ("dotnet", "w3wp", "iisexpress")
| where ProcessCommandLine has "VirtualAlloc"
| extend AlertType = "virtualalloc_rwx_from_dotnet";
union ncrypt_sideload, rundll32, virtualalloc
| project Timestamp, DeviceName, AccountName, FileName, FolderPath, ProcessCommandLine, AlertType
| sort by Timestamp descSigma
title: NCrypt.dll Loaded from Non-System Directory (NuGet Supply Chain DLL Side-Loading)
id: ccd75b54-36d1-404d-b205-8ccb3846dc8a
status: experimental
description: Detects NCrypt.dll loaded from application directory instead of System32/SysWOW64. NCryptYo malicious NuGet package drops NCrypt.dll for DLL side-loading. Also detects rundll32.exe NCrypt.dll,#1 ordinal execution.
references:
- https://socket.dev/blog/nuget-jit-hook-supply-chain
author: Threadlinqs Team
date: 2026/02/24
tags:
- attack.defense_evasion
- attack.t1574.002
- attack.t1195.002
- attack.t1055
logsource:
product: windows
category: image_load
detection:
selection:
ImageLoaded|contains: 'NCrypt'
ImageLoaded|endswith: '.dll'
filter:
ImageLoaded|startswith:
- 'C:\\Windows\\System32'
- 'C:\\Windows\\SysWOW64'
condition: selection and not filter
falsepositives:
- Legitimate applications shipping their own NCrypt wrapper DLL (rare)
- Development environments with local NCrypt test builds
level: criticalKnown false positives:
- Legitimate applications shipping their own NCrypt wrapper DLL (rare)
- Development environments with local NCrypt test builds
- NuGet JIT Hook Supply Chain Multi-Signal Detection: VirtualAlloc Shellcode, NCrypt Side-Load, and .NET Reactor Obfuscation · unlock with TL Creds
- ASP.NET Identity Database Bulk Access, OAuth Token Theft, and Arbitrary File Write to Web Application Directories · unlock with TL Creds
- [indicator] Stage-2 C2 Proxy Traffic on Port 7152, External C2 Relay, and Two-Stage Architecture Detection · unlock with TL Creds
- rundll32.exe Loading NCrypt.dll via Ordinal from Non-System Directory ([indicator] JIT Hook Dropper) · unlock with TL Creds
- Hidden wkhtmltopdf.exe Execution from Non-Standard Path and Arbitrary File Write to Web Application Directories · unlock with TL Creds
- Malicious NuGet Package Campaign Detection: [indicator], [indicator], [indicator], [indicator] Package Installation and Execution · unlock with TL Creds
- ASP.NET Identity Credential Exfiltration, OAuth Token Theft, and Persistent Authorization Backdoor via Malicious NuGet Packages · unlock with TL Creds
- Localhost Port 7152 C2 Relay Proxy, GZip+Custom Base64 Tunneling, and [indicator] Stage-2 Deployment · unlock with TL Creds
Indicators of compromise
As of 2026-02-24, Threadlinqs Intelligence tracks 17 indicators of compromise for TL-2026-0137.
Sample indicators (3 of 17)
- File hash:
7c1a9a681411c528ee2bd291450d955f9d599a03cf34a530d9c526451c63c0aa - File hash:
44f3766323d813752e9ec879edf17a284f5ed971f814777f18f5e8f83c1ff5ba - File hash:
6d64d0ca9b3262eb00396e2c441a389fb748b750a3f16b8d086456cc3364d397
Defanged, TLP:CLEAR. Full set of 17 indicators: unlock with TL Creds.
Technical analysis
Companion packages exfiltrate ASP.NET Identity data (users, roles, permissions) and accept attacker-controlled authorization rules creating persistent backdoors in production applications. 4,500+ downloads. 1/72 AV detection rate.
Socket Security's Threat Research Team discovered a sophisticated NuGet supply chain attack involving four coordinated malicious packages targeting ASP.NET web application developers. The campaign deploys a multi-stage payload architecture where each package serves a distinct role in the kill chain.
NCryptYo is the stage-1 dropper that masquerades as the legitimate NCrypto cryptography library through a three-layer naming attack: the package name typosquats NCrypto, the DLL filename NCrypt.dll mimics Windows' CNG cryptography provider (C:\Windows\System32\NCrypt.dll), and the namespace NCrypt matches Microsoft's cryptography APIs. All public methods return null unconditionally — the real functionality is encrypted and only decrypted at runtime through JIT compiler manipulation.
The dropper uses a sophisticated execution-on-load technique: its static constructor fires immediately when the assembly loads (requiring only a 'using NCrypt;' statement). It installs JIT compiler hooks by hijacking the .NET runtime's compileMethod vtable entry using native OS functions (VirtualAlloc on Windows, mmap on Unix). Platform-specific shellcode is written: 39 bytes for x64, 29 bytes for x86, 32 bytes for ARM64 (targeting Apple Silicon). Every method carries [MethodImpl(MethodImplOptions.NoInlining)] to force all calls through the modified JIT where encrypted method bodies are decrypted and compiled.
The DLL is protected with Eziriz .NET Reactor obfuscator (unregistered version with 14-day time bomb), [SuppressIldasm] attributes, RSA signature verification for tamper detection, and a custom VM engine implementing IL virtualization — a second obfuscation layer where critical methods are converted to proprietary bytecode. Five encrypted resources are embedded, with the largest being a 126 KB DOS executable (stage-2 payload) encrypted with AES-256-CBC. A second AES key, obfuscated across 200 lines of arithmetic, decrypts an RSA key. Thirteen SHA256 hashes are stored in the .text section for VM engine operation.
Anti-analysis defenses include Debugger.IsAttached checks, RSA signature verification against SHA1 hash of PE sections, and the time bomb. The DLL exports an entry point at ordinal #1, enabling standalone execution via rundll32.exe NCrypt.dll,#1 — providing distribution beyond NuGet. VirusTotal shows only 1/72 detection rate.
The stage-2 payload (126 KB) establishes a localhost proxy on port 7152 that relays traffic to the attacker's external C2 server. The C2 address is dynamically retrieved at runtime, never appearing in static artifacts. NCryptYo itself contains zero networking code — all System.Net.* types are absent from metadata.
DOMOAuth2_ integrates into ASP.NET applications via dependency injection (AddOAuth extension method) and exfiltrates ASP.NET Identity data through four API endpoints: get-permissions (AspUserId, AspRoleId), get-role-permissions (RoleId, RoleName), update-role-permissions (RoleId, ModuleIds), update-user-permissions (UserId, AspNetUserId, UserRoles). Every request includes a hardcoded auth token. The C2 response through the Message.Data field (typed dynamic) enables injection of modified authorization rules — creating a persistent backdoor where the attacker can grant admin roles, modify access controls, or disable security checks.
IRAOAuth2.0 implements the same four endpoints but removes all configurability — the hardcoded auth token is inlined and caller-supplied keys are completely ignored. This creates a redundant exfiltration channel that operates even if DOMOAuth2_ is discovered and disabled.
SimpleWriter_ presents as a PDF conversion utility but unconditionally writes attacker-controlled content to disk and executes local binaries with CreateNoWindow=true. Every ConvertHtmlToPDF() call beacons to the C2, writes files, and spawns hidden processes. The wkhtmltopdf.exe binary isn't shipped — it's placed by the NCryptYo stage-1 dropper.
All three companion packages share a byte-identical authentication token encoded with GZip compression and custom Base64 substitutions (_@_ for +, _~_ for /, _@@_ for =). The decoded token reveals a hardcoded API key and ProjectId (06062730-b307-48a6-a7c3-140e6bae4587). Assembly metadata shows identical build environments (Windows NT 10.0.22631, NuGet Pack 6.10.0.97, LangVersion 12.0). PDB paths expose source locations: E:\Projects\A-Mark\Authorization\OAuth2.0\ and E:\Projects\ArhamSoft-Projects\ideal-broccoli\SimpleWriter\. Published between August 12-21, 2024 by 'hamzazaheer'.
The campaign's objective is not to compromise developer machines directly but to compromise the applications they build. The authorization backdoor persists into production deployments, enabling the attacker to grant admin access to any deployed instance.
MITRE ATT&CK techniques by tactic:
collection
T1005 Data from Local System; T1213 Data from Information Repositories
defense-evasion
T1027 Obfuscated Files or Information; T1027.009 Embedded Payloads; T1036.005 Match Legitimate Resource Name or Location; T1055 Process Injection; T1140 Deobfuscate/Decode Files or Information; T1480 Execution Guardrails; T1497.001 System Checks
exfiltration
T1041 Exfiltration Over C2 Channel
execution
T1059.001 PowerShell; T1106 Native API; T1204.002 Malicious File
discovery
T1069.002 Domain Groups; T1087.002 Domain Account
command-and-control
T1071.001 Web Protocols; T1090.001 Internal Proxy; T1572 Protocol Tunneling
initial-access
T1195.002 Compromise Software Supply Chain; T1199 Trusted Relationship
credential-access
T1528 Steal Application Access Token; T1555 Credentials from Password Stores
privilege-escalation
T1546.015 Component Object Model Hijacking
stealth
defense-impairment
Remediation
Immediate actions
- Remove NCryptYo, DOMOAuth2_, IRAOAuth2.0, and SimpleWriter_ from all projects
- Scan for localhost:7152 connections in network logs — indicates active C2 proxy
- Check for NCrypt.dll in project output directories — compare SHA256 against IOCs
- Audit ASP.NET Identity data for unauthorized role/permission modifications
- Rotate all credentials stored in ASP.NET Identity if compromise suspected
- Kill any process listening on port 7152 and investigate its origin
Workarounds
- Verify package names carefully — NCryptYo typosquats legitimate NCrypto
- Inspect static constructors in .NET packages — execution-on-load is a red flag
- Decompile suspicious packages and check for .NET Reactor obfuscation markers
- Block localhost:7152 at application firewall level if not used legitimately
Longer-term hardening
- Implement NuGet package signature verification — require signed packages from trusted publishers
- Enable packages.lock.json to pin dependency versions and detect unexpected changes
- Add CI/CD security scanning that analyzes package contents before production builds
- Monitor for JIT compiler manipulation indicators (getJit, compileMethod, VirtualProtect hooks)
- Deploy network monitoring for persistent localhost connections to non-standard ports
- Use Socket Security or similar tools to detect typosquatting and obfuscation in dependencies
Affected and fixed versions
- Microsoft — NuGet Package Manager
Vulnerable versions: All versions consuming unverified packages
Fixed in: Protected by package signature verification - Microsoft — ASP.NET Identity
Vulnerable versions: All versions when malicious packages are installed
Fixed in: Remove malicious packages and audit Identity data - Microsoft — .NET Runtime
Vulnerable versions: netstandard2.1, net8.0 (JIT hook targets)
Fixed in: No runtime patch — remove malicious packages
Timeline
- First malicious NuGet package published by threat actor 'hamzazaheer'. Campaign begins with coordinated uploads over 9-day window.
- Packages begin accumulating downloads. NCryptYo typosquats legitimate NCrypto (5.7K downloads since 2013). Campaign reaches 4,500+ total downloads.
- Last of 4 malicious packages published. All packages (NCryptYo, DOMOAuth2_, IRAOAuth2.0, SimpleWriter_) now live on NuGet.org.
- VirusTotal analysis shows only 1/72 security vendors detect NCrypt.dll. Sandbox confirms rundll32.exe execution path via ordinal #1 export.
- Socket Security submits takedown requests to NuGet security team for all 4 packages.
- Socket Security Threat Research Team discovers and publishes analysis of all 4 malicious packages. Source: https://socket.dev/blog/four-malicious-nuget-packages-target-asp-net-developers-with-jit-hooking-and-credential
- Threadlinqs Intelligence Platform publishes TL-2026-0137 with full MITRE mapping, detections, and simulations.
- As of 2026-05-29, all 4 malicious NuGet packages (NCryptYo, DOMOAuth2_, IRAOAuth2.0, SimpleWriter_) were removed from NuGet.org after Socket's Feb 2026 disclosure, and actor 'hamzazaheer' now shows 0 packages/0 downloads. No CVE applies, no successor campaign is attributed to this actor, and distribution is dead—only residual backdoors in already-infected apps persist.
Sources cited
- Socket Security: Four Malicious NuGet Packages Target ASP.NET Developers With JIT Hooking and Credential Exfiltration socket.dev · Research · 2026-02-23
- Socket Security — NCryptYo package analysis socket.dev · Research · 2026-02-23
- Socket Security — DOMOAuth2_ package analysis socket.dev · Research · 2026-02-23
- Socket Security — IRAOAuth2.0 package analysis socket.dev · Research · 2026-02-23
- Socket Security — SimpleWriter_ package analysis socket.dev · Research · 2026-02-23
- NuGet.org — hamzazaheer profile (threat actor) nuget.org · Research · 2024-08-21
- Legitimate NCrypto package (typosquatting target) socket.dev · Vendor report
- MITRE ATT&CK — Supply Chain Compromise T1195.002 MITRE · Research · 2026-02-23
- Eziriz .NET Reactor — Obfuscation tool used by NCryptYo eziriz.com · Vendor report · 2026-02-23
- Socket MCP — AI coding assistant package validation socket.dev · Vendor report · 2026-02-23
Previous and next in supply chain
Further reading
AI-drafted from 10 cited sources; published ; last updated —.