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 to Expert-Tailored 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

Recommended Textbook for

Select Healthcare Classification Systems And Databases

Authors: Katherine S. Rowell, Ann Cutrell

1st Edition

0615909760, 978-0615909769

More Books

Students also viewed these Databases questions

Question

At what value does a partnership record partners' contributions?

Answered: 1 week ago

Question

5.21 Solve Problem 5.20 for a parallel-flow heat exchanger.

Answered: 1 week ago