Question: Q . 8 . ( Marks: 1 0 ) #include #include #include int foo ( char * str ) { char buffer [ 1 0
QMarks:
#include #include #include int foochar str
char buffer; The following statement has a buffer overflow problem strcpybuffer str; return ;
int mainint argc, char argv
char str;
FILE badfile;
badfile fopenbadfiler;
freadstr sizeofchar badfile;
foostr;
printfReturned Properly
;
return ;
In the above given sample code expalin how you would perform a bufferoverflow attack. Draw a detailed diagram of position of variables placed on the stack. Finally also explain how canary based protection mechanism can be used as defense.
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
