Question: This is Urgent!!! I need help getting this code to compile and run on my Oracle Virtual Box in the Ubuntu environment with gcc compiler.

This is Urgent!!! I need help getting this code to compile and run on my Oracle Virtual Box in the Ubuntu environment with gcc compiler. I am trying to:

1) get the buffer overflow

2) Be able to log into the account successfully

3) Be able to step through the code and understand how variables are stored on the stack

int main(int argc, char *argv[]) {

int allow_login = 0;

char pwdstr[12];

char targetpwd[12] = "MyPwd123";

gets(pwdstr);

if(strncmp(pwdstr, targetpwd, 12) == 0)

allow_login = 1;

if(allow_login == 0)

printf("Login request rejected");

else

printf("Login request allowed");

}

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 Databases Questions!