level5 and level6 done
This commit is contained in:
26
level6/source.c
Normal file
26
level6/source.c
Normal 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;
|
||||
}
|
Reference in New Issue
Block a user