Lab 2: Buffer Overflows
Fengwei Zhang
Wayne State University CSC 5991 Cyber Security PracCce 1
Lab 2: Buffer Overflows Fengwei Zhang Wayne State University CSC - - PowerPoint PPT Presentation
Lab 2: Buffer Overflows Fengwei Zhang Wayne State University CSC 5991 Cyber Security PracCce 1 Buffer Overflows One of the most common vulnerabiliCes in soGware Programming languages commonly associated with buffer overflows including
Wayne State University CSC 5991 Cyber Security PracCce 1
Wayne State University CSC 5991 Cyber Security PracCce 2
Wayne State University CSC 5991 Cyber Security PracCce 3
Wayne State University CSC 5991 Cyber Security PracCce 4
Wayne State University CSC 5991 Cyber Security PracCce 5
Wayne State University CSC 5991 Cyber Security PracCce 6
Stack Heap Data Segment Text Segment High memory Low memory
Wayne State University CSC 5991 Cyber Security PracCce 7
Kernel Space Stack Heap BSS Segment Data Segment Text Segment (ELF) 1GB 3GB Local variable: int a FuncCon malloc() UniniCalized staCc variables: staCc char *u staCc char *s = “Hello world” Binary of the program
Wayne State University CSC 5991 Cyber Security PracCce 8
Wayne State University CSC 5991 Cyber Security PracCce 9
Wayne State University CSC 5991 Cyber Security PracCce 10
3 2 Ret Address EBP C High memory Low memory ESP int add (int a, int b) { int c; c = 1+b; return c; }
Wayne State University CSC 5991 Cyber Security PracCce 11
Wayne State University CSC 5991 Cyber Security PracCce 12
(A) str(A) Ret addr(A) EBP(A) A A A A A A High memory Low memory ESP
Wayne State University CSC 5991 Cyber Security PracCce 13
Wayne State University CSC 5991 Cyber Security PracCce 14
Wayne State University CSC 5991 Cyber Security PracCce 15
(A) str(A) Ret addr(A) EBP(A) Canary(A) A A A A A High memory Low memory ESP
Wayne State University CSC 5991 Cyber Security PracCce 16
Wayne State University CSC 5991 Cyber Security PracCce 17