Buffer Overflow Flashcards
buffer overflow exploitation
What is a buffer?
Is an area of adjacent memory locations allocated to a program or application to handle its runtime data.
What is buffer overflow?
Is a common vulnerability in an applications or programs that accepts more data than the allocated buffer.
How do attackers exploit the buffer overflow vulnerability?
The vulnerability allows the application exceed the buffer while writing data to the buffer and overwrite neighboring memory locations. Then attackers inject malicious code into the buffer to damage files, modify program data, etc.
List 3 reasons why programs and applications are vulnerable to buffer overflows.
*Boundary checks are not performed fully.
*Use of older versions of programming languages.
*Use of unsafe and vulnerable functions.
*Use of bad programming practices.
*Failing to set proper filtering and validation principles.
*Executing code present in the stack segment.
*Improper memory allocation.
*Insufficient input sanitation.
What is the ERP(extended instruction pointer) register?
Es un registro que se utiliza para almacenar la direccion de la proxima instruccion que la CPU ejecutara en el flujo de un programa.
Explica LIFO
Es un principio de organizacion de datos que define como se gestionan los elementos en una estructura, donde el ultimo elemento que se agrega es el primero en ser retirado.
Que significa las siglas SP en una plia?
Stack Pointer
Cuales son los tipos de Stack Overflow?
*Stack based buffer overflow.
*Heap based buffer overflow.
Que es la Heap Memory?
Es una region de la memoria dinamica en un programa que se utiliza para almacenar datos cuyo tamaño o tiempo de vida no se conoce en tiempo de compilación.
Explique con lujo de detalle el stack-based buffer overflow.
Luego de que una funcion es ejecutada en un stack la funcion finaliza con un return, y en el registro EIP se guarda un return addreess, si la aplicacion es vulnerable el atacante sustituye el address de EIP con codigo malicioso.
Cuales son los tres principales tipos de registros de un stack?
*EBP: extended base pointer
*ESP: extended stack pointer
*EIP: extended instruction pointer
Para que sirve Netcat?
Is a computer networking utility for reading from and writing to network connections using TCP or UDP.
Que hace el comando nc -nv 10.10.1.11 9999?
Nos conectamos a la ip 10.10.1.11 usando netcat. Usando direcciones ip y en modo verbose.
Que son spike templates?
Spike templates define the package formats used for communicating with the vulnerable server. They are useful for testing and identifying functions vulnerable to buffer overflow exploitation.
Que es spiking?
El término spiking se refiere al proceso de utilizar spike templates para realizar pruebas automatizadas o semiautomatizadas sobre un sistema objetivo.
Que hace el comando generic_send_tcp 10.10.1.11 9999 stats.spk 0 0?
Here, 10.10.1.11 is the IP address of the target machine (Windows 11), 9999 is the target port number, stats.spk is the spike_script, and 0 and 0 are the values of SKIPVAR and SKIPSTR.
Que hace el comando usr/share/metasploit-framework/tools/exploit/pattern_create.rb -l 11900?
Genera un patrón único de 11,900 bytes.
Menciona los pasos necesarios para realizar un buffer overflow.
*Perform Spiking.
*Perform Fuzzing.
*Indentifying the offset.
*Overwrite the EIP.
*Identify bad characters.
*Identify the right module.
*Generate shellcode.
*Gain root access.
Cual es la diferencia entre Fuzzing y Identifying the offset.
Fuzzing: Proporciona una estimación inicial del tamaño del buffer necesario para causar un crash. Sin esta etapa, el proceso de identificar el offset exacto sería más difícil y consumiría más tiempo.
Identifying the Offset: Perfecciona los resultados de fuzzing al determinar exactamente qué parte de la entrada afecta EIP.