TTY Spawn Shell Cheat Sheet
Published on 06 Sep 2019
This is a collection of one-liners commands that will allow you to spawn TTY shells!
very useful for escaping jail shells.
python -c 'import pty; pty.spawn("/bin/sh")'
echo os.system('/bin/bash')
/bin/sh -i
perl —e 'exec "/bin/sh";'
perl: exec "/bin/sh";
ruby: exec "/bin/sh"
lua: os.execute('/bin/sh')
exec "/bin/sh"
From within vi
:!bash
From within vi too
:set shell=/bin/bash:shell
From within nmap
!sh