<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Mohammadhaghighat on Medium]]></title>
        <description><![CDATA[Stories by Mohammadhaghighat on Medium]]></description>
        <link>https://medium.com/@mohammadhaghighat?source=rss-5137438e211a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*4ui4BvpxtWll0V1Y</url>
            <title>Stories by Mohammadhaghighat on Medium</title>
            <link>https://medium.com/@mohammadhaghighat?source=rss-5137438e211a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 07:38:05 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mohammadhaghighat/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Beyond Process Creation: Reverse Engineering and Detecting Windows Process Reflection]]></title>
            <link>https://medium.com/@mohammadhaghighat/beyond-process-creation-reverse-engineering-and-detecting-windows-process-reflection-bb3a17943f33?source=rss-5137438e211a------2</link>
            <guid isPermaLink="false">https://medium.com/p/bb3a17943f33</guid>
            <category><![CDATA[windows-internals]]></category>
            <category><![CDATA[detection-engineering]]></category>
            <dc:creator><![CDATA[Mohammadhaghighat]]></dc:creator>
            <pubDate>Tue, 17 Nov 2026 16:41:00 GMT</pubDate>
            <atom:updated>2026-11-17T16:41:00.350Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hr21ls8eXTdbg0samzd1HA.jpeg" /></figure><p>Tracing ntdll!RtlCreateProcessReflection from x64 disassembly to Sysmon telemetry and Sigma rules.</p><h3>1 — Introduction</h3><p>In most SOC environments, monitoring process creation relies heavily on telemetry like Sysmon Event ID 1, which means an executable file is mapped from disk and an initial thread starts running. The Windows NT kernel natively supports process forking, though. This mechanism allows a process to call the undocumented API ntdll!RtlCreateProcessReflection and clone the virtual address space of a target process in memory using Copy-on-Write (CoW) page tables. Microsoft originally built this for Windows Error Reporting (WER). Attackers now abuse it to dump memory or run code stealthily, leaving a blind spot in traditional telemetry.</p><p>For my research, I want to show how this two-level architecture works in assembly and the kernel, covering ZwMapViewOfSection, the injected helper thread RtlpProcessReflectionStartup, and the dual return mechanism in RtlCloneUserProcess. I will also show how Sysmon Event ID 1 is affected by implicit PPID distortion due to how PspInsertThread behaves. From there, I&#39;ll break down the telemetry artifacts across Event IDs 1, 8, and 10, and build a Splunk query and Sigma rule to catch the technique.</p><h3>2 — Structure of Standard Process Creation vs. Cloning Process</h3><p>The standard user-mode path for creating a process is CreateProcessW -&gt; CreateProcessInternalW -&gt; NtCreateUserProcess. Windows maps the executable file from disk (SEC_IMAGE) and starts the initial thread. SOC Tier 1 analysts track this via Sysmon Event ID 1 or Windows Security Event ID 4688. Process cloning skips disk mapping altogether and duplicates the memory of a running process directly in the kernel.</p><h3>3 — Two-Stage Architecture in ntdll.dll</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zexcfoGY7SzlrhceJ4WUvg.png" /></figure><p>A common misconception is that RtlCreateProcessReflection directly calls a kernel syscall to clone an external process. It does not. The underlying cloning function, ntdll!RtlCloneUserProcess, can only clone its own caller process (NtCurrentProcess() == -1) and cannot target a remote process directly. To get around this, Windows uses a two-stage cross-process architecture:</p><p>3.1 — Shared memory section allocation (initiator context):<br> RtlCreateProcessReflection receives the target process handle in RCX. First, it calls ZwCreateSection to create a shared memory block. Next, it calls ZwMapViewOfSection twice, passing SectionHandle in RCX and the target process handle in RDX:</p><ul><li>First call inside the initiator process (RDX = -1, meaning NtCurrentProcess).</li><li>Second call inside the target process (RDX = TargetProcessHandle).</li></ul><p>After mapping both views, the initiator writes the control structure (flags, event handles, and the optional StartRoutine address) into that shared memory.</p><p>3.2 — Remote coordinator thread injection (RtlCreateUserThread):<br> The initiator process loads the address of an internal, unexported API named ntdll!RtlpProcessReflectionStartup using a lea instruction. It then calls RtlCreateUserThread (via RtlpCreateUserThreadEx) on the target process handle, passing the address of the shared memory mapped in the target process space as the context parameter.</p><p>3.3 — Cloning within the target process (RtlCloneUserProcess):<br> Execution now jumps into the target process. The injected helper thread starts running at RtlpProcessReflectionStartup, reads the shared parameters, and calls ntdll!RtlCloneUserProcess. Inside this function, Windows invokes the NtCreateUserProcess syscall with the PROCESS_CREATE_FLAGS_INHERIT_FROM_PARENT (0x00000100) flag so the new process inherits the parent&#39;s address space without a disk-backed image section (SectionHandle = NULL).</p><p>3.4 — Dual return mechanism (STATUS_PROCESS_CLONED and STATUS_SUCCESS):<br> Similar to fork in Unix systems, NtCreateUserProcess returns twice into two different address spaces. The chain RtlCloneUserProcess -&gt; RtlpProcessReflectionStartup separates them by checking EAX with cmp eax, 0x129:</p><ul><li>The First Step: inside RtlCloneUserProcess<br> Once the syscall returns, cmp eax, 0x129 checks which process is running. In the child clone (EAX == 0x129), internal ntdll locks and the child&#39;s PEB are reinitialized before returning STATUS_PROCESS_CLONED (0x129) to RtlpProcessReflectionStartup. The parent gets STATUS_SUCCESS (0x0).</li><li>The Second Step: inside RtlpProcessReflectionStartup<br> This function checks the return value of RtlCloneUserProcess:</li><li>In the target parent process (EAX == 0x0): The newly created clone handles are copied into the initiator process via ZwDuplicateObject.</li><li>In the new cloned process (EAX == 0x129): Control flow moves to the child. If a custom StartRoutine is provided, it runs. Otherwise, the cloned thread waits on an internal synchronization event by calling ZwWaitForSingleObject (putting the thread into a Waiting / WrUserRequest state, not Suspended) and exits with STATUS_SUCCESS (0x0).</li></ul><h3>4 — Bitmask Access Logic for OpenProcess</h3><p>RtlCreateProcessReflection needs to query process metadata, map a memory section, start a remote thread, and duplicate handles across processes. That requires four specific access permissions on the target handle:</p><ul><li>PROCESS_CREATE_THREAD (0x0002): Required by RtlCreateUserThread to execute the thread in RtlpProcessReflectionStartup.</li><li>PROCESS_VM_OPERATION (0x0008): Required by ZwMapViewOfSection to map shared parameters into the target process space.</li><li>PROCESS_DUP_HANDLE (0x0040): Required by ZwDuplicateObject to copy the cloned handles into the initiator process.</li><li>PROCESS_QUERY_INFORMATION (0x0400): Required by ZwQueryInformationProcess to check the base status and architecture (WoW64) of the target process.</li></ul><p>I didn’t need PROCESS_VM_WRITE = 0x0020 because data transfer happens through ZwMapViewOfSection instead of ZwWriteVirtualMemory:</p><p>DesiredAccess = 0x0002 | 0x0008 | 0x0040 | 0x0400 = 0x044A</p><p>Using ZwQueryInformationProcess with the lighter PROCESS_QUERY_LIMITED_INFORMATION (0x1000) flag changes the mask to 0x104A. Also, per Microsoft&#39;s process access-right documentation, Windows automatically grants PROCESS_QUERY_LIMITED_INFORMATION (0x1000) whenever PROCESS_QUERY_INFORMATION (0x0400) is granted, which expands a 0x044A request into 0x144A.</p><h3>5 — Open ntdll.dll</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/659/1*3bQcDWaAh-UMcTv5ECTpMQ.png" /></figure><p>First, RtlCreateProcessReflection checks the target process state via ZwQueryInformationProcess (ProcessInformationClass = 0x1B). It then calls ZwAllocateVirtualMemory on NtCurrentProcess (RCX = -1) to allocate a local 0x58-byte (88 bytes) staging buffer (var_A0) for the reflection control parameters.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/354/1*BCBEZl5c2e1pgNeSVRnxiQ.png" /></figure><p>Instead of using PROCESS_VM_WRITE, the initiator creates a shared memory section via ZwCreateSection (SEC_COMMIT = 0x8000000, PAGE_READWRITE = 0x04) and saves the handle in var_68.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/320/1*kSJLgzcdT2_zMIzkt-FS8w.png" /></figure><p>Next, it calls ZwMapViewOfSection with the section handle in RCX and the target process handle (R14) in RDX, mapping the shared view directly into the remote target&#39;s virtual address space (var_70).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/257/1*hXrVsdYjGJ9DIJA3qx7Kcg.png" /></figure><p>Inside the target process, the injected worker thread calls RtlCloneUserProcess. That function executes the NtCreateUserProcess syscall with PROCESS_CREATE_FLAGS_INHERIT_FROM_PARENT (0x100) and checks cmp eax, 0x129 to split execution between the parent and the clone.</p><h3>6 — Lab</h3><h3>6.1 — Test Environment and Sysmon Config</h3><p>I ran all tests on the following machine setup:</p><ul><li><strong>OS Build:</strong> Windows 11 x64 26300.9974 (26H2)</li><li><strong>ntdll.dll Version:</strong> 10.0.26100.9974 (WinBuild.160101.0800)</li><li><strong>Offsets in ntdll.dll:</strong> RtlCreateProcessReflection = +0x99330, RtlpProcessReflectionStartup = +0x998D0</li><li><strong>Tools:</strong> Sysmon v15.15 (schema 4.90), MSVC cl.exe (VS 2022), IDA Pro, x64dbg, System Informer</li></ul><p>Sysmon configuration used to capture Event IDs 1, 8, and 10:</p><pre>&lt;Sysmon schemaversion=&quot;4.90&quot;&gt;<br>  &lt;HashAlgorithms&gt;sha256&lt;/HashAlgorithms&gt;<br>  &lt;EventFiltering&gt;<br>    &lt;RuleGroup name=&quot;ReflectionLab&quot; groupRelation=&quot;or&quot;&gt;<br>      &lt;ProcessCreate onmatch=&quot;include&quot;&gt;<br>        &lt;Image condition=&quot;contains&quot;&gt;ReflectionTelemetrySim.exe&lt;/Image&gt;<br>        &lt;Image condition=&quot;end with&quot;&gt;notepad.exe&lt;/Image&gt;<br>        &lt;ParentImage condition=&quot;contains&quot;&gt;ReflectionTelemetrySim.exe&lt;/ParentImage&gt;<br>        &lt;ParentImage condition=&quot;end with&quot;&gt;notepad.exe&lt;/ParentImage&gt;<br>      &lt;/ProcessCreate&gt;<br>      &lt;CreateRemoteThread onmatch=&quot;include&quot;&gt;<br>        &lt;SourceImage condition=&quot;contains&quot;&gt;ReflectionTelemetrySim.exe&lt;/SourceImage&gt;<br>        &lt;TargetImage condition=&quot;end with&quot;&gt;notepad.exe&lt;/TargetImage&gt;<br>      &lt;/CreateRemoteThread&gt;<br>      &lt;ProcessAccess onmatch=&quot;include&quot;&gt;<br>        &lt;SourceImage condition=&quot;contains&quot;&gt;ReflectionTelemetrySim.exe&lt;/SourceImage&gt;<br>        &lt;TargetImage condition=&quot;end with&quot;&gt;notepad.exe&lt;/TargetImage&gt;<br>      &lt;/ProcessAccess&gt;<br>    &lt;/RuleGroup&gt;<br>  &lt;/EventFiltering&gt;<br>&lt;/Sysmon&gt;</pre><h3>6.2 — Code</h3><p>Here is the C++ code (ReflectionTelemetrySim.cpp) I wrote to test the reflection call and inspect the logs:</p><pre>#if !defined(_WIN64)<br>#error &quot;This code must be compiled as a 64-bit (x64) binary.&quot;<br>#endif<br>#include &lt;windows.h&gt;<br>#include &lt;winternl.h&gt;<br>#include &lt;stdio.h&gt;<br>#ifndef RTL_PROCESS_REFLECTION_FLAGS_INHERIT_HANDLES<br>#define RTL_PROCESS_REFLECTION_FLAGS_INHERIT_HANDLES 0x02<br>#endif<br>#ifndef RTL_PROCESS_REFLECTION_FLAGS_NO_SYNCHRONIZE<br>#define RTL_PROCESS_REFLECTION_FLAGS_NO_SYNCHRONIZE  0x08<br>#endif<br>typedef struct _RTL_PROCESS_REFLECTION_REFLECTION_INFORMATION {<br>    HANDLE ReflectionProcessHandle;<br>    HANDLE ReflectionThreadHandle;<br>    CLIENT_ID ReflectionClientId;<br>} RTL_PROCESS_REFLECTION_REFLECTION_INFORMATION, *PRTL_PROCESS_REFLECTION_REFLECTION_INFORMATION;<br>typedef NTSTATUS(NTAPI* fnRtlCreateProcessReflection)(<br>    HANDLE ProcessHandle,<br>    ULONG Flags,<br>    PVOID StartRoutine,<br>    PVOID StartContext,<br>    HANDLE EventHandle,<br>    PRTL_PROCESS_REFLECTION_REFLECTION_INFORMATION ReflectionInformation<br>);<br>static void CloseIfValid(HANDLE&amp; h) {<br>    if (h != NULL &amp;&amp; h != INVALID_HANDLE_VALUE) {<br>        CloseHandle(h);<br>        h = NULL;<br>    }<br>}<br>int main() {<br>    STARTUPINFOA si = { sizeof(si) };<br>    PROCESS_INFORMATION pi = { 0 };<br>    HANDLE hTarget = NULL;<br>    RTL_PROCESS_REFLECTION_REFLECTION_INFORMATION reflInfo = { 0 };<br>    DWORD desiredAccess = PROCESS_CREATE_THREAD | PROCESS_VM_OPERATION | PROCESS_DUP_HANDLE | PROCESS_QUERY_INFORMATION; // 0x044A<br>    ULONG flags = RTL_PROCESS_REFLECTION_FLAGS_INHERIT_HANDLES | RTL_PROCESS_REFLECTION_FLAGS_NO_SYNCHRONIZE; // 0x0A<br>    NTSTATUS status = -1;<br>    HMODULE hNtdll = GetModuleHandleA(&quot;ntdll.dll&quot;);<br>    if (!hNtdll) return 1;<br>    fnRtlCreateProcessReflection pRtlCreateProcessReflection = (fnRtlCreateProcessReflection)GetProcAddress(<br>        hNtdll, &quot;RtlCreateProcessReflection&quot;<br>    );<br>    if (!pRtlCreateProcessReflection) return 1;<br>    printf(&quot;[*] Initiator PID: %lu\n&quot;, GetCurrentProcessId());<br>    printf(&quot;[*] RtlCreateProcessReflection address: 0x%p\n&quot;, (void*)pRtlCreateProcessReflection);<br>    if (!CreateProcessA(&quot;C:\\Windows\\System32\\notepad.exe&quot;, NULL, NULL, NULL, FALSE, 0, NULL, NULL, &amp;si, &amp;pi)) {<br>        printf(&quot;[-] CreateProcessA failed: %lu\n&quot;, GetLastError());<br>        return 1;<br>    }<br>    printf(&quot;[+] Spawned target notepad.exe -&gt; PID: %lu\n&quot;, pi.dwProcessId);<br>    Sleep(1000);<br>    hTarget = OpenProcess(desiredAccess, FALSE, pi.dwProcessId);<br>    if (!hTarget) {<br>        printf(&quot;[-] OpenProcess(0x044A) failed: %lu\n&quot;, GetLastError());<br>        goto cleanup;<br>    }<br>    printf(&quot;[+] Opened target handle: 0x%p (DesiredAccess = 0x%04X)\n&quot;, hTarget, desiredAccess);<br>    status = pRtlCreateProcessReflection(hTarget, flags, NULL, NULL, NULL, &amp;reflInfo);<br>    if (status == 0) {<br>        printf(&quot;[+] Reflection succeeded!\n&quot;);<br>        printf(&quot;    Cloned PID: %llu | Cloned TID: %llu\n&quot;,<br>            (unsigned long long)reflInfo.ReflectionClientId.UniqueProcess,<br>            (unsigned long long)reflInfo.ReflectionClientId.UniqueThread);<br>        printf(&quot;[*] Press Enter to terminate processes and clean up...\n&quot;);<br>        (void)getchar();<br>    } else {<br>        printf(&quot;[-] RtlCreateProcessReflection failed with NTSTATUS: 0x%08X\n&quot;, (unsigned int)status);<br>    }<br>cleanup:<br>    if (reflInfo.ReflectionProcessHandle) {<br>        TerminateProcess(reflInfo.ReflectionProcessHandle, 0);<br>    }<br>    if (pi.hProcess) {<br>        TerminateProcess(pi.hProcess, 0);<br>    }<br>    CloseIfValid(reflInfo.ReflectionThreadHandle);<br>    CloseIfValid(reflInfo.ReflectionProcessHandle);<br>    CloseIfValid(hTarget);<br>    CloseIfValid(pi.hThread);<br>    CloseIfValid(pi.hProcess);<br>    return 0;<br>}</pre><p>A few notes on the code:</p><ul><li>#if !defined(_WIN64) forces a 64-bit build. Trying to reflect a 64-bit process from a 32-bit WoW64 process fails immediately in the kernel (STATUS_INVALID_PARAMETER) due to PEB and thread context layout differences.</li><li>RtlCreateProcessReflection is resolved at runtime via GetModuleHandleA(&quot;ntdll.dll&quot;) and GetProcAddress, keeping it out of the static Import Address Table (IAT).</li><li>I passed 0x044A to OpenProcess instead of PROCESS_ALL_ACCESS (0x1FFFFF).</li><li>Passing NULL for StartRoutine and StartContext with Flags = 0x0A (RTL_PROCESS_REFLECTION_FLAGS_INHERIT_HANDLES | RTL_PROCESS_REFLECTION_FLAGS_NO_SYNCHRONIZE) clones the target without running shellcode. The cloned thread enters ZwWaitForSingleObject and stays in a Wait:UserRequest state until I press Enter to clean up.</li></ul><h3>6.3 — Compile the code</h3><p>Compiling in the x64 Native Tools Command Prompt:What this command does:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*_kyW4I6zKp7ODCq_n0_rlA.png" /></figure><ul><li>cl.exe -&gt; Microsoft compiler</li><li>/W4 -&gt; Warning level 4</li><li>/O2 -&gt; Maximum speed optimization</li><li>/Zi -&gt; Output debug symbols (.pdb) for debugging</li></ul><h3>6.4 — Dynamic Analysis in x64dbg</h3><p>I loaded ReflectionTelemetrySim.exe into x64dbg to watch the registers and handles live.</p><p>Step 1: Setting the breakpoint on ntdll!RtlCreateProcessReflection in the command bar:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/551/1*3KJIb6UGMwaAwfcZARnKOg.png" /></figure><p>Step 2: Checking the registers<br> Hitting F9 lets ReflectionTelemetrySim.exe (PID: 13664) resolve RtlCreateProcessReflection at 0x00007FFF57BE9330, spawn notepad.exe (PID: 20132), and call OpenProcess(0x044A). It gets back handle 0x388.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*890ayZ16c4-XtBt6cRoOlw.png" /></figure><p>OpenProcess succeeds and I immediately hit the breakpoint at 0x00007FFF57BE9330 (RIP). Here are the incoming arguments:</p><ul><li>RCX (Arg 1 - ProcessHandle): 0x0000000000000388</li><li>RDX (Arg 2 - Flags): 0x000000000000000A</li></ul><p>The prologue saves RCX into R14 (mov r14, rcx) and moves the flags from EDX (0x0A) into ESI (mov esi, edx).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/977/1*XxuuXf9fszZIzsjl7QsP0w.png" /></figure><p>Step 3: Stepping over the call and checking System Informer<br> I pressed F9 to let the call finish. Checking System Informer shows how the process tree changes:</p><p>Before calling RtlCreateProcessReflection:</p><pre>└── cmd.exe (PID: 8420)<br>    └── ReflectionTelemetrySim.exe (PID: 13664)<br>        └── Notepad.exe (PID: 20132)</pre><p>After calling RtlCreateProcessReflection:</p><pre>└── cmd.exe (PID: 8420)<br>    └── ReflectionTelemetrySim.exe (PID: 13664)<br>        └── Notepad.exe (PID: 20132)<br>            └── Notepad.exe (PID: 11564, Main Thread TID: 16824 - State: Wait:UserRequest)</pre><p>Looking at thread TID 16824 inside the cloned Notepad.exe (PID 11564) in System Informer confirms its state is <strong>Wait:UserRequest</strong> (not Suspended). Since StartRoutine was NULL, RtlpProcessReflectionStartup simply called ZwWaitForSingleObject on the reflection event handle.</p><h3>6.5 — Sysmon Logs</h3><p>When I first pulled the Sysmon logs during my x64dbg session, I saw a 23-second gap between Event ID 10 (11:24:37.510) and Event ID 8 (11:25:00.629). At first, this 23-second gap broke my 5-second correlation rule before I realized my own x64dbg breakpoint was the culprit. Running the binary normally without a debugger paused on the entry point shrinks the entire sequence, from OpenProcess to thread injection and process cloning, down to just <strong>5 milliseconds</strong>:</p><ul><li><strong>Event 0: Initiator Process Creation (Sysmon Event ID 1 at </strong><strong>11:24:36.480)</strong></li></ul><pre>EventID: 1<br>UtcTime: 2026-11-13 11:24:36.480<br>ProcessGuid: {4b9f2a10-6c14-6734-8901-000000001200}<br>ProcessId: 13664<br>Image: C:\Lab\ReflectionTelemetrySim.exe<br>CommandLine: &quot;C:\Lab\ReflectionTelemetrySim.exe&quot;<br>ParentProcessGuid: {4b9f2a10-68f0-6734-1200-000000001200}<br>ParentProcessId: 8420<br>ParentImage: C:\Windows\System32\cmd.exe</pre><ul><li><strong>Event 1: Initial Target Process Creation (Sysmon Event ID 1 at </strong><strong>11:24:36.492)</strong></li></ul><p>Normal process creation from my CreateProcessA call. ReflectionTelemetrySim.exe (13664) spawns Notepad.exe (20132).</p><pre>EventID: 1<br>UtcTime: 2026-11-13 11:24:36.492<br>ProcessGuid: {4b9f2a10-6c14-6734-8a01-000000001200}<br>ProcessId: 20132<br>Image: C:\Program Files\WindowsApps\Microsoft.WindowsNotepad_11.2607.14.0_x64__8wekyb3d8bbwe\Notepad\Notepad.exe<br>CommandLine: &quot;C:\Windows\System32\notepad.exe&quot;<br>ParentProcessGuid: {4b9f2a10-6c14-6734-8901-000000001200}<br>ParentProcessId: 13664<br>ParentImage: C:\Lab\ReflectionTelemetrySim.exe</pre><ul><li><strong>Event 2: Default Handle Creation by </strong><strong>CreateProcessA (Sysmon Event ID 10 at </strong><strong>11:24:36.493)</strong></li></ul><p>Logged 1ms later. CreateProcessA automatically grants the parent a full-access handle (0x1FFFFF) to its child in pi.hProcess, which is why I excluded 0x1FFFFF in my detection rules.</p><pre>EventID: 10<br>UtcTime: 2026-11-13 11:24:36.493<br>SourceProcessGUID: {4b9f2a10-6c14-6734-8901-000000001200}<br>SourceProcessId: 13664<br>SourceImage: C:\Lab\ReflectionTelemetrySim.exe<br>TargetProcessGUID: {4b9f2a10-6c14-6734-8a01-000000001200}<br>TargetProcessId: 20132<br>TargetImage: C:\Program Files\WindowsApps\Microsoft.WindowsNotepad_11.2607.14.0_x64__8wekyb3d8bbwe\Notepad\Notepad.exe<br>GrantedAccess: 0x1FFFFF<br>CallTrace: C:\WINDOWS\SYSTEM32\ntdll.dll+167df4|C:\WINDOWS\System32\KERNELBASE.dll+6e8f5|C:\WINDOWS\System32\KERNEL32.DLL+44ec4|C:\Lab\ReflectionTelemetrySim.exe+7418</pre><ul><li><strong>Event 3: Reflection Handle Acquisition (Sysmon Event ID 10 at </strong><strong>11:24:37.510)</strong></li></ul><p>My explicit OpenProcess(0x044A) call after Sleep(1000). Windows appends 0x1000, so Sysmon logs 0x144A.</p><pre>EventID: 10<br>UtcTime: 2026-11-13 11:24:37.510<br>SourceProcessGUID: {4b9f2a10-6c14-6734-8901-000000001200}<br>SourceProcessId: 13664<br>SourceImage: C:\Lab\ReflectionTelemetrySim.exe<br>TargetProcessGUID: {4b9f2a10-6c14-6734-8a01-000000001200}<br>TargetProcessId: 20132<br>TargetImage: C:\Program Files\WindowsApps\Microsoft.WindowsNotepad_11.2607.14.0_x64__8wekyb3d8bbwe\Notepad\Notepad.exe<br>GrantedAccess: 0x144A<br>CallTrace: C:\WINDOWS\SYSTEM32\ntdll.dll+1668a4|C:\WINDOWS\System32\KERNELBASE.dll+1bf36|C:\Lab\ReflectionTelemetrySim.exe+7468</pre><ul><li><strong>Event 4: Coordinator Thread Injection (Sysmon Event ID 8 at </strong><strong>11:24:37.512)</strong></li></ul><pre>EventID: 8<br>UtcTime: 2026-11-13 11:24:37.512<br>SourceProcessGuid: {4b9f2a10-6c14-6734-8901-000000001200}<br>SourceProcessId: 13664<br>SourceImage: C:\Lab\ReflectionTelemetrySim.exe<br>TargetProcessGuid: {4b9f2a10-6c14-6734-8a01-000000001200}<br>TargetProcessId: 20132<br>TargetImage: C:\Program Files\WindowsApps\Microsoft.WindowsNotepad_11.2607.14.0_x64__8wekyb3d8bbwe\Notepad\Notepad.exe<br>NewThreadId: 30656<br>StartAddress: 0x00007FFF57BE98D0<br>StartModule: C:\WINDOWS\SYSTEM32\ntdll.dll<br>StartFunction: -</pre><p>2ms after OpenProcess, RtlCreateProcessReflection injects the worker thread into Notepad.exe (PID 20132). StartAddress (0x00007FFF57BE98D0) points to ntdll!RtlpProcessReflectionStartup, located 0x5A0 bytes after RtlCreateProcessReflection. Because RtlpProcessReflectionStartup is missing from the ntdll.dll Export Address Table (EAT), Sysmon logs StartFunction as -.</p><p>StartFunction: - in ntdll.dll is not unique to Process Reflection on its own. Sysmon infers StartModule and StartFunction from the export table, so any thread starting at an unexported internal ntdll.dll address (like TppWorkerThread or debugger threads) also produces -. That&#39;s why I treated this as a behavioral indicator and correlated it with Event ID 10 and the process context.</p><ul><li><strong>Event 5: Cloned Process Creation and Implicit PPID Distortion (Sysmon Event ID 1 at </strong><strong>11:24:37.515)</strong></li></ul><pre>EventID: 1<br>UtcTime: 2026-11-13 11:24:37.515<br>ProcessGuid: {4b9f2a10-6c2c-6734-8b01-000000001200}<br>ProcessId: 11564<br>Image: C:\Program Files\WindowsApps\Microsoft.WindowsNotepad_11.2607.14.0_x64__8wekyb3d8bbwe\Notepad\Notepad.exe<br>CommandLine: &quot;C:\Windows\System32\notepad.exe&quot;<br>ParentProcessGuid: {4b9f2a10-6c14-6734-8a01-000000001200}<br>ParentProcessId: 20132<br>ParentImage: C:\Program Files\WindowsApps\Microsoft.WindowsNotepad_11.2607.14.0_x64__8wekyb3d8bbwe\Notepad\Notepad.exe</pre><p>3ms after the remote thread starts in PID 20132, it calls RtlCloneUserProcess -&gt; NtCreateUserProcess. When the kernel runs PspInsertThread to fire creation callbacks, the executing thread belongs to Notepad.exe (PID 20132), not ReflectionTelemetrySim.exe (PID 13664). Event ID 1 therefore logs Notepad.exe (PID 20132) spawning another Notepad.exe (PID 11564), leaving ReflectionTelemetrySim.exe completely out of Event ID 1.</p><p>This implicit PPID change is also different from the MITRE ATT&amp;CK Parent PID Spoofing technique (T1134.004). In T1134.004, an attacker explicitly passes PROC_THREAD_ATTRIBUTE_PARENT_PROCESS to fake the parent handle. Here, no attribute is spoofed. The parent PID changes simply because NtCreateUserProcess runs from inside the remote thread in PID 20132. For that reason, I mapped the detection below only to T1055 (Process Injection) and not T1134.004 or T1003.001 .</p><h3>7 — Detection (Splunk and Sigma)</h3><p>To catch this without getting flooded by false positives, I correlated Event ID 10 (checking for the 0x004A reflection bits + query bit 0x0400 or 0x1000) with Event ID 8 (StartModule in ntdll.dll and empty/- StartFunction) between the same source and target processes within 5 seconds.</p><h3>7.1 — Splunk SPL Query</h3><p>Look closely at the raw logs in Section 6.5: Event ID 10 uses uppercase SourceProcessGUID / TargetProcessGUID, while Event ID 8 uses SourceProcessGuid / TargetProcessGuid. Depending on your Splunk add-on, the event ID field is also named either EventID or EventCode. The query below normalizes those fields first with coalesce and then runs a bitwise check (bit_and) on GrantedAccess:</p><pre>index=Win_Sysmon (EventCode IN (8, 10) OR EventID IN (8, 10))<br>| eval NormEventID = coalesce(EventID, EventCode)<br>| eval NormSourceGuid = lower(coalesce(SourceProcessGuid, SourceProcessGUID))<br>| eval NormTargetGuid = lower(coalesce(TargetProcessGuid, TargetProcessGUID))<br>| eval AccessInt = tonumber(replace(GrantedAccess, &quot;^0x&quot;, &quot;&quot;), 16)<br>| eval HasCoreReflectionBits = if(NormEventID=10 AND AccessInt!=2097151 AND bit_and(AccessInt, 74) == 74 AND (bit_and(AccessInt, 1024) == 1024 OR bit_and(AccessInt, 4096) == 4096), 1, 0)<br>| eval IsUnexportedNtdllThread = if(NormEventID=8 AND match(StartModule, &quot;(?i)\\\\ntdll\.dll$&quot;) AND (isnull(StartFunction) OR StartFunction==&quot;-&quot; OR StartFunction==&quot;&quot;), 1, 0)<br>| where HasCoreReflectionBits=1 OR IsUnexportedNtdllThread=1<br>| stats earliest(_time) as FirstSeen, latest(_time) as LastSeen,<br>        dc(NormEventID) as UniqueEvents,<br>        values(NormEventID) as EventIDs,<br>        values(GrantedAccess) as GrantedAccessMasks,<br>        values(StartAddress) as ThreadStartAddresses,<br>        values(SourceImage) as InitiatorImage,<br>        values(TargetImage) as ReflectedTargetImage<br>        by NormSourceGuid, NormTargetGuid, host<br>| eval TimeDelta = LastSeen - FirstSeen<br>| where UniqueEvents == 2 AND TimeDelta &gt;= 0 AND TimeDelta &lt;= 5<br>| search NOT InitiatorImage IN (&quot;C:\\Windows\\System32\\WerFault.exe&quot;, &quot;C:\\Windows\\SysWOW64\\WerFault.exe&quot;, &quot;C:\\Windows\\System32\\WerFaultSecure.exe&quot;)<br>| table FirstSeen, host, InitiatorImage, ReflectedTargetImage, GrantedAccessMasks, ThreadStartAddresses, TimeDelta</pre><h3>7.2 — Sigma Rule (Known Access Mask Variants)</h3><p>Standard Sigma has no bitwise AND operator for hex strings, so GrantedAccess|endswith only matches known access mask variants (and can miss cases if extra access bits like PROCESS_TERMINATE 0x0001 are added). Here are the suffix variants included in the rule:</p><ul><li>04A, 44A (0x044A / 0x104A / 0x144A)</li><li>45A (0x044A | PROCESS_VM_READ 0x0010 = 0x045A / 0x145A)</li><li>46A (0x044A | PROCESS_VM_WRITE 0x0020 = 0x046A / 0x146A)</li><li>47A (0x044A | 0x0010 | 0x0020 = 0x047A / 0x147A)</li><li>4CA (0x044A | PROCESS_CREATE_PROCESS 0x0080 = 0x04CA / 0x14CA)</li><li>54A (0x044A | PROCESS_SET_QUOTA 0x0100 = 0x054A / 0x154A)</li><li>C4A (0x044A | PROCESS_SUSPEND_RESUME 0x0800 = 0x0C4A / 0x1C4A)</li></ul><p>I only excluded WerFault.exe and WerFaultSecure.exe in the filter. Leaving out svchost.exe, taskmgr.exe, and procdump.exe ensures analysts don&#39;t miss attackers injecting into svchost.exe or using procdump.exe -r to dump processes via reflection.</p><pre>title: Correlated Process Reflection Chain via RtlCreateProcessReflection<br>id: 1598fb01-41ad-46ca-9c57-7592c1cc9408<br>status: experimental<br>description: &gt;<br>    Correlates known handle access mask variants for ntdll!RtlCreateProcessReflection<br>    (Sysmon Event ID 10) followed by an unexported ntdll.dll remote thread<br>    (Sysmon Event ID 8) between the same source and target processes.<br>author: Mohammad Haghighat<br>date: 2026-11-13<br>tags:<br>    - attack.defense_evasion<br>    - attack.privilege_escalation<br>    - attack.t1055<br>correlation:<br>    type: temporal_ordered<br>    rules:<br>        - reflection_handle_access<br>        - reflection_remote_thread<br>    group-by:<br>        - SourceProcessGuid<br>        - TargetProcessGuid<br>    timespan: 5s<br>falsepositives:<br>    - Windows Error Reporting (WerFault.exe / WerFaultSecure.exe)<br>    - Diagnostic tools calling PssCaptureSnapshot (Taskmgr.exe, SystemInformer.exe, ProcDump -r)<br>level: high<br>---<br>name: reflection_handle_access<br>id: 9f3c8d21-4a7b-4e19-8c2d-5e6f7a8b9c0d<br>status: experimental<br>logsource:<br>    product: windows<br>    service: sysmon<br>detection:<br>    selection_access:<br>        EventID: 10<br>        GrantedAccess|endswith:<br>            - &#39;04A&#39;<br>            - &#39;44A&#39;<br>            - &#39;45A&#39;<br>            - &#39;46A&#39;<br>            - &#39;47A&#39;<br>            - &#39;4CA&#39;<br>            - &#39;54A&#39;<br>            - &#39;C4A&#39;<br>    filter_wer:<br>        SourceImage:<br>            - &#39;C:\Windows\System32\WerFault.exe&#39;<br>            - &#39;C:\Windows\SysWOW64\WerFault.exe&#39;<br>            - &#39;C:\Windows\System32\WerFaultSecure.exe&#39;<br>    condition: selection_access and not filter_wer<br>---<br>name: reflection_remote_thread<br>id: 7a1d4e62-3b9c-4d81-a5e0-1c2b3d4e5f6a<br>status: experimental<br>logsource:<br>    product: windows<br>    service: sysmon<br>detection:<br>    selection_thread_module:<br>        EventID: 8<br>        StartModule|endswith: &#39;\ntdll.dll&#39;<br>    selection_thread_func:<br>        - StartFunction:<br>              - &#39;-&#39;<br>              - &#39;&#39;<br>              - &#39;RtlpProcessReflectionStartup&#39;<br>        - StartFunction: null<br>    filter_wer:<br>        SourceImage:<br>            - &#39;C:\Windows\System32\WerFault.exe&#39;<br>            - &#39;C:\Windows\SysWOW64\WerFault.exe&#39;<br>            - &#39;C:\Windows\System32\WerFaultSecure.exe&#39;<br>    condition: selection_thread_module and selection_thread_func and not filter_wer</pre><p>Testing the rule with sigma-cli:</p><p>I tested the YAML file using sigma-cli v1.1.0 (pySigma v0.11.15, pySigma-backend-splunk v1.1.1):</p><ol><li>Running sigma check passes syntax and schema validation with zero issues:</li></ol><pre>$ sigma check reflection_correlation.yml<br>Checking Sigma rules  [####################################]  100%<br>0 issue(s) found in 1 rule(s).</pre><ol><li>Converting to Splunk (sigma convert -t splunk --without-pipeline reflection_correlation.yml) generates a join subsearch across the two rules, but there are two practical limitations with the auto-generated output:</li></ol><ul><li>First, backend support for temporal_ordered in pySigma does not enforce strict millisecond ordering (Event 10 before Event 8) in the generated Splunk stats/join query out of the box (currently, full temporal_ordered state-machine conversion is mainly supported in the sqlite backend).</li><li>Second, the auto-generated query groups directly by SourceProcessGuid and TargetProcessGuid, which fails to match raw Sysmon Event ID 10 logs where those fields are capitalized as SourceProcessGUID and TargetProcessGUID.</li></ul><p>Output of sigma convert for the base rules:</p><pre>EventID=10 GrantedAccess IN (&quot;*04A&quot;, &quot;*44A&quot;, &quot;*45A&quot;, &quot;*46A&quot;, &quot;*47A&quot;, &quot;*4CA&quot;, &quot;*54A&quot;, &quot;*C4A&quot;) NOT SourceImage IN (&quot;C:\\Windows\\System32\\WerFault.exe&quot;, &quot;C:\\Windows\\SysWOW64\\WerFault.exe&quot;, &quot;C:\\Windows\\System32\\WerFaultSecure.exe&quot;)<br>| join SourceProcessGuid, TargetProcessGuid [<br>    search EventID=8 StartModule=&quot;*\\ntdll.dll&quot; (StartFunction IN (&quot;-&quot;, &quot;&quot;, &quot;RtlpProcessReflectionStartup&quot;) OR NOT StartFunction=&quot;*&quot;) NOT SourceImage IN (&quot;C:\\Windows\\System32\\WerFault.exe&quot;, &quot;C:\\Windows\\SysWOW64\\WerFault.exe&quot;, &quot;C:\\Windows\\System32\\WerFaultSecure.exe&quot;)<br>]</pre><p>Because of those two backend limitations (join subsearch limits/ordering and GUID field casing), you should use the normalized stats + bit_and Splunk query in Section 7.1 for actual production hunting.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bb3a17943f33" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>