Question: In Project 2 Part 3 , you caused the provided project 2 . S to call the function named sekret _ fn by exploiting a
In Project Part you caused the provided projectS to call the function named sekretfn by
exploiting a buffer overflow in gets and overwriting the RA register of main the caller of gets
Your job in this part is to implement a stack canary that gets pushed on the stack just below the
RA register. You will work from a created copy of your project source code. Add the stack canary
implementation to the main function prolog. Choose a stack canary value that is a printable
ASCII or UTF string. You should allocate additional stack space and adjust the stack offsets for
saving RA to do this. Then, in the main function epilog, implement a check to compare the stack
canary on the stack with the expected stack canary value that was stored in the prolog. If the values
do not match, call the exit syscall see ecallreadwrite sample code in Canvas Modules If the
values do match, return as usual from main
In your README report, include the stack canary value you added to main as both the
printable string, and as a hexadecimal value. Show a screenshot of your QtRVSim window showing
the register window when reproducing the attack you came up with from Project Part that calls
sekretfn through the buffer overflow.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
