Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The following program has buffer overflow vulnerability. #include #include int main ( void ) { char buff [ 1 5 ] ; int pass =

The following program has buffer overflow vulnerability.
#include
#include
int main(void){
char buff[15];
int pass =0;
printf("
Enter the password:
");
gets(buff);
if (strcmp(buff, "thegeekstuff"){
printf("
Wrong Password
");
}
else {
printf("
Correct Password
");
pass =1;
}
if (pass){
/* Now give root or admin rights to user */
printf("
Root privileges given to the user
");
}
return 0;
}
a) Explain how it can be exploited and what would be the result of an attack that exploits this
vulnerability?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions