NuGet Malware Campaign Targets .NET Developers With Fake Hiring Tests
Detection stack
- AIDR
- Alert
- ETL
- Query
Summary
A sophisticated supply chain campaign is using fake developer job assessments and malicious NuGet packages to target Windows .NET developers. The operation employs techniques including DLL side-loading through osk.exe, build-time MSBuild stagers, and GitHub-based Command and Control (C2) infrastructure. Identified malware includes Chrome profile stealers, loaders, and trojanized cryptocurrency wallet analysis tools.
Investigation
Socket researchers uncovered 13 malicious NuGet packages distributed through four accounts and connected them to five separate infection paths using shared owners, Git identities, and naming conventions. The investigation found that attackers use fake GitHub repositories disguised as axios projects to host payloads and support C2 communications. Analysts also discovered a ClickFix phishing page hosted on GitHub Pages that delivers PowerShell-based malware.
Mitigation
Developers should treat all take-home technical assessments as untrusted code and execute them only inside isolated, disposable virtual machines. Organizations should enforce NuGet package source mapping to limit package restoration to trusted feeds and review MSBuild target files for suspicious execution commands. Users should avoid instructions that require manual terminal actions such as Win+R or running PowerShell commands copied from websites.
Response
When malicious activity is detected, developers should isolate the affected system and immediately rotate browser-stored credentials, session cookies, and developer tokens, including GitHub and cloud credentials. Security teams should hunt for unauthorized osk.exe execution, suspicious dotnet.exe processes spawned through MSBuild, and PowerShell activity creating unauthorized shadow copies. Reimaging the compromised system is recommended after credential rotation.
Attack Flow
We are still updating this part.
Detections
Download or Upload via Powershell (via cmdline)
Possible IP Lookup Domain Communications Attempted (via dns)
Short File Name (via cmdline)
Possible Dynamic DNS Service Was Contacted (via dns)
IOCs (HashSha256) to detect: 13 Malicious NuGet Packages Target .NET Developers With Fake Job Assessments Part 2
IOCs (HashSha256) to detect: 13 Malicious NuGet Packages Target .NET Developers With Fake Job Assessments Part 1
IOCs (HashSha1) to detect: 13 Malicious NuGet Packages Target .NET Developers With Fake Job Assessments
IOCs (HashMd5) to detect: 13 Malicious NuGet Packages Target .NET Developers With Fake Job Assessments
IOCs (SourceIP) to detect: 13 Malicious NuGet Packages Target .NET Developers With Fake Job Assessments
IOCs (DestinationIP) to detect: 13 Malicious NuGet Packages Target .NET Developers With Fake Job Assessments
Detection of OskSupport.dll Side-Loading in %LOCALAPPDATA% [Windows Sysmon]
Detect Sideloading Attack via osk.exe, dotnet.exe, and avast.exe [Windows Process Creation]
Simulation Execution
-
Attack Narrative & Commands: The adversary aims to establish a foothold on a developer’s machine by leveraging a malicious NuGet package. Once the package is installed, it drops a malicious DLL named
OskSupport.dllinto the%LOCALAPPDATA%folder. The attacker then executesosk.exe(On-Screen Keyboard) from a specific context or via a hijacked path to trigger the side-loading of the malicious DLL, effectively executing arbitrary code under the guise of a trusted Microsoft process. -
Regression Test Script:
# Simulation of OskSupport.dll Side-Loading $TargetDir = "$env:LOCALAPPDATA" $DllName = "OskSupport.dll" $DllPath = Join-Path $TargetDir $DllName Write-Host "[+] Creating malicious dummy DLL at $DllPath" # Creating a dummy DLL file to trigger FileCreate/ImageLoad telemetry New-Item -Path $DllPath -ItemType "File" -Value "MZ......[Dummy DLL Content]" -Force Write-Host "[+] Attempting to trigger detection by invoking osk.exe" # In a real scenario, the attacker would use a specific method to ensure osk.exe loads the local DLL. # For simulation, we simulate the process interaction. Start-Process "osk.exe" -ErrorAction SilentlyContinue Write-Host "[!] Simulation complete. Check Sysmon logs for osk.exe interacting with $DllName" -
Cleanup Commands:
$TargetDir = "$env:LOCALAPPDATA" $DllName = "OskSupport.dll" $DllPath = Join-Path $TargetDir $DllName if (Test-Path $DllPath) { Remove-Item -Path $DllPath -Force Write-Host "[+] Cleanup successful: $DllPath removed." } else { Write-Host "[-] Cleanup failed: $DllPath not found." }