mardi 4 mars 2014

Lab Help Please With Linux C Progam Race Condition


Vote count:

0




Someone please help me with my lab! I have a lab where I have to use this SeedUbuntu virtual machine for a race condition vulnerability. There is C program that I need to utilize to create the attack so I can access the shadow file. Here is the link to the lab with the programs and PDF information: http://ift.tt/1f5pAYl What I am confused about is exactly how to approach this. I can compile and run the vulp.c program and the shell script in seperate terminals but what do I do next? I know I need symbolic links but where does all this come into play? I also increased the length of delay by a lot so I would have more time. Please help me understand this step by step. I'm so fascinated by it but I want to get it right!



/* vulp.c */

#include <stdio.h>
#include<unistd.h>

#define DELAY 10000

int main()
{
char * fn = "/tmp/XYZ";
char buffer[60];
FILE *fp;
long int i;

/* get user input */
scanf("%50s", buffer );

if(!access(fn, W_OK)){
/* simulating delay */
for (i=0; i < DELAY; i++){
int a = i^2;
}

fp = fopen(fn, "a+");
fwrite("\n", sizeof(char), 1, fp);
fwrite(buffer, sizeof(char), strlen(buffer), fp);
fclose(fp);
}
else printf("No permission \n");
}


asked 1 min ago






Aucun commentaire:

Enregistrer un commentaire