Stabilizing Shells

Interactive Upgrade

Python

python -c 'import pty; pty.spawn("/bin/bash")'
/usr/bin/python3 -c 'import pty; pty.spawn("/bin/bash")'

Python3

python3 -c 'import pty; pty.spawn("/bin/bash")'
python3 -c '__import__("pty").spawn("/bin/bash")'

Full Upgrade

python3 -c 'import pty; pty.spawn("/bin/bash")'
ctrl + z
stty raw -echo; fg
export TERM=xterm
# local terminal
stty -a
# remote terminal 
stty cols=xx rows=xx

Bash

SOCAT

attacker host

target Host

Second Method

  • in a local terminal

  • Set TTY to raw

  • Foreground the shell

  • Reinitialize terminal

  • Set shell terminal type

Last updated