Spawning a TTY Shell
Often
during pen tests you may obtain a shell without having tty, yet wish to
interact further with the system. 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.
Shell Spawning
python -c 'import pty; pty.spawn("/bin/sh")'
|
echo os.system('/bin/bash')
|
perl —e 'exec "/bin/sh";'
|
lua: os.execute('/bin/sh')
|
:set shell=/bin/bash:shell
|
Many of these will also allow you to escape jail shells. The top 3 would be
my most successful in general for spawning from the command line.
0 Comments