Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Operating System Expert

Write an exploit / attack for the scanf function. Explain how the given buffer overflow attack works. Hint: write second program that spits out input.

Deliverables: - discussion of the buffer overflow attack.

                        - stack diagram of the given code execution.

                                    -- valid input.

                                    --invalid input (input that causes function bar to be called.

                        - exploit of scanf.

                        - brief discussion on how to prevent buffer overflows.

#include

#include

void foo (const char * input)

{

            char buf [50];

            printf ("My stack looks like: \n%p\n%p\n%p\n%p\n%p\n%p\n%p\n\n");

strcpy (buf,"I am Bender. Please Insert Girder");

strcat (buf,input);

printf ("%s\n",buf);

printf ("My stack looks like: \n%p\n%p\n%p\n%p\n%p\n%p\n%p\n\n");

return;

}

void bar ()

{

            printf ("Auug! I've been hacked!\n");

            return;

}

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

{

            scanf("%s",buf);

            printf ("address of foo: %p\n",foo);

            printf ("address of bar: %p\n", bar);

            foo (buf);

            return 0;

}

Example Stack Diagram:

Stack diagram for the strcat function at the beginning of function foo.

Hexadecimal Stack

Value Interpretation

0x1

 

0xfeea8380

 

0x212ab6

 

(nil)

The 50-character buffer

(nil)

"

(nil)

"

(nil)

"

(nil)

"

(nil)

"

(nil)

"

(nil)

"

(nil)

"

(nil)

"

(nil)

"

(nil)

"

0xfeea000

 

0x262690

 

0x34235c0

 

0x8048704

 

0xfeea83a8

 

0xfeea8430

 

Oxfeea8418

 

0x80484eb

Return address from foo to main

Operating System, Computer Science

  • Category:- Operating System
  • Reference No.:- M91614090
  • Price:- $20

Priced at Now at $20, Verified Solution

Have any Question?


Related Questions in Operating System

Question description of lasa in this assignment you will

Question: Description of LASA: In this assignment, you will select a real-world operating system (can be for a PC, server, tablet, handheld, or embedded device). You will introduce the operating system and its components ...

Question note apa format 250 words and three reference

Question: Note: APA format 250 words and three reference without plagarism Computerized Operating Systems (OS) are almost everywhere. We encounter them when we use out laptop or desktop computer. We use them when we use ...

Discussion question this research assignment will give

Discussion Question : This research assignment will give further information on the nature and workings of multi-tasking and multi-processing operating systems. All information reported in this assignment is to be in the ...

Research types of operating systems that are currently

Research types of operating systems that are currently available and provide a scenario in which the operating system you chose would be appropriate to be used in this situation. Explain why you think the choice you made ...

Question students working at individual pcs in a computer

Question : Students working at individual PC's in a computer laboratory send their files to be printed by a server that spools the files on its hard disk. Under what conditions may a deadlock occur if the disk space for ...

Question state the required answer precisely and then

Question : State the required answer precisely and then provide proper explanation. It is not enough to provide one- word or one-line answers. What is the purpose of the command interpreter? Why is it usually separate fr ...

Question what do you see as the major differences between

Question : What do you see as the major differences between UNIX/Linux and other operating systems, such as Windows and Mac OS X? The response must be typed, single spaced, must be in times new roman font (size 12) and m ...

Catalog course descriptionin this course students carry out

Catalog Course Description In this course students carry out independent research in a significant technical area of information, network, and computer security. The student is to investigate a technical area, research i ...

State the required answer precisely and then provide proper

State the required answer precisely and then provide proper explanation. It is not enough to provide one- word or one-line answers. Consider a computer embedded in the control of a manned spacecraft. Would it require an ...

Question topic computerized operating systems os are almost

Question: Topic: Computerized Operating Systems (OS) are almost everywhere. We encounter them when we use out laptop or desktop computer. We use them when we use our phone or tablet. Find articles that describes the diff ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As