more stack stuff - courses.cs.washington.edu · 2012. 10. 28. · zedi, zeax ( %esp), zedi zebp,...

31
CSE 351 Section 5 More Stack Stuff (selected slides by Tom Bergan)

Upload: others

Post on 06-Mar-2021

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: More Stack Stuff - courses.cs.washington.edu · 2012. 10. 28. · Zedi, Zeax ( %esp), Zedi Zebp, *esp body cleanup Procedure Call Example (IA32/Linux) Callee int sum(int x, int y)

CSE 351 Section 5More Stack Stuff

(selected slides by Tom Bergan)

Page 2: More Stack Stuff - courses.cs.washington.edu · 2012. 10. 28. · Zedi, Zeax ( %esp), Zedi Zebp, *esp body cleanup Procedure Call Example (IA32/Linux) Callee int sum(int x, int y)

Written HW #2

● Due tomorrow at 5PM● Try not to use late days on the written

assignments, save them for the labs● Questions?

Page 3: More Stack Stuff - courses.cs.washington.edu · 2012. 10. 28. · Zedi, Zeax ( %esp), Zedi Zebp, *esp body cleanup Procedure Call Example (IA32/Linux) Callee int sum(int x, int y)

Stack review

Page 4: More Stack Stuff - courses.cs.washington.edu · 2012. 10. 28. · Zedi, Zeax ( %esp), Zedi Zebp, *esp body cleanup Procedure Call Example (IA32/Linux) Callee int sum(int x, int y)
Page 5: More Stack Stuff - courses.cs.washington.edu · 2012. 10. 28. · Zedi, Zeax ( %esp), Zedi Zebp, *esp body cleanup Procedure Call Example (IA32/Linux) Callee int sum(int x, int y)
Page 6: More Stack Stuff - courses.cs.washington.edu · 2012. 10. 28. · Zedi, Zeax ( %esp), Zedi Zebp, *esp body cleanup Procedure Call Example (IA32/Linux) Callee int sum(int x, int y)
Page 7: More Stack Stuff - courses.cs.washington.edu · 2012. 10. 28. · Zedi, Zeax ( %esp), Zedi Zebp, *esp body cleanup Procedure Call Example (IA32/Linux) Callee int sum(int x, int y)
Page 8: More Stack Stuff - courses.cs.washington.edu · 2012. 10. 28. · Zedi, Zeax ( %esp), Zedi Zebp, *esp body cleanup Procedure Call Example (IA32/Linux) Callee int sum(int x, int y)
Page 9: More Stack Stuff - courses.cs.washington.edu · 2012. 10. 28. · Zedi, Zeax ( %esp), Zedi Zebp, *esp body cleanup Procedure Call Example (IA32/Linux) Callee int sum(int x, int y)
Page 10: More Stack Stuff - courses.cs.washington.edu · 2012. 10. 28. · Zedi, Zeax ( %esp), Zedi Zebp, *esp body cleanup Procedure Call Example (IA32/Linux) Callee int sum(int x, int y)
Page 11: More Stack Stuff - courses.cs.washington.edu · 2012. 10. 28. · Zedi, Zeax ( %esp), Zedi Zebp, *esp body cleanup Procedure Call Example (IA32/Linux) Callee int sum(int x, int y)
Page 12: More Stack Stuff - courses.cs.washington.edu · 2012. 10. 28. · Zedi, Zeax ( %esp), Zedi Zebp, *esp body cleanup Procedure Call Example (IA32/Linux) Callee int sum(int x, int y)
Page 13: More Stack Stuff - courses.cs.washington.edu · 2012. 10. 28. · Zedi, Zeax ( %esp), Zedi Zebp, *esp body cleanup Procedure Call Example (IA32/Linux) Callee int sum(int x, int y)
Page 14: More Stack Stuff - courses.cs.washington.edu · 2012. 10. 28. · Zedi, Zeax ( %esp), Zedi Zebp, *esp body cleanup Procedure Call Example (IA32/Linux) Callee int sum(int x, int y)
Page 15: More Stack Stuff - courses.cs.washington.edu · 2012. 10. 28. · Zedi, Zeax ( %esp), Zedi Zebp, *esp body cleanup Procedure Call Example (IA32/Linux) Callee int sum(int x, int y)
Page 16: More Stack Stuff - courses.cs.washington.edu · 2012. 10. 28. · Zedi, Zeax ( %esp), Zedi Zebp, *esp body cleanup Procedure Call Example (IA32/Linux) Callee int sum(int x, int y)
Page 17: More Stack Stuff - courses.cs.washington.edu · 2012. 10. 28. · Zedi, Zeax ( %esp), Zedi Zebp, *esp body cleanup Procedure Call Example (IA32/Linux) Callee int sum(int x, int y)
Page 18: More Stack Stuff - courses.cs.washington.edu · 2012. 10. 28. · Zedi, Zeax ( %esp), Zedi Zebp, *esp body cleanup Procedure Call Example (IA32/Linux) Callee int sum(int x, int y)
Page 19: More Stack Stuff - courses.cs.washington.edu · 2012. 10. 28. · Zedi, Zeax ( %esp), Zedi Zebp, *esp body cleanup Procedure Call Example (IA32/Linux) Callee int sum(int x, int y)
Page 20: More Stack Stuff - courses.cs.washington.edu · 2012. 10. 28. · Zedi, Zeax ( %esp), Zedi Zebp, *esp body cleanup Procedure Call Example (IA32/Linux) Callee int sum(int x, int y)
Page 21: More Stack Stuff - courses.cs.washington.edu · 2012. 10. 28. · Zedi, Zeax ( %esp), Zedi Zebp, *esp body cleanup Procedure Call Example (IA32/Linux) Callee int sum(int x, int y)
Page 22: More Stack Stuff - courses.cs.washington.edu · 2012. 10. 28. · Zedi, Zeax ( %esp), Zedi Zebp, *esp body cleanup Procedure Call Example (IA32/Linux) Callee int sum(int x, int y)
Page 23: More Stack Stuff - courses.cs.washington.edu · 2012. 10. 28. · Zedi, Zeax ( %esp), Zedi Zebp, *esp body cleanup Procedure Call Example (IA32/Linux) Callee int sum(int x, int y)

Lab 3 - Buffer Overflows

Page 24: More Stack Stuff - courses.cs.washington.edu · 2012. 10. 28. · Zedi, Zeax ( %esp), Zedi Zebp, *esp body cleanup Procedure Call Example (IA32/Linux) Callee int sum(int x, int y)

Bufbomb Introduction

● Several stages● Practice analyzing stack organization● Practice with buffer overflows

Page 25: More Stack Stuff - courses.cs.washington.edu · 2012. 10. 28. · Zedi, Zeax ( %esp), Zedi Zebp, *esp body cleanup Procedure Call Example (IA32/Linux) Callee int sum(int x, int y)

Bufbomb Introduction

GDB commands from today:gdb bufbombset args -u <username>break getbufrundisasdisplay $rspstepix /40x ($rsp - 40) (show the 40 bytes above rsp)break *(&getbuf + 12) (create a breakpoint at 12 bytes

after the start of getbuf)continue

Page 26: More Stack Stuff - courses.cs.washington.edu · 2012. 10. 28. · Zedi, Zeax ( %esp), Zedi Zebp, *esp body cleanup Procedure Call Example (IA32/Linux) Callee int sum(int x, int y)
Page 27: More Stack Stuff - courses.cs.washington.edu · 2012. 10. 28. · Zedi, Zeax ( %esp), Zedi Zebp, *esp body cleanup Procedure Call Example (IA32/Linux) Callee int sum(int x, int y)
Page 28: More Stack Stuff - courses.cs.washington.edu · 2012. 10. 28. · Zedi, Zeax ( %esp), Zedi Zebp, *esp body cleanup Procedure Call Example (IA32/Linux) Callee int sum(int x, int y)
Page 29: More Stack Stuff - courses.cs.washington.edu · 2012. 10. 28. · Zedi, Zeax ( %esp), Zedi Zebp, *esp body cleanup Procedure Call Example (IA32/Linux) Callee int sum(int x, int y)
Page 30: More Stack Stuff - courses.cs.washington.edu · 2012. 10. 28. · Zedi, Zeax ( %esp), Zedi Zebp, *esp body cleanup Procedure Call Example (IA32/Linux) Callee int sum(int x, int y)
Page 31: More Stack Stuff - courses.cs.washington.edu · 2012. 10. 28. · Zedi, Zeax ( %esp), Zedi Zebp, *esp body cleanup Procedure Call Example (IA32/Linux) Callee int sum(int x, int y)