Getting a Fully Interactive TTY Shell
Method 1: Python TTY Module
python3 -c 'import pty;pty.spawn("/bin/bash")'
//Now press CTRL+Z to send the shell in the background
stty -a // get the rows and columns from the first line
stty raw -echo;fg // get back in the shell, Press enter 2 times to get back in
// run the below commands on the compromised machine
stty rows 26 cols 118 // based on the output of stty -a
export TERM=xterm
export TERM=xterm-256color // for colors
exec /bin/bash //I always do this, that's my methodology
// now you should have a full stable shell

Method 2: Using Script Binary (If it is installed on Target System)

pwncat-cs (Automated Way) Best One

Penelope Listener (Automated Way)

Last updated