i'm currently trying to exploit a simple program called basic_vuln.c
#include <stdio.h> int main(int argc, char** argv) { char buf[64]; strcpy(buf, argv[1]); }
I'm using xubuntu 12.10 with 3.5.0-17 Linux Kernel, ASLR turned off and compiled with the current version of tiny c compiler.
Now to the actual problem, i'm injecting a basic shellcode which spawns /bin/sh. The problem is that when i execute it within gdb, everything works fine and i get a shell. But if i start the program within bash i get a segfault.
I tried to get a core dump to see where the problem lies, but i guess because of the corrupt memory i don't get any (if i don't give the program any arguments, it segfaults and i get a core dump).
Any ideas? If you require more details on the system like gdb version or similar, i'll post it as fast as i can after request.