Question: MULTIPLE PROCESSOR SYSTEMS SECURITY Q25) (Security) Consider the code below from the textbook: 1 int main (int argc, char *argv[ ] ) { 2 char

MULTIPLE PROCESSOR SYSTEMS

SECURITY

Q25) (Security) Consider the code below from the textbook:

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

2    char src[100], dst[100], cmd[256] = "cp ";      /* declare 3 character arrays */

3    printf("Please enter name of source file: ");   /* ask for source file */

4    gets(src);                                       /* get input from the keyboard */

5    strcat(cmd, src);                               /* concatenate src after cp */

6    strcat(cmd, " ");                            /* add a space to the end of cmd */

7    printf("Please enter name of destination file: "); /* ask for output file name */

8    gets(dst);                                       /* get input from the keyboard */

9    strcat(cmd, dst);                            /* complete the commands string */

10  system(cmd);                                      /* execute the cp command */

11 }

Let us assume that the code above is written by a programmer with no ill objective. Notice however that the program is interacting with the user at lines 4 and 8. Is it possible for a user of the program to interact with the program to exploit it: (Answers without proper detailed explanations will be disregarded)

a) Using Buffer Overflow Attack? Describe how the user can possibly exploit it?

b) Using Command Injection Attack? Describe how the user can possibly exploit it?

Step by Step Solution

3.41 Rating (157 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

This question about multiple processor systems and security involves understanding vulnerabilities associated with user input handling in code Lets ad... View full answer

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 Operating System Questions!