Below is one example of how to stabilise a reverse-shell.
What are the benefits of a reverse-shell:
- Makes using text editors like nano or vim possible
- Allows use of more keyboard keys; cursor arrows, tab etc
- Common commands like su and ssh require a stable terminal
- Standard error is more robust at showing you output
I was having trouble with an older method of reverse shell stabilisation; the CTF room I was completing kept having the reverse shell die on me. So after a bit of research, I found a slightly tweaked version of my method on this CTF Bookstore writeup [Thanks Richard]
export TERM=xterm-256color python3 -c 'import pty;pty.spawn("/bin/bash")' CTRL+Z stty raw -echo;fg ENTER ENTER
This worked first time.
Amazing work Richard, thanks.