After a security incident, an analyst retrieves a suspicious file. The analyst runs the 'strings' command on it and sees references to 'CreateRemoteThread' and 'WriteProcessMemory'. Which technique does this indicate?
Process injection is a sophisticated technique where an attacker writes malicious code into the address space of a legitimate, running process and then forces that process to execute it. The `WriteProcessMemory` API is crucial for writing the attacker's shellcode or payload into the target process's memory. Subsequently, `CreateRemoteThread` is commonly used to create a new thread within the remote process, directing its execution flow to the starting address of the newly injected code, thereby achieving execution within the target's context.
Why this answer
The presence of 'CreateRemoteThread' and 'WriteProcessMemory' in the output of the 'strings' command is a strong indicator of process injection. These Windows API functions are commonly used together to allocate memory in a target process (VirtualAllocEx), write malicious code into that memory (WriteProcessMemory), and then execute it in the context of the remote process (CreateRemoteThread). This technique allows an attacker to run arbitrary code within a legitimate process, bypassing security controls.
Exam trap
The EC-CEH exam often tests the distinction between process injection and DLL hijacking. Candidates mistakenly associate any DLL-related API call with DLL hijacking, but the key differentiator is that process injection explicitly uses WriteProcessMemory and CreateRemoteThread to write and execute code in a remote process, whereas DLL hijacking relies on search order manipulation without direct memory writing.
How to eliminate wrong answers
Option A is wrong because DLL hijacking involves tricking a legitimate application into loading a malicious DLL by placing it in a directory where the application searches first, not by using API calls to inject code into a remote process. Option B is wrong because privilege escalation typically exploits vulnerabilities or misconfigurations to gain higher-level access rights (e.g., SeBackupPrivilege abuse, token manipulation), and does not inherently rely on WriteProcessMemory and CreateRemoteThread. Option D is wrong because a buffer overflow exploits memory corruption to overwrite adjacent data or control flow (e.g., overwriting a return address on the stack), not by explicitly calling WriteProcessMemory and CreateRemoteThread to inject code into another process.