ngen.exe
Sources: 300M+ executions observed in the wild.
Summary
Native Image Generator (ngen.exe) is part of the .NET Framework. It pre-compiles .NET assemblies into native machine code images and installs them into the native image cache, improving application startup performance. It runs as part of .NET optimization tasks.
ngen.exe is the 11th most commonly executed Windows program in EchoTrail's dataset, observed 6,845,569 times across enterprise environments. It typically runs from C:\Windows\Microsoft.NET\Framework\v4.0.30319 and it is most often launched by ngentask.exe.
Get this in your tools
The same record for ngen.exe, by REST or as an MCP tool. Free key, no card.
curl -H "Authorization: Bearer $ECHOTRAIL_KEY" \
https://api.echotrail.io/v1/process/ngen.exeFree returns the summary. Team returns the full record you see on this page. Endpoint docs
Behavior
Top Paths
- C:\Windows\Microsoft.NET\Framework\v4.0.3031950.59%
- C:\Windows\Microsoft.NET\Framework64\v4.0.3031949.39%
- C:\Windows\Microsoft.NET\Framework\v2.0.507270.01%
- C:\Windows\Microsoft.NET\Framework64\v2.0.507270.01%
- C:\Windows\Microsoft.NET\Framework\v1.1.4322<0.01%
Top Hashes (SHA256)
- bd0a1d5ae494628aea2ee55d427869b009be5994d767b1e336a548f4edf64fc119.9%
- 349cbf8104c3856d750bbb2a241518c3faade9816a500e70b76a40a961e5d6af17.81%
- 0eb067650f90e1af3b660c229a58d5e4c505a928847349e06dadb5e88df713f410.14%
- 723f1f680b822bb287f280e9359aed4b28a92a99d874d642c717cea6eebd8eb28.82%
- e7fab0f72e023f20f332ed97dc0896e725d817eab40e758508308eaa5960d6f86.58%
- 96e0493ec4ca127c94af1ad7e31e2be618b8c9dcc9e81dcec268a5ceb01db6395.56%
- a446d35f5e60bdae1a7117b71d90abb0fea424ee416b0e0ecd2c485dc5939a684.33%
- faceb6f5d1cdc5ad50a4a1b92c4cd3fcdabcf7e8d418014a1b1221c1defa3d8f3.58%
- 458c9a4f63e67d3e8d5b8cb5372681d4a280fad7441c356abd17517ba50f45e63.16%
- d0105566bc22ef92204e163428e5feda866f8a9b2be19be3b95e6327fff3f8c63%
Process Ancestry
Top Grandparents
- taskhostw.exe88.85%
- taskhost.exe8.69%
- msiexec.exe1.94%
- taskhostex.exe0.4%
- svchost.exe0.05%
- ngentask.exe0.05%
- setup.exe<0.01%
- devenv.exe<0.01%
- powershell.exe<0.01%
- services.exe<0.01%
Top Parents
- ngentask.exe97.06%
- msiexec.exe1.97%
- TiWorker.exe0.06%
- PerfWatson2.exe0.01%
- setup.exe<0.01%
- facefoduninstaller.exe<0.01%
- TrustedInstaller.exe<0.01%
- backgroundTaskHost.exe<0.01%
- setupplatform.exe<0.01%
Top Children
- mscorsvw.exe95.8%
- conhost.exe4.19%
- WerFault.exe<0.01%
- musnotifyicon.exe<0.01%
- WMIC.exe<0.01%
- jcosqueryi.exe<0.01%
- SearchFilterHost.exe<0.01%
Security Analysis
What does ngen.exe normally do?
Located in C:\Windows\Microsoft.NET\Framework\v4.0.30319 (32-bit) or C:\Windows\Microsoft.NET\Framework64\v4.0.30319 (64-bit). Primarily launched by ngentask.exe (scheduled .NET optimization) or msiexec.exe (during software installation). Spawns mscorsvw.exe (.NET optimization worker). Runs periodically in the background.
When is ngen.exe suspicious?
Running from a non-standard path. Launched by unusual parents (shells, script interpreters). Spawning unexpected child processes beyond mscorsvw.exe.
How do attackers abuse ngen.exe?
Not commonly abused directly. In theory, could be used to compile malicious .NET assemblies into native images, but this is not a well-documented attack technique.
Detection guidance
Low priority. Validate path is within the .NET Framework directories. Unusual parent processes would be the primary indicator of concern.
False positive notes
High execution count is normal — .NET optimization runs frequently, especially after Windows updates or application installations. Bursts of ngen.exe and mscorsvw.exe activity after updates are expected.
Related Processes
Ask Rocky about ngen.exe
Rocky is the free chat demo. It answers from this same dataset, no account needed.
This page is the Team-tier API record for ngen.exe. The free tier returns the summary, 500 lookups a month. Or ask Rocky.