I 'm trying to execute program with shell code injected into stack (program getting from securityTube.net tutorial , Megaprimer buffer overflow ) very good site (http://www.securitytube.net/)
Our shellcode.c is :
#include <stdio.h>
char shellcode[]="\xb0\x01\x31\xdb\xcd\x80";
main()
{
int *p;
p=(int *)&p+2;
(*p)=(int)shellcode;
}
I compiled with fno-stack-protector
and -z execstack
to disable stack protection, even with these parameters I get segmentation fault,
our shellcode is simply syscall for exit() function, with gdb I noticed that segmentation fault was raised when hiting command int $x80
inside shellcode.
perhaps there is another security param blocking our shellcode
any suggestions pls