Firstly, I sorry about unlearly question, because of my bad english, I can not discrible it clearly. I also do not know what is it? whall is it called.
My problem below:
I write a program by C language:
#include <stdio.h>
#include <stdlib.h>
int main() {
char buf[2],buf1[10];
fgets(buf,2,stdin);
fgets(buf1,10,stdin);
puts(buf);
puts(buf1);
printf("Opening Shell...\n");
system("/bin/dash");
printf("\nEND\n");
return 0;
}
My purpose is passing parameter to overflow buffer variables and inserting a command after /bin/dash to read some file that I do not own,.etc... I tried: pipe :
python2.7 -c 'print "a"*12 + "\n" + " -c \"cat tes.c > show\""' | /myprogram
My program run normally, but shellcode -c "cat tes.c > show" maybe do not be used.
I set all file and permission 7777.
So, How can I insert shellcode after /bin/dash?
Thank for reading! Sorry for my bad english.