Thread Execution Hijacking

T1055.003

Sub-technique of T1055 Process Injection.View on attack.mitre.org

About this technique

Adversaries may inject malicious code into hijacked processes in order to evade process-based defenses as well as possibly elevate privileges. Thread Execution Hijacking is a method of executing arbitrary code in the address space of a separate live process.

Thread Execution Hijacking is commonly performed by suspending an existing process then unmapping/hollowing its memory, which can then be replaced with malicious code or the path to a DLL. A handle to an existing victim process is first created with native Windows API calls such as OpenThread. At this point the process can be suspended then written to, realigned to the injected code, and resumed via SuspendThread , VirtualAllocEx, WriteProcessMemory, SetThreadContext, then ResumeThread respectively.

This is very similar to Process Hollowing but targets an existing process rather than creating a process in a suspended state.

Running code in the context of another process may allow access to the process's memory, system/network resources, and possibly elevated privileges. Execution via Thread Execution Hijacking may also evade detection from security products since the execution is masked under a legitimate process.

Detection rules3

Rules on DetectionCode tagged with T1055.003.

Sigma2

RuleLevelLog source
HackTool - LittleCorporal Generated Maldoc Injectionhighwindows / process_access
Remote Thread Creation In Uncommon Target Imagemediumwindows / create_remote_thread

Splunk1

RuleTypeRiskData source
PowerShell PInvoke Process Injection API ChainTTPNULLPowershell Script Block Logging 4104

Groups0

None recorded.

Software4

Campaigns0

None recorded.

Procedure examples4

Software4

Used byProcedure example
MalwareGazer

Gazer performs thread execution hijacking to inject its orchestrator into a running thread from a remote process.

MalwarePikabot

Pikabot can create a suspended instance of a legitimate process (e.g., ctfmon.exe), allocate memory within the suspended process corresponding to Pikabot's core module, then redirect execution flow via `SetContextThread` API so that when the thread resumes the Pikabot core module is executed.

MalwareTrojan.Karagany

Trojan.Karagany can inject a suspended thread of its own process into a new process and initiate via the ResumeThread API.

MalwareWaterbear

Waterbear can use thread injection to inject shellcode into the process of security software.

References1

  1. Elastic Process Injection July 2017 Open source
    Hosseini, A. (2017, July 18). Ten Process Injection Techniques: A Technical Survey Of Common And Trending Process Injection Techniques. Retrieved December 7, 2017.

Data from MITRE ATT&CK® (Enterprise). ATT&CK® is a registered trademark of The MITRE Corporation.