diff --git a/4/level3/flag.txt b/4/level3/flag.txt new file mode 100644 index 0000000..edd5b55 --- /dev/null +++ b/4/level3/flag.txt @@ -0,0 +1 @@ +hacklab{thanks_mario_but_the_flag_is_on_another_server} diff --git a/4/level3/level3 b/4/level3/level3 new file mode 100755 index 0000000..b1c9861 Binary files /dev/null and b/4/level3/level3 differ diff --git a/4/level3/level3.c b/4/level3/level3.c new file mode 100644 index 0000000..71cb7ac --- /dev/null +++ b/4/level3/level3.c @@ -0,0 +1,24 @@ +// gcc -o level3 -no-pie -fno-stack-protector level3.c +#include +#include + +const char command[] = "/bin/sh"; + +void win(char *cmd) { + char *argv[2]; + argv[0] = cmd; + argv[1] = NULL; + execve(cmd, argv, NULL); +} + +int main(int argc, char **argv) { + // Disable output buffering. Not part of the challenge. + setvbuf(stdout, NULL, _IONBF, 0); + setvbuf(stdin, NULL, _IONBF, 0); + + char buffer[32]; + puts("What do you want to talk about?"); + fgets(buffer, 320, stdin); + puts("Bye."); + return 0; +}