Flux d'exécution
1) Explore
[Determine target thread] The adversary determines the underlying system thread that is subject to user-control
2) Experiment
[Gain handle to thread] The adversary then gains a handle to a process thread.
Technique
- Use the "OpenThread" API call in Windows on a known thread.
- Cause an exception in a java privileged block public function and catch it, or catch a normal signal. The thread is then hanging and the adversary can attempt to gain a handle to it.
3) Experiment
[Alter process memory] Once the adversary has a handle to the target thread, they will suspend the thread and alter the memory using native OS calls.
Technique
- On Windows, use "SuspendThread" followed by "VirtualAllocEx", "WriteProcessMemory", and "SetThreadContext".
4) Exploit
[Resume thread execution] Once the process memory has been altered to execute malicious code, the thread is then resumed.
Technique
- On Windows, use "ResumeThread".
Conditions préalables
The application in question employs a threaded model of execution with the threads operating at, or having the ability to switch to, a higher privilege level than normal users
In order to feasibly execute this class of attacks, the adversary must have the ability to hijack a privileged thread. This ability includes, but is not limited to, modifying environment variables that affect the process the thread belongs to, or calling native OS calls that can suspend and alter process memory. This does not preclude network-based attacks, but makes them conceptually more difficult to identify and execute.
Compétences requises
Hijacking a thread involves knowledge of how processes and threads function on the target platform, the design of the target application as well as the ability to identify the primitives to be used or manipulated to hijack the thread.
Ressources nécessaires
None: No specialized resources are required to execute this type of attack. The adversary needs to be able to latch onto a privileged thread.
The adversary does, however, need to be able to program, compile, and link to the victim binaries being executed so that it will turn control of a privileged thread over to the adversary's malicious code. This is the case even if the adversary conducts the attack remotely.
Atténuations
Application Architects must be careful to design callback, signal, and similar asynchronous constructs such that they shed excess privilege prior to handing control to user-written (thus untrusted) code.
Application Architects must be careful to design privileged code blocks such that upon return (successful, failed, or unpredicted) that privilege is shed prior to leaving the block/scope.
Faiblesses connexes
CWE-ID |
Nom de la faiblesse |
|
Privilege Context Switching Error The product does not properly manage privileges while it is switching between different contexts that have different privileges or spheres of control. |
Soumission
Nom |
Organisation |
Date |
Date de publication |
CAPEC Content Team |
The MITRE Corporation |
2014-06-23 +00:00 |
|
Modifications
Nom |
Organisation |
Date |
Commentaire |
CAPEC Content Team |
The MITRE Corporation |
2017-01-09 +00:00 |
Updated Related_Attack_Patterns |
CAPEC Content Team |
The MITRE Corporation |
2017-08-04 +00:00 |
Updated Attack_Phases, Attack_Prerequisites, Description Summary, Examples-Instances, Probing_Techniques, Resources_Required |
CAPEC Content Team |
The MITRE Corporation |
2018-07-31 +00:00 |
Updated Description Summary, Examples-Instances, Probing_Techniques |
CAPEC Content Team |
The MITRE Corporation |
2020-07-30 +00:00 |
Updated Execution_Flow, Related_Attack_Patterns, Taxonomy_Mappings |
CAPEC Content Team |
The MITRE Corporation |
2021-10-21 +00:00 |
Updated Description, Execution_Flow, Prerequisites |