Explore our new Cybersecurity Terms Glossary, explained by our experts.
Cybersecurity Terms Glossary
Injected code betrays itself in memory through executable regions with no file behind them, unlinked modules, and threads starting at addresses that belong to no loaded library.

How Do You Detect Process Injection in Memory?
Process injection is the act of running attacker code inside a process that belongs to someone else, usually a signed Microsoft binary. It defeats naive allowlisting, inherits the host process’s network reputation and privileges, and leaves no new executable on disk. MITRE ATT&CK catalogues it as T1055 with more than a dozen sub-techniques.
Detecting it in memory relies on a simple observation: legitimate executable code almost always has a file behind it. Windows maps a DLL or an EXE from disk, and the memory region records that association. Injected code does not, and that mismatch is what every detection method exploits.
VirtualAllocEx, WriteProcessMemory, then CreateRemoteThread.In Volatility 3 the first pass is short:
python vol.py -f memdump.raw windows.malfind
python vol.py -f memdump.raw windows.ldrmodules
python vol.py -f memdump.raw windows.hollowprocesses
The malfind plugin enumerates virtual address descriptors and reports regions that are both executable and writable and have no mapped file, printing the first bytes so you can see whether an MZ header or a plausible function prologue is present. The ldrmodules plugin compares the three loader lists in the process environment block against the modules actually mapped in memory; a DLL present in memory but missing from one or more lists has been unlinked, which no legitimate loader does.
Thread analysis closes the gap left by module stomping. A thread whose start address falls inside a private region, or inside a module’s code section at an offset that corresponds to no exported function, deserves explanation regardless of what the region’s permissions say.
Dump the region and examine it rather than reporting the plugin output. Useful follow-ups are a strings pass for command server addresses and user agent fragments, a disassembly of the first bytes to see whether the code is real, and a comparison of the in-memory image of a stomped DLL against a clean copy of the same version from disk. PE-sieve and Moneta automate much of this on a live host, scanning every process and reporting implanted, replaced, or patched regions with a classification.
Writable and executable memory with no file behind it is also exactly how a just-in-time compiler works. Expect noise from:
This is why malfind output is a starting list rather than a verdict. Build a baseline of what a clean host of the same build looks like, and the interesting entries stand out immediately.
Memory analysis is retrospective. For detection at the time of the event, the useful telemetry is Sysmon event ID 8 for remote thread creation and event ID 10 for process access with high-privilege access masks such as 0x1F0FFF or 0x1410, both of which precede most injection techniques. Kernel callbacks and the ETW Threat Intelligence provider give an EDR product deeper visibility, which is one of the clearer differences between an EDR platform and traditional antivirus.
A sensible operating model uses both: live telemetry to raise the alert, and memory forensics on the affected host to establish what the injected code actually was and where it called home. That combination underpins our Managed Security Services (MDR), where the alert and the evidence have to arrive together to be useful.
It walks each process’s virtual address descriptors and reports memory regions that are marked executable, are writable or private, and have no mapped file associated with them. It then prints a hex and disassembly preview of the first bytes. Those conditions describe injected code accurately, and they also describe just-in-time compiled code, which is why every hit needs verification.
It can make detection harder. Module stomping overwrites the code section of a legitimately loaded DLL, so the region still has a file behind it and passes the usual heuristic. Attackers also restore original memory permissions after execution. Thread start address analysis, comparison against a clean copy of the module, and entropy checks remain effective against these techniques.
Because just-in-time compilation does the same thing injection does. The .NET runtime, JavaScript engines, and Java virtual machines all allocate writable executable memory and run code from it without any file backing. Endpoint protection software deliberately injects monitoring libraries into other processes. A baseline of normal behaviour on a clean build of the same image removes most of this noise.
Sysmon event ID 8 records remote thread creation, and event ID 10 records one process opening a handle to another, with the requested access mask included. Masks granting full access or memory write and thread creation rights are the ones that matter. EDR products add kernel callbacks and the ETW Threat Intelligence provider, which sees allocation and protection changes that user-mode logging misses.
You May Be Interested In These
We use a few cookies that are needed to make this website work, and they are always on. We would also like to set analytics cookies, to see which pages are useful; functional cookies, so that our live chat works; and advertising cookies, to measure our campaigns. We will not set any of those until you say yes, and you can change your mind at any time from the Cookie Settings link in the footer.
Choose the cookies you are happy for us to use. Strictly necessary cookies are always on; everything else is off until you turn it on.
These cookies keep the website working: they hold your security checks, your form submissions and the choice you make here. The site cannot run without them, so they are always on.
These let our live chat open and remember your conversation, and let the newsletter sign-up work. Switch them off and the chat window will not appear.
These tell us which pages are read and how people find us, so that we can improve the site. The reports are about groups of visitors, never about you personally.
These let us measure our advertising and show you our adverts on other websites, such as LinkedIn, Google and Meta. Switch them off and you will still see adverts, but they will be less relevant.