Buffer Overflow attacks target improper or missing bounds checking on buffer operations, typically triggered by input injected by an adversary. As a consequence, an adversary is able to write past the boundaries of allocated buffer regions in memory, causing a program crash or potentially redirection of execution as per the adversaries' choice.
Description
Attack Execution Flow
Step 1
Explore[Identify target application] The adversary identifies a target application or program to perform the buffer overflow on. Adversaries often look for applications that accept user input and that perform manual memory management.
[Identifica applicazione target] L'avversario individua un'applicazione o un programma target su cui eseguire il buffer overflow. Gli avversari cercano spesso applicazioni che accettano input dall'utente e che gestiscono manualmente la memoria.
Step 2
Experiment[Find injection vector] The adversary identifies an injection vector to deliver the excessive content to the targeted application's buffer.
Provide large input to a program or application and observe the behavior. If there is a crash, this means that a buffer overflow attack is possible.
[Trova vettore di injection] L'attaccante identifica un vettore di injection per consegnare il contenuto eccessivo nel buffer dell'applicazione target.
Fornisci un input di grandi dimensioni a un programma o applicazione e osserva il comportamento. Se si verifica un crash, ciò significa che è possibile un attacco di buffer overflow.
Attack Techniques
-
Provide large input to a program or application and observe the behavior. If there is a crash, this means that a buffer overflow attack is possible.
Step 3
Experiment[Craft overflow content] The adversary crafts the content to be injected. If the intent is to simply cause the software to crash, the content need only consist of an excessive quantity of random data. If the intent is to leverage the overflow for execution of arbitrary code, the adversary crafts the payload in such a way that the overwritten return address is replaced with one of the adversary's choosing.
Create malicious shellcode that will execute when the program execution is returned to it.
Use a NOP-sled in the overflow content to more easily 'slide' into the malicious code. This is done so that the exact return address need not be correct, only in the range of all of the NOPs
[Contenuto di overflow artificiale] L'adversary crea il contenuto da iniettare. Se l'intento è semplicemente causare il crash del software, il contenuto deve consistere solo in una quantità eccessiva di dati casuali. Se l'intento è sfruttare l'overflow per l'esecuzione di codice arbitrario, l'adversary crea il payload in modo che l'indirizzo di ritorno sovrascritto venga sostituito con uno scelto dall'adversary.
Creare shellcode malevolo che verrà eseguito quando l'esecuzione del programma viene restituita a esso.
Utilizzare un NOP-sled nel contenuto di overflow per facilitare il "rimbalzo" nel codice malevolo. Questo viene fatto in modo che l'indirizzo di ritorno esatto non debba essere corretto, ma solo essere nel range di tutti i NOPs.
Attack Techniques
-
Use a NOP-sled in the overflow content to more easily "slide" into the malicious code. This is done so that the exact return address need not be correct, only in the range of all of the NOPs
-
Create malicious shellcode that will execute when the program execution is returned to it.IT: Utilizzare una NOP-sled nel contenuto dell'overflow per facilitare il "scivolamento" nel codice malevolo. Questo viene fatto in modo che l'indirizzo di ritorno esatto non sia necessario, basta che rientri nell'intervallo di tutte le NOPs.
Step 4
Exploit[Overflow the buffer] Using the injection vector, the adversary injects the crafted overflow content into the buffer.
[Overflow del buffer] Utilizzando il vettore di injection, l'attore malevolo inserisce il contenuto di overflow appositamente creato nel buffer.