๐ Privesc - 3
๐ Before you start
You can donate to me via Buy Me a Coffee or follow me on Github
๐ Challenge statement
#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;
}
๐ฉ Getting the Flag
Coming soon...
๐ Support
๐ Before you leave
You can donate to me via Buy Me a Coffee or follow me on Github