Presentation is loading. Please wait.

Presentation is loading. Please wait.

Buffer Overflows.

Similar presentations


Presentation on theme: "Buffer Overflows."— Presentation transcript:

1 Buffer Overflows

2 Overflow Overflow can write into existing data or code
Space for 8 chars Scanf will read a string of any length

3 Overflow Memory View Before reading “AndrewScholer”: After:

4 Reading Safely scanf("%s", myCString) potentially unsafe But can specify number of characters to read with %NUMBERs

5 Reading Safely Prevent overflow
fgets(myCString, size, stdin) only reads in size -1 chars Prevent overflow

6 Stack Attacks Stack contains more than your variables
Information about where function returns to Where parent function’s stack frame is located

7 Stack Attacks Imagine c is holding user input…

8 Stack Attacks Buffer overflow could change where the function returns to, parent’s stack, etc…

9 Heartbleed – Buffer Underflow

10 Heartbleed – Buffer Underflow

11 Heartbleed– Buffer Underflow


Download ppt "Buffer Overflows."

Similar presentations


Ads by Google