Question: Draw what the stack should look like for a successful buffer overflow attack. Note that badfile is controlled by the user, and contains your shellcode,

Draw what the stack should look like for a successful buffer overflow attack. Note that badfile is controlled by the user, and contains your shellcode, ie. the malicious code that you want executed.

#include #include #include int bof(char *str) { char buffer [24]; strcpy(buffer , str); return 1; } int main(int argc , char **argv) { char str [517]; FILE *badfile; badfile = fopen("badfile", "r"); fread(str , sizeof(char), 517, badfile ); bof(str); printf("Returned properly "); return 1; }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Computer Network Questions!