Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please cite these online sources. The diagrams should be your own (not copied fr

ID: 3755428 • Letter: P

Question

Please cite these online sources. The diagrams should be your own (not copied from the online resources). Write a testing program in C language that contains a stack buffer overflow vulnerability.

Show what the stack layout looks like and explain how to exploit it. In particular, please include in your diagram:

1. The order of parameters (if applicable), return address, saved registers (if applicable), and local variable(s),

2. Their sizes in bytes,

3. Size of the overflowing buffer to reach return address,

4. The overflow direction in the stack. You are not required to write the real exploit code, but you may want to use some figures to make your description clear and concise.

Explanation / Answer

The program above simulates scenario where a program expects a password from user and if the password is correct then it grants root privileges to the user.

Let’s the run the program with correct password ie ‘thegeekstuff’ :