3: Buffer overflows and memory protection

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/9

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 4:18 PM on 4/19/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

10 Terms

1
New cards

Buffer overflow instruction pointer

  • The instruction pointer controls which code executes

  • The instruction pointer is stored on the stack and the stack can be written to, therefore the instruction pointer can be written to

2
New cards

How does a buffer overflow work?

If a buffer is allocated buffer[16], any input more than 16 characters will begin to overwrite other things on the stack

3
New cards

How can a buffer overflow be used in an attack?

  • The attacker sends a long message ending with the address of some code giving them a shell

  • The code could also be part of the original message

  • When the function returns, the attacker’s code is run

4
New cards

Where should code be in memory?

The text area

5
New cards

What does the NX-bit provide?

A hardware distinction between the text and stack

6
New cards

The NX-bit

When enabled, the program will crash is the EIP ever points to the stack

7
New cards

Address space layout randomisation (ASLR)

Adds a random offset to the stack and code’s base each time the program runs, jumps are altered to point to the right line

8
New cards

What is the point of ASLR?

It makes it hard for an attacker to guess the address of where they inject code or the address of particular functions

9
New cards

Stack canaries

  • At the start of a function a random value from the heap is written to the base of the stack

  • When the function finishes, the value on the stack is checked against the value on the heap

10
New cards

What happens if an overwrite attempt is made while there is a stack canary?

The value on the stack will be overwritten, leading to a mismatch