# Upgrading Reverse Shells

Often times reverse shells are hard to work with. Here is how to upgrade them to a proper shell

# Upgrade shell

python -c 'import pty; pty.spawn("/bin/bash")'
# or perl if you are a graybeard
perl -e 'exec "/bin/bash";
# or ruby if you are a hipster
ruby -e "exec '/bin/bash'"

# Upgrade to a full TTY

Once you have reverse shell, upgrade using python, and then background it.

$ python -c 'import pty; pty.spawn("/bin/bash")'
Ctrl-Z

With the listener in background, get your terminals STTY details and bring the listener back to foreground.

stty raw -echo; fg

Set terminal settings in the reverse shell.

export TERM=xterm-256color
# you can also do the following
reset
export SHELL=bash
stty rows <num> columns <cols>