Sysmon Event ID 8: CreateRemoteThread — Code Injection Into Another Process
Published
One process started a thread inside another process — Sysmon records which process did it, which process received the thread, and where in the target the new thread begins running.
Logged to: Microsoft-Windows-Sysmon/Operational, on the machine where it happened; filtered in a Sysmon configuration by the <CreateRemoteThread> element.
Microsoft's description
Event ID 8: CreateRemoteThread
The CreateRemoteThread event detects when a process creates a thread in another process. This technique is used by malware to inject code and hide in other processes. The event indicates the source and target process. It gives information on the code that will be run in the new thread: StartAddress, StartModule and StartFunction. Note that StartModule and StartFunction fields are inferred, they might be empty if the starting address is outside loaded modules or known exported functions.
Source: Microsoft's Sysmon documentation
Every field of event 8
| Field | What it tells you |
|---|---|
| SourceImage | The process that created the thread in the other process. This is the side under the attacker's control, so it is where the investigation starts. |
| TargetImage | The process the thread was created in — the process that will run the injected code, and whose identity and privileges the code inherits. |
| StartAddress | The address in the target process where the new thread begins executing. An address that no loaded module covers points at code written into the target's memory. |
| StartModule | The module the start address falls in, when Sysmon can infer one. Microsoft notes the field is inferred and "might be empty if the starting address is outside loaded modules or known exported functions". |
| StartFunction | The exported function at the start address, when Sysmon can infer one. Functions that load a module into the target are the classic DLL-injection pattern. |
| NewThreadId | The thread ID created in the target. Use it to tie later activity attributed to the target process back to this injection. |
| SourceProcessGuid | Joins the event to the source process's creation record (event 1, where it is ProcessGuid) for the command line, parent and hashes. |
| TargetProcessGuid | The same join on the target side — what the injected-into process is, when it started and who started it. |
| SourceUser | The account the source process runs as, which shows whether the injection came from a user session or from a system-level process. |
| RuleName | — |
| UtcTime | — |
| SourceProcessId | — |
| TargetProcessId | — |
| TargetUser | — |
Field names and order from Sysmon's manifest (schema 4.90), checked on every build.
What it records
Microsoft’s description: “The CreateRemoteThread event detects when a process creates a thread in another process. This technique is used by malware to inject code and hide in other processes. The event indicates the source and target process. It gives information on the code that will be run in the new thread: StartAddress, StartModule and StartFunction.”
So each record is a pair plus a landing point. The source side is SourceImage, SourceProcessGuid, SourceProcessId and SourceUser; the target side is TargetImage, TargetProcessGuid, TargetProcessId and TargetUser; and the new thread is described by NewThreadId, StartAddress, StartModule and StartFunction, with UtcTime and RuleName.
The three start fields are the ones that repay reading carefully, and Microsoft qualifies two of them: “Note that StartModule and StartFunction fields are inferred, they might be empty if the starting address is outside loaded modules or known exported functions.” A populated StartModule and StartFunction tell you the thread begins at a known export — a thread that starts at a function which loads a module is the textbook DLL-injection shape. An empty pair with a bare StartAddress tells you the opposite: the entry point is not in anything Sysmon could attribute to a module.
The event is filtered by the <CreateRemoteThread> configuration element, using the conditions Microsoft documents for Sysmon rules (is, is any, contains, begin with, end with, excludes, image and the rest). Because legitimate software also creates remote threads, configurations usually exclude known source/target pairs rather than trying to log nothing:
<CreateRemoteThread onmatch="exclude">
<SourceImage condition="is">C:\Windows\System32\svchost.exe</SourceImage>
<TargetImage condition="end with">\werfault.exe</TargetImage>
</CreateRemoteThread>
Keep that exclude list short and reviewed: anything named there is invisible, and the source image is attacker-chosen.
When it matters
| Reading | Meaning |
|---|---|
| StartModule and StartFunction empty, StartAddress set | The thread begins outside any module Sysmon could infer — memory written into the target (T1055) |
| StartFunction is a module-loading export (LoadLibraryA/W, LdrLoadDll) | The thread’s job is to load a DLL inside the target — DLL injection (T1055.001) |
| TargetImage is a long-running trusted process (explorer.exe, a browser, svchost.exe) from an unrelated SourceImage | Code hiding in a process that is allowed to run and to reach the network |
| SourceImage in a user, temp or public directory, or a script host / rundll32.exe as the source | The injector is not installed software |
| TargetImage is lsass.exe | Something is running code inside the credential store; treat with the same urgency as a handle to LSASS |
| A source that injects into many different targets on one host | Broad injection, often immediately after an initial payload runs |
A single event tells you injection happened; the sequence tells you the story. Look for the source’s process access to the same target just before the thread, and for the target’s network connections and DNS queries just after — traffic attributed to a trusted process is how injected code stays unremarkable.
How to investigate
Threads whose start address Sysmon could not attribute to a module, which is the strongest single signal in this event:
Event
| where TimeGenerated > ago(7d)
| where Source == "Microsoft-Windows-Sysmon" and EventID == 8
| extend D = parse_xml(EventData).DataItem.EventData.Data
| mv-apply d = D on (summarize f = make_bag(bag_pack(tostring(d["@Name"]), tostring(d["#text"]))))
| extend SourceImage = tostring(f.SourceImage), TargetImage = tostring(f.TargetImage),
StartAddress = tostring(f.StartAddress), StartModule = tostring(f.StartModule),
StartFunction = tostring(f.StartFunction), NewThreadId = tostring(f.NewThreadId),
Account = tostring(f.SourceUser)
| where isempty(StartModule) and isempty(StartFunction)
| project TimeGenerated, Computer, Account, SourceImage, TargetImage, StartAddress, NewThreadId
| order by TimeGenerated desc
Rank every source/target pair by how few hosts show it, to separate installed software from one-off injection:
Event
| where TimeGenerated > ago(30d)
| where Source == "Microsoft-Windows-Sysmon" and EventID == 8
| extend D = parse_xml(EventData).DataItem.EventData.Data
| mv-apply d = D on (summarize f = make_bag(bag_pack(tostring(d["@Name"]), tostring(d["#text"]))))
| extend SourceImage = tostring(f.SourceImage), TargetImage = tostring(f.TargetImage),
StartFunction = tostring(f.StartFunction)
| summarize Hosts = dcount(Computer), Events = count(), Functions = make_set(StartFunction, 10),
LastSeen = max(TimeGenerated) by SourceImage, TargetImage
| where Hosts <= 2
| order by LastSeen desc
For anything that survives those filters, follow SourceProcessGuid to the injector’s process creation event for its command line, parent and hashes, and TargetProcessGuid to the same record for the target. Check whether the source loaded anything unusual beforehand with image load events, and map the host’s logons with 4624 to decide whose credentials were exposed. Where the target is lsass.exe, treat the host as a credential-theft case and use the LSASS access rule to sweep the rest of the estate; a Sysmon export can also be triaged in the free log analyzer.
Read a Sysmon log without a SIEM
Copy Microsoft-Windows-Sysmon%4Operational.evtx from C:\Windows\System32\winevt\Logs (or wevtutil epl Microsoft-Windows-Sysmon/Operational sysmon.evtx) and open it in the EVTX viewer: every event in a table, event 8 filterable, with the analyzer's checks for LSASS access, remote threads and suspicious command lines. Nothing is uploaded.
Related events
- Sysmon Event ID 1 Process creation
- Sysmon Event ID 10 ProcessAccess
- Sysmon Event ID 7 Image loaded
- Sysmon Event ID 3 Network connection
- Security Event ID 4688 A new process has been created
- Security Event ID 4624 An account was successfully logged on
Detect it
Frequently Asked Questions
- Why are StartModule and StartFunction empty in Sysmon Event ID 8?
- Microsoft states that both fields are inferred and "might be empty if the starting address is outside loaded modules or known exported functions". In practice an empty StartModule means the address in StartAddress is not covered by any module Sysmon could attribute, which is what you expect when code was written into the target's memory rather than loaded as a DLL.
- Is every CreateRemoteThread event malicious?
- No. Creating a thread in another process is a supported Windows operation, and debuggers, monitoring agents, installers and some security products do it routinely. Baseline the SourceImage and TargetImage pairs in your estate first, then investigate the pairs that appear on few hosts or that no expected software explains.
- How does event 8 relate to Sysmon event 10?
- Event 10 records one process opening a handle to another and the access rights it was granted; event 8 records a thread actually being created in another process. An event 10 with rights that allow writing memory and creating threads, followed by an event 8 between the same two processes, shows the full injection sequence.
- Which fields join an event 8 to the processes involved?
- SourceProcessGuid and TargetProcessGuid match the ProcessGuid of the process creation events (event 1) for the two processes, which carry the command lines, parents, hashes and logon session. SourceProcessId and TargetProcessId do the same job for Windows event 4688 on the same host and time window.
Find every Sysmon 8 that matters
Open a Sysmon .evtx or XML export in the free browser analyzer: LSASS access, remote thread injection, process tampering, suspicious command lines and reverse-shell ports are flagged, with the events behind each. Nothing is uploaded.
Investigating something right now? LogTriage checks every address in the file against threat intelligence and writes the incident report: 10 analyses a month free. The incident pack adds the in-depth AI analysis and files up to 100 MB: 25 analyses for $19, one payment, no subscription. Pricing
How this page was made. The official definitions, field names and examples on it are copied by script from the sources it links and re-checked against them on every build. The investigation advice was drafted with AI from those sources and passed a separate review before publishing. What is checked, and how · found a mistake? [email protected]