Section 18.175 Buffer Overflow Flashcards
Objectives 2.2 Explain common threat vectors and attack strategies. Objectives 2.3 Explain various types of vulnerabilities Objectives 2.4 Given a scenario, you must be able to analyse indicators of malicious activity. Objectives 2.5 Explain the purpose of mitigation techniques used to secure the enterprise. Objectives 2.6 Given a scenario, you must be able to apply common security techniques to computing resources.
Buffer Overflow
Occurs when data exceeds allocated memory, potentially enabling unauthorised access or code execution
■ Common initial attack vector in data breaches
● 85% of data breaches used buffer overflow as the initial vector
■ Attackers exploit the excess data written beyond buffer boundaries to manipulate program execution
Buffer
A temporary storage area where a program stores its data
■ They have a defined memory capacity, just like a glass holding a limited amount
of water
■ Overflowing a buffer results in data spilling into adjacent memory locations,
causing unintended consequences
Buffer Overflow Attack - Technical Aspects
Stack
Programs have a reserved memory area called a stack to store data during
processing
■ The stack uses a “first in, last out” organisation
■ Stack contains return addresses when a function call instruction is received
■ Attackers aim to overwrite the return address with their malicious code’s address
Smashing the Stack
Attackers aim to overwrite the return address with a pointer to their malicious
code
■ When the non-malicious program hits the modified return address, it runs the
attacker’s code
■ This gives attackers a command prompt on the victim’s system for remote code execution
NOP Slide
Attackers fill the buffer with NOP (No-Operation) instructions
■ The return address slides down the NOP instructions until it reaches the
attacker’s code
Mitigations against Buffer Overflow Attack
Address Space Layout Randomization (ASLR)
● Helps prevent attackers from guessing return pointer addresses
● Randomises memory addresses used by well-known programs, making it
harder to predict the location of the attacker’s code