level5 and level6 done

This commit is contained in:
2025-04-29 14:00:03 +02:00
parent 32cdde848f
commit fc40e2e002
5 changed files with 51 additions and 0 deletions

26
level6/source.c Normal file
View File

@ -0,0 +1,26 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void n(void)
{
system("/bin/cat /home/user/level7/.pass");
}
void m(void)
{
puts("Nope");
}
int main(int ac, char **av)
{
char *buf;
void (**fn_ptr)(void);
buf = (char *)malloc(64);
fn_ptr = (void (**)(void))malloc(4);
*fn_ptr = m;
strcpy(buf, av[1]);
(*fn_ptr)();
return 0;
}