huge commit

This commit is contained in:
2026-03-09 21:44:25 +01:00
parent ab2e537520
commit d1017bae51
441 changed files with 3438154 additions and 1363 deletions

View File

@@ -0,0 +1,43 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
// --------------------------------------------------- SETUP
void ignore_me_init_buffering()
{
setvbuf(stdin, NULL, _IONBF, 0);
setvbuf(stdout, NULL, _IONBF, 0);
setvbuf(stderr, NULL, _IONBF, 0);
}
// --------------------------------------------------- VULNERABLE FUNCTION
int bug = 0;
void vuln()
{
char name[1024];
printf("What is your name?\n");
int number_read = read(STDIN_FILENO, name, sizeof(name) - 1);
name[number_read-1] = 0;
printf("Thank you ");
printf(name);
printf("!\n");
if(bug){
printf("Oh, you got here somehow, you must have triggered a bug.. Here is the flag: ");
system("cat /flag");
exit(0);
}
printf("But our flag is in another branch!\n");
}
// --------------------------------------------------- MAIN
int main(int argc, char **argv)
{
(void)argc;
(void)argv;
ignore_me_init_buffering();
vuln();
}