a3
This commit is contained in:
1
4/level3/flag.txt
Normal file
1
4/level3/flag.txt
Normal file
@@ -0,0 +1 @@
|
|||||||
|
hacklab{thanks_mario_but_the_flag_is_on_another_server}
|
||||||
BIN
4/level3/level3
Executable file
BIN
4/level3/level3
Executable file
Binary file not shown.
24
4/level3/level3.c
Normal file
24
4/level3/level3.c
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
// gcc -o level3 -no-pie -fno-stack-protector level3.c
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
|
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;
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user