diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c6d5808 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +exploit +exploit.o diff --git a/exploit.c b/exploit.c index 72f3540..83d7ff1 100644 --- a/exploit.c +++ b/exploit.c @@ -55,16 +55,26 @@ int main(int argc, char** argv){ text[len - 1] = 0; } int index = 0; + char uid[400]; while (text[index]){ if (text[index] == 'U'){ - if (strncmp(text + index, "UID=", 4)){ + if (strncmp(text + index, "UID=", 4) == 0){ printf("pattern found\n"); + index += 4; + int j = 0 ; + while(text[index] && text[index] != ';' && text[index] != '\r' && text[index] != '\n'){ + uid[j] = text[index]; + j++; + index++; + } + uid[j + 1] = 0; break; } } index++; } + printf("uid=%s\n", uid); fclose(fichier_out); free(file_buffer); return 0;