An adversary hijacks a privileged thread of execution by injecting malicious code into a running process. By using a privleged thread to do their bidding, adversaries can evade process-based detection that would stop an attack that creates a new process. This can lead to an adversary gaining access to the process's memory and can also enable elevated privileges. The most common way to perform this attack is by suspending an existing thread and manipulating its memory.
Description
Attack Execution Flow
Step 1
Explore[Determine target thread] The adversary determines the underlying system thread that is subject to user-control
[Determina il thread di destinazione] L'avversario identifica il thread di sistema sottostante soggetto a controllo dell'utente
Step 2
Experiment[Gain handle to thread] The adversary then gains a handle to a process thread.
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.
[Ottenere un handle al thread] L'attaccante ottiene quindi un handle a un thread di processo.
Utilizzare la chiamata API "OpenThread" in Windows su un thread noto.
Generare un'eccezione in un blocco privilegiato Java, come una funzione pubblica, e catturarla, o catturare un segnale normale. Il thread rimane così in attesa e l'attaccante può tentare di ottenere un handle su di esso.
Attack Techniques
-
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.
-
Use the "OpenThread" API call in Windows on a known thread.IT: Generare un'eccezione in un blocco privilegiato Java, pubblica funzione, e catturarla, oppure catturare un segnale normale. Il thread si blocca quindi e l'avversario può tentare di ottenere un riferimento ad esso.
Step 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.
On Windows, use 'SuspendThread' followed by 'VirtualAllocEx', 'WriteProcessMemory', and 'SetThreadContext'.
[Alterare la memoria del processo] Una volta che l'avversario ha un handle sul thread target, sospenderà il thread e modificherà la memoria utilizzando chiamate native del sistema operativo.
Su Windows, utilizzare "SuspendThread" seguito da "VirtualAllocEx", "WriteProcessMemory" e "SetThreadContext".
Attack Techniques
-
On Windows, use "SuspendThread" followed by "VirtualAllocEx", "WriteProcessMemory", and "SetThreadContext".
Step 4
Exploit[Resume thread execution] Once the process memory has been altered to execute malicious code, the thread is then resumed.
On Windows, use 'ResumeThread'.
[Riprendi l'esecuzione del thread] Una volta che la memoria del processo è stata modificata per eseguire codice dannoso, il thread viene quindi ripreso.
Su Windows, utilizzare "ResumeThread".
Attack Techniques
-
On Windows, use "ResumeThread".