Week 10 - Memory Based Attacks Flashcards
Where does the EIP point to?
The current instruction being executed in memory
Where does the ESP point to?
The top of the stack
Where does the EBP point to?
The base of the current stack frame
What happens in the stack when a function is called?
The current EIP and current EBP values are pushed onto the stack. A new stack frame is created at the top of the stack.
What is the NX-bit defence against buffer overflow attacks?
The NX-bit provides a hardware distinction between the text and the stack. If the EIP ever points to the stack the program crashes. This makes it so data in memory can either be executable, or be read/written from/to, but it can not be both.
What is one way of getting around the NX-bit?
To find code in the text you want to execute (such as open the shell), and use a buffer overflow attack to make the EIP point to that code.
How does a buffer overflow attack work?
Write data into a buffer so that the data overflows into the EIP and EBP values stored on the stack. When the current function finishes executing, the overwritten EIP and EBP values will be loaded. This makes it possible to change where the code will resume from.