๐ Privesc - 3
๐ Avant de commencer
Vous pouvez me faire un don via Buy Me a Coffee ou me suivre Github
๐ รnoncรฉ du challenge
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#define BUFFER_SIZE 1024
int main(int argc, char **argv){
char userinput[BUFFER_SIZE] = {0};
char buffer[BUFFER_SIZE] = {0};
printf("Password: ");
fgets(userinput, BUFFER_SIZE, stdin);
userinput[strlen(userinput) - 1] = '\0'; // strip \n
printf("User input: %s\n", userinput);
FILE *f = fopen("./flag.txt","r");
if (f) {
fgets(buffer, BUFFER_SIZE, f);
}
if (strcmp(userinput,buffer) == 0) {
printf("You can validate with: ");
execlp("cat","cat","./flag.txt",NULL);
} else {
puts("Wrong Password");
}
return 0;
}
๐ฉ Avoir le flag
Coming soon...
๐ Support
๐ Avant de quitter
Vous pouvez me faire un don via Buy Me a Coffee ou me suivre Github