Hi Vivek, and hi guys. I have a wierd issue.
I was able to execute the JMP-POP-CALL /bin/bash well.
When i created the Execve Stack Shellcode, as it is (without the C program) i can run it and get a full /bin/bash shell. However, when i execute the C program i'm getting a segmantaion fault after the program prints the shellcode length.
So i took vivek's stack shellcode program as it is, and compiled the opcode of it with the C program but
still i'm getting segmantation fault.
It is actually the same c code on the tutorial and the same c code i used for the JMP-CALL-POP shellcode (which again, worked for me).
I'm 99.9% sure the issue has somthing to do with the c program, because i took vivek's code as it is, and if i run it without the c program it works perfectly.
Well, i worked on a x64 system (not smart right? ) and compiled the file as x64.
Well x32 should allways work on x64, but u should compile the file as x32.
I found the problem by looking at the stack, the push command pushed the stack 8 bytes instead of 4 bytes, so by pushing for instance: "////" the stack had the value "00002f2f2f2f" instead of "2f2f2f2f" and the rest of the string. So of course this caused a crush.
So if you working on x64 system, remember to add -m32 to the gcc command.